git installation error missing installation candidate

前端 未结 5 1903
遇见更好的自我
遇见更好的自我 2021-01-18 18:19

I tried installing git on Ubuntu 12.10 using the command sudo apt-get install git. But I am getting error message like this:

Readin         


        
相关标签:
5条回答
  • 2021-01-18 18:49

    First run this command to update

    sudo apt update 
    

    Then run this

    sudo apt-get install git
    
    0 讨论(0)
  • 2021-01-18 18:51

    I had this problem as well. In Software and Updates, Canonical-supported free and open-source software (main) was unchecked and under the Installable from CD-ROM/DVD section, the box was checked causing apt to look for the package on a non-existent optical drive.

    0 讨论(0)
  • I found a nice tutorial about git on ubuntu 12 here.

    It mainly mentioned the dependencies prior to install:

    sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
    

    and to use this for the git installation: sudo apt-get install git-core sudo apt-get update

    and further more it says: Once they are installed, you can download the latest version of Git from the google code page.

    wget https://git-core.googlecode.com/files/git-1.8.1.2.tar.gz
    

    After it downloads, untar the file and switch into that directory:

    tar -zxf git-1.8.1.2.tar.gz
    

    cd git-1.8.1.2

    If you want to do a global install, install it once as yourself and once as root, using the sudo prefix:

    make prefix=/usr/local all
    sudo make prefix=/usr/local install
    

    If you need to update Git in the future, you can use Git itself to do it.

    git clone git://git.kernel.org/pub/scm/git/git.git
    

    Go and check the tutorial and leave her a comment ;-)

    0 讨论(0)
  • 2021-01-18 19:04

    Try running below commands.

    sudo rm -vf /var/lib/apt/lists/*
    sudo apt-get update
    
    0 讨论(0)
  • 2021-01-18 19:04

    The git package should be installable. In principle if something like this occurs, you should verify the following.

    • Make sure that the contents of your /etc/apt/sources.list file is sane. It should contain something like this:

      deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
      deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
      deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
      
    • Make sure you have run apt-get update before trying to install git.

    Note that the above sources.list is for precise (12.04). 12.10 is called quantal. But note that 12.10 is not supported any more (EOL was May 2014 - see here). So the solution to your problem might be that the package sources for 12.10 don't exist any more on the server, so the message is in fact correct: on the server there simply is no candidate any more...

    The solution would then be to upgrade to at least the next LTS version (14.04).

    0 讨论(0)
提交回复
热议问题