Uninstall Git completely on Ubuntu?

19,820

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:

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.

Share:
19,820

Related videos on Youtube

Autodidact
Author by

Autodidact

Updated on September 17, 2022

Comments

  • Autodidact
    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
      hasen about 14 years
      are the contents of ~/tmp/git-1.7xxxxx still there?
    • Zack
      Zack about 14 years
      You'll want to install packages through apt when possible. Ubuntu Lucid has the latest version of git in Apt as git-core.
    • Autodidact
      Autodidact about 14 years
      @hasen, Yes the files are there in tmp.
    • Autodidact
      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
    Mike Pelley about 14 years
    Ah - that link is much better, and I hadn't seen it before so thanks ;o)
  • Autodidact
    Autodidact about 14 years
    as @mike said, does this work after installing git?
  • Boldewyn
    Boldewyn about 14 years
    As long as you haven't installed 'gitarHero' on your system... ;-) (PS: I know the spelling isn't correct)
  • Zack
    Zack about 14 years
    Don't forget about .gitconfig in ~