{"thread":{"id":"9980","subject":"Uninstalling Git","startedAt":"2007-09-23T18:30:36Z","lastAt":"2007-09-23T19:47:47Z","messageCount":4,"participants":["in-call@gmx.net","David Kastrup","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"53844","messageId":"46F6B0CC.3040000@gmx.net","threadId":"9980","inReplyTo":null,"subject":"Uninstalling Git","fromName":"","fromEmail":"in-call@gmx.net","sentAt":"2007-09-23T18:30:36Z","receivedAt":"2007-09-23T18:30:36Z","isPatch":false,"sender":{"key":"in-call@gmx.net","avatar":null},"body":"Hello!\n\nThis must be a stupid-obvious-newbie question but...\n\nWell, the point is that I installed the git version 1.5.2.1 in an ubuntu \nbox.  That was done following the INSTALL instructions in the \ncorresponding tarball.  I typed:\n\n$ make configure\n$ ./configure --prefix=/usr/local\n$ make all doc\n$ sudo make install install-doc\n\nFirst, I'd like to uninstall the thing completely, how do I do that?\n\nSecond, what would be the correct procedure to follow if I would like \njust to upgrade to a newer version? install over the older perhaps? Is \nthat always safe in the sense that there won't be any dangling piece of \nbin nor doc?\n\nThanks in advance!\n"},{"id":"53846","messageId":"85d4w9mcb6.fsf@lola.goethe.zz","threadId":"9980","inReplyTo":"46F6B0CC.3040000@gmx.net","subject":"Re: Uninstalling Git","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-09-23T19:06:21Z","receivedAt":"2007-09-23T19:06:21Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"in-call@gmx.net writes:\n\n> This must be a stupid-obvious-newbie question but...\n>\n> Well, the point is that I installed the git version 1.5.2.1 in an\n> ubuntu box.  That was done following the INSTALL instructions in the\n> corresponding tarball.  I typed:\n>\n> $ make configure\n> $ ./configure --prefix=/usr/local\n> $ make all doc\n> $ sudo make install install-doc\n>\n> First, I'd like to uninstall the thing completely, how do I do that?\n\nBasically, you are screwed.  That being said, it might somewhat work\nto do the following:\n\nfind /usr/local -depth -iname 'git*' -exec rm -rf {} \\;\n\nBut I think you'll catch more if you apply the following patch, then\ndo\n\n./configure --prefix=/opt/git\nmake all doc\nsudo make install install-doc install-symlinks\nsudo rm -rf /opt/git\nsudo find /usr/local -lname '/opt/git/*' -delete\n\n> Second, what would be the correct procedure to follow if I would\n> like just to upgrade to a newer version? install over the older\n> perhaps? Is that always safe in the sense that there won't be any\n> dangling piece of bin nor doc?\n\nThere is some software called xstow which is supposed to do something\nsimilar to the \"install-symlinks\" target of this patch.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n\nFrom: David Kastrup <dak@gnu.org>\nDate: Wed, 18 Jul 2007 16:45:36 +0200\nSubject: [PATCH] Makefile: create an install-symlinks target\n\n[commit text mostly pinched from INSTALL]\n\nAn alternative global installation method making it much easier to\nuninstall is to use a package-specific prefix like /opt/git, then\ncreate symlinks from /usr/local into that hierarchy.  Uninstalling can\nthen be achieved by\n\n\t# rm -rf /opt/git; find /usr/local -lname '/opt/git/*' -delete\n\nYou can create a setup like that after having used one of the above\ninstall recipes with prefix=/opt/git by writing\n\n\t# make prefix=/opt/git symlinkprefix=/usr/local install-symlinks\n\nThis works by copying the directory hierarchy of $prefix to\n$symlinkprefix (not copying or descending to any directories of the\nname git* matched case-insensitively), then linking all the rest.\n---\n INSTALL  |   12 ++++++++++++\n Makefile |   10 +++++++++-\n 2 files changed, 21 insertions(+), 1 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex 289b046..38d6fdd 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -21,6 +21,18 @@ set up install paths (via config.mak.autogen), so you can write instead\n \t$ make all doc ;# as yourself\n \t# make install install-doc ;# as root\n \n+An alternative global installation method making it much easier to\n+uninstall is to use a package-specific prefix like /opt/git, then\n+create symlinks from /usr/local into that hierarchy.  Uninstalling can\n+then be achieved by\n+\n+\t# rm -rf /opt/git; find /usr/local -lname '/opt/git/*' -delete\n+\n+You can create a setup like that after having used one of the above\n+install recipes with prefix=/opt/git by writing\n+\n+\t# make prefix=/opt/git symlinkprefix=/usr/local install-symlinks\n+\n \n Issues of note:\n \ndiff --git a/Makefile b/Makefile\nindex 0055eef..caea6fb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -147,6 +147,7 @@ ALL_LDFLAGS = $(LDFLAGS)\n STRIP ?= strip\n \n prefix = $(HOME)\n+symlinkprefix = /usr/local\n bindir = $(prefix)/bin\n gitexecdir = $(bindir)\n sharedir = $(prefix)/share\n@@ -727,6 +728,7 @@ bindir_SQ = $(subst ','\\'',$(bindir))\n gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n prefix_SQ = $(subst ','\\'',$(prefix))\n+symlinkprefix_SQ = $(subst ','\\'',$(symlinkprefix))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n@@ -1039,7 +1041,13 @@ install-info:\n quick-install-doc:\n \t$(MAKE) -C Documentation quick-install\n \n-\n+# The somewhat strange looking lines start with an ignored $(MAKE) in\n+# order to be executed also in make -n calls.\n+install-symlinks:\n+\t@: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && $(FIND) . -type d ! \\( -iname 'git*' -prune \\) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \\;\n+\t@cd '$(prefix_SQ)' && $(FIND) . -type d ! \\( -iname 'git*' -prune \\) -exec $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \\;\n+\t@: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && $(FIND) . \\( -type d -iname 'git*' -prune -o ! -type d \\) -exec echo $(RM) -r '$(symlinkprefix_SQ)/{}' \\; -exec echo ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \\;\n+\t@cd '$(prefix_SQ)' && $(FIND) . \\( -type d -iname 'git*' -prune -o ! -type d \\) -exec $(RM) -r '$(symlinkprefix_SQ)/{}' \\; -exec ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \\;\n \n ### Maintainer's dist rules\n \n-- \n1.5.3.1.96.g4568\n"},{"id":"53850","messageId":"Pine.LNX.4.64.0709232029490.28395@racer.site","threadId":"9980","inReplyTo":"46F6B0CC.3040000@gmx.net","subject":"Re: Uninstalling Git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-09-23T19:31:06Z","receivedAt":"2007-09-23T19:31:06Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 23 Sep 2007, in-call@gmx.net wrote:\n\n> $ make configure\n> $ ./configure --prefix=/usr/local\n> $ make all doc\n> $ sudo make install install-doc\n> \n> First, I'd like to uninstall the thing completely, how do I do that?\n\nI'd use checkinstall to install it (again), and then use the distro's \nregular tools; in case of Ubuntu, that would be dpkg I believe.\n\n> Second, what would be the correct procedure to follow if I would like \n> just to upgrade to a newer version? install over the older perhaps? Is \n> that always safe in the sense that there won't be any dangling piece of \n> bin nor doc?\n\nOn Linux this should be safe at all times.\n\nHth,\nDscho\n"},{"id":"53853","messageId":"46F6C2E3.8020405@gmx.net","threadId":"9980","inReplyTo":"Pine.LNX.4.64.0709232029490.28395@racer.site","subject":"Re: Uninstalling Git","fromName":"","fromEmail":"in-call@gmx.net","sentAt":"2007-09-23T19:47:47Z","receivedAt":"2007-09-23T19:47:47Z","isPatch":false,"sender":{"key":"in-call@gmx.net","avatar":null},"body":"Hello!\n\nOh! great solution! I didn't know this tool, I'll do that! Thanks a lot!\n\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Sun, 23 Sep 2007, in-call@gmx.net wrote:\n> \n>> $ make configure\n>> $ ./configure --prefix=/usr/local\n>> $ make all doc\n>> $ sudo make install install-doc\n>>\n>> First, I'd like to uninstall the thing completely, how do I do that?\n> \n> I'd use checkinstall to install it (again), and then use the distro's \n> regular tools; in case of Ubuntu, that would be dpkg I believe.\n> \n>> Second, what would be the correct procedure to follow if I would like \n>> just to upgrade to a newer version? install over the older perhaps? Is \n>> that always safe in the sense that there won't be any dangling piece of \n>> bin nor doc?\n> \n> On Linux this should be safe at all times.\n> \n> Hth,\n> Dscho\n> \n"}]}