# UNinstalling Gramps

**URL:** <https://gramps.discourse.group/t/uninstalling-gramps/643>\
**Category:** Help\
**Created:** [August 25, 2020, 2:35am UTC](https://gramps.discourse.group/t/uninstalling-gramps/643 "2020-08-25T02:35:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://gramps.discourse.group/u/philhoward)\
**Post date:** [August 25, 2020, 2:35am UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/1 "2020-08-25T02:35:43Z")

</div>

the first thing i want to do in my fresh install script (after asking if all the trees have been backed up) is uninstall the current version of Gramps being sure all the files have been removed. on Ubuntu (and surely on Debian) all i would need to do is “ **dpkg --purge gramps** ”. but how would i do this if Gramps has been built from source? does building from source on Ubuntu/Debian do the install or create a “ **.deb** ” file to be separately installed? if the former, is there a safe way to uninstall it? any leftover files from a previous version might revert behavior of old cold still in a newer version (e.g. no longer having the file might workaround a problem).

---

<div class="post-metadata">

**Author:** ![anon9092048](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon9092048](https://gramps.discourse.group/u/anon9092048)\
**Post date:** [August 25, 2020, 4:07am UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/2 "2020-08-25T04:07:17Z")

</div>

> [@philhoward](#):
>
> but how would i do this if Gramps has been built from source?

```
# Next time you need to install something with python setup.py -- which should be never but things happen. 

python setup.py install --record files.txt

# This will cause all the installed files to be printed to that directory.
# Then when you want to uninstall it simply run; be careful with the 'sudo'

cat files.txt | xargs sudo rm -rf

```

credit goes to

[![@myusuf3](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/0c4c0c7d3818f72c1449da5168aa921170eccff4.jpeg)](https://gist.github.com/myusuf3)

# [myusuf3](https://gist.github.com/myusuf3)/ **[uninstall.sh](https://gist.github.com/myusuf3/933625)** for the gist on github,

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://gramps.discourse.group/u/philhoward)\
**Post date:** [August 25, 2020, 6:40am UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/3 "2020-08-25T06:40:02Z")

</div>

what if it was previously installed without the person running the script having any idea how or even if it had been done. my first idea is to check dpkg. if it hast it in its list, then i would have dpkg purge it. beyond that i need to work things out. i’m sure this script will evolve over time.

---

<div class="post-metadata">

**Author:** ![Jan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jan/32/173_2.png) [@Jan](https://gramps.discourse.group/u/Jan)\
**Post date:** [August 25, 2020, 1:32pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/4 "2020-08-25T13:32:47Z")

</div>

Hi Phil,  
I don’t know which version you installed from source. But let’s assume you had v5.1.2, which you obtained from ‘[https://github.com/gramps-project/gramps/releases](https://github.com/gramps-project/gramps/releases)’ (click on ‘Assets’ to see the files). After unzipping the source in any folder you will see a file named “INSTALL”. This contains install and uninstall instructions. Reading it with any editor gives:

Uninstall old version  
If you do a source install in the same place as an existing install,  
you need to remove the old version first. You can delete the old  
version by deleting the installed directories. For example, if your installation prefix is /usr/local, remove the following:  
/usr/local/share/gramps  
/usr/local/lib/pythonx.x/site-packages/gramps  
If you installed with a package manager you might instead need to remove  
/usr/local/lib/pythonx.x/dist-packages/gramps

replacing pythonx.x with the python version you used, e.g. python3.4.  
Also remove any gramps .egg files that are installed along with the gramps  
directory and the file /usr/local/bin/gramps.

If you don’t know the list of all files that Gramps installed, you can  
reinstall it with the --record option, and take a look at the list this  
produces (so python setup.py install --record grampsfiles.txt

Gramps is a python application, so loading happens on reading the  
files, meaning that files of a previous version that are no longer  
present in the new version can still be loaded, making the new install  
unstable!  
…  
There is more to read in this file, I hope this will help you a bit further.  
Besides: [https://www.gramps-project.org/wiki/index.php/Linux:Build\_from\_source](https://www.gramps-project.org/wiki/index.php/Linux:Build_from_source)

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://gramps.discourse.group/u/philhoward)\
**Post date:** [August 25, 2020, 10:50pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/5 "2020-08-25T22:50:55Z")

</div>

i am trying to make my script work regardless of which version and/or which way (dpkg or source). i might decide to have it compare versions between what is already installed and what is trying to be installed. if they are the same i could have it report that and ask if they really want to re-install all over again and skip asking if all the trees are backed up. re-installing the existing version in order to record existing files would not be possible if that version is no longer available for download.

yes, i am aware of the problems of leftover files. that’s why i want my script to be sure the old files are cleared out. there is also the risk of a file outside of a “gramps directory” that collides with some other package. are all files supposed to be in a “gramps” directory or named “gramps”?

---

<div class="post-metadata">

**Author:** ![Jan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jan/32/173_2.png) [@Jan](https://gramps.discourse.group/u/Jan)\
**Post date:** [August 26, 2020, 8:43am UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/6 "2020-08-26T08:43:08Z")

</div>

I am not sure if the main Gramps program is installed in directories named ‘Gramps’ only. As stated above you should check by yourself:  
“If you don’t know the list of all files that Gramps installed, you can  
reinstall it with the --record option, and take a look at the list this  
produces (so python setup.py install --record grampsfiles.txt”.  
But not all files needed are installed automatically, see prerequisites list on [https://github.com/gramps-project/gramps](https://github.com/gramps-project/gramps) (for example: osmgpsmap, graphiz, networkx).

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://gramps.discourse.group/u/philhoward)\
**Post date:** [August 26, 2020, 7:20pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/7 "2020-08-26T19:20:07Z")

</div>

are you referring to files needed that are from different packages that Gramps needs?

what if i am installing a .deb file using “dpkg -i”? where does --record go then?

the github page you pointed me to says “The following **three** packages with GObject Introspection bindings (the gi packages)” then lists **eight** packages.

what is the oldest version of Gramps my script could ever encounter already installed by someone using it on a Linux system?

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [August 26, 2020, 7:41pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/8 "2020-08-26T19:41:13Z")

</div>

Linux is the native OS for Gramps. That’s why there are so many flavors of the OS with a Gramps version as a standard download.

[Previous releases](https://gramps-project.org/wiki/index.php/Previous_releases_of_Gramps) go back to 0.1.2 in Apr 2001

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://gramps.discourse.group/u/philhoward)\
**Post date:** [August 26, 2020, 10:37pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/9 "2020-08-26T22:37:22Z")

</div>

where can i download ALL of those previous releases so that i can record an installed file list for each one?

does github have downloadable source code for each version? usually, i run “svn export” to grab project repository source code from github, but that’s not working for gramps, not even for version 5.1.3.

or maybe i should just not bother having my script clean up for a fresh install and abort if it sees /usr{,/local}/bin/gramps.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [August 26, 2020, 11:12pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/10 "2020-08-26T23:12:30Z")

</div>

Just my opinion but… I think that auto uninstall of any version with an incompatible database format is asking for trouble. The uninstall of those earlier versions should be refused with a warning to export/backup to the Gramps XML format (whether compressed or not).

People skipping that many versions need some pushback… particularly important is to make sure they have adequately _ **tested** _ their backups. I’ve seen too many horror stories from IT Pros who discovered (after their 1st disaster) that none of their daily backups were usable.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [September 25, 2020, 11:12pm UTC](https://gramps.discourse.group/t/uninstalling-gramps/643/11 "2020-09-25T23:12:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
