Uninstall Git completely on Ubuntu?
Solution 1
I solved this with the following step:
sudo find /usr/local -depth -iname 'git*' -exec rm -rf {} \;
That deleted all the git related files. Then used the apt-get to install git-core.
The reason behind this trouble is:
- I installed git-1.7.xxx via source. But libcurl was not installed before, so that it couldn't clone the git/github repo via
http://
protocol http://github.com/blog/642-smart-http-support
Solution 2
Use installwatch (aka checkinstall) to see what it actually installed, then delete the files. Note, this requires running make install
again, just under installwatch.
Check, first to make sure an uninstall
target does not exist (e.g try make uninstall
). make help
might also be of use.
Unless you really need a feature in a newer version of something that your distro packages (or unless they simply don't package it), its generally a good idea to install stuff using the package manager, for just this reason.
Related videos on Youtube
Autodidact
Updated on September 17, 2022Comments
-
Autodidact over 1 year
I installed Git on Ubuntu Lucid (latest) manually as following.
cd ~/tmp wget http://kernel.org/pub/software/scm/git/git-1.7.0.6.tar.gz tar -xzvf git-1.7.0.6.tar.gz cd git-1.7.0.6.tar.gz ./configure sudo make sudo make install
Now, how can I completely uninstall it?
-
hasen about 14 yearsare the contents of
~/tmp/git-1.7xxxxx
still there? -
Zack about 14 yearsYou'll want to install packages through apt when possible. Ubuntu Lucid has the latest version of git in Apt as
git-core
. -
Autodidact about 14 years@hasen, Yes the files are there in tmp.
-
Autodidact about 14 years@Zack, initially I couldn't find the git-core in package manager. Then I installed it via source. Later when I changed the source to US server, then I see the git-core package. But I've already installed it via source, hence the problem.
-
-
Mike Pelley about 14 yearsAh - that link is much better, and I hadn't seen it before so thanks ;o)
-
Autodidact about 14 yearsas @mike said, does this work after installing git?
-
Boldewyn about 14 yearsAs long as you haven't installed 'gitarHero' on your system... ;-) (PS: I know the spelling isn't correct)
-
Zack about 14 yearsDon't forget about
.gitconfig
in~