Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm following these instructions to install git on my laptop.
When I do:

$ sudo apt-get install git-core

This is what my terinal shows:

Reading package lists... Done
Building dependency tree        
Reading state information... Done
The following packages were automatically installed and are no longer required:   
  libasprintf0c2:i386
  libcroco3:i386
  libgettextpo0:i386
  libgomp1:i386
  libunistring0:i386
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  git git-man liberror-perl
Suggested packages:
  git-daemon-run
  git-daemon-sysvinit
  git-doc git-el
  git-arch git-cvs
  git-svn
  git-email
  git-gui
  gitk gitweb
The following NEW packages will be installed:
  git git-core git-man liberror-perl

 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
 Need to get 6,825 kB of archives. After this operation, 15.3 MB of additional disk space will be used. Do you want to continue [Y/n]? y
 WARNING: The following packages cannot be authenticated!
   liberror-perl git-man git git-core
Install these packages without verification [y/N]?

  E: Some packages could not be authenticated
lucas@lucas-Inspiron-N5050:~$ sudo apt-get install git-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasprintf0c2:i386
  libcroco3:i386
  libgettextpo0:i386
  libgomp1:i386
  libunistring0:i386
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  git git-man liberror-perl
Suggested packages:
  git-daemon-run git-daemon-sysvinit
  git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb
The following NEW packages will be installed:
  git git-core
  git-man liberror-perl
 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
 Need to get 6,825 kB of archives. After this operation, 15.3 MB of additional disk space will be used. Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  liberror-perl git-man git git-core
Install these packages without verification [y/N]? y
Err httpq://py.archive.ubuntu.com/ubuntu/quantal/main liberror-perl all 0.17-1
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git-man all 1:1.7.10.4-1ubuntu1
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git amd64 1:1.7.10.4-1ubuntu1
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git-core all 1:1.7.10.4-1ubuntu1
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
 Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberrorperl_0.17-1_all.deb
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
 Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/g/gi/git-man_1.7.10.4-1ubuntu1_all.deb
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
 Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.10.4-1ubuntu1_amd64.deb
   Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
 Failed to fetch http://py.archive.ubuntu.com/ubuntu/pool/main/g/git/git-core_1.7.10.4-1ubuntu1_all.deb
  Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

How could I install git on Ubuntu 12.10? I can't even do it from the Ubuntu Software Center.

Thanks in advance!

share|improve this question
1  
did you try sudo apt-get update --fix-missing like it suggested?! –  Dr_Bunsen Oct 28 '12 at 21:22
    
yes @Dr_Bunsen, but it says: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ –  Lucas Windir Oct 28 '12 at 21:24
    
did you have anything else open, something that was installing software?! since you cant install with software-center and terminal at the same time. So make shure everything that could use it(synaptic, software center or terminals) are closed and try it again. and you could always do this: askubuntu.com/questions/102054/… –  Dr_Bunsen Oct 28 '12 at 21:38
    
thanks @Dr_Bunsen, I already did sudo rm /var/lib/apt/lists/lock 5 minutes ago, but it seems the console is stuck with this message: 100% [Connecting to py.archive.ubuntu.com] –  Lucas Windir Oct 28 '12 at 21:41
    
well, pinging that url doesnt work, and google suggested ph.archive.ubuntu.com, and that will respond. but cant it stucks at that particular thing after you closed the terminal and remove the lock, and then install/update --fix? –  Dr_Bunsen Oct 28 '12 at 21:44

3 Answers 3

up vote 6 down vote accepted

Close all programs/windows which have to do with installing software e.g. Synaptic, software-centre and terminals.

Now you should delete the locked files:

You can delete the lock file with

sudo rm /var/lib/apt/lists/lock

you may also need to delete the lock file in the cache directory

sudo rm /var/cache/apt/archives/lock 

by: this answer

and now you should open a terminal and run:

 sudo apt-get update --fix-missing

and now you can install everything you want again.
Have a nice day

share|improve this answer
1  
thanks! it worked like a charm! –  Lucas Windir Oct 28 '12 at 22:00
    
no problem, that's what we are here for. –  Dr_Bunsen Oct 28 '12 at 22:01
    
"...this problem is ... a short-lived problem with (or accessing) your DNS server. (The problem is not actually with the server at httpq://py.archive.ubuntu.com/ itself, though it may have been due to a configuration problem for that server's DNS record.)" Quotation from this answer. –  Gediminas Jeremiah Gudelis Jul 26 '13 at 18:02
    
I only helped him removing the lock. I guess the question has chanced, and this was last year, so I don't remember the details. And it worked back then, so I guess shit is alright. –  Dr_Bunsen Jul 26 '13 at 18:57

Do you have a static IP which you set in /etc/networks/interfaces? I had a similar problem after I upgraded to Ubuntu 12.04. The problem was that the DNS server was no longer set in /etc/resolv.conf and regardless what you put there it was overwritten at reboot. The solution is to add in /etc/networks/interfaces this:

dns-nameservers `<IP address of the DNS server>`
dns-domain `<the name of the domain>`

As a quick fix is to add the nameserver in resolv.conf, but it will disappear after you reboot.

share|improve this answer
    
I didn't set that static IP you mention @dinel! sorry, I'm new so I can't mark your answer as useful yet because I need 15 reputation –  Lucas Windir Oct 29 '12 at 0:06

In /etc/network/interfaces added the following :

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.205
netmask 255.255.255.0
gateway 192.168.1.1

As I was debugging, in /etc/resolv.conf the nameserver was not there. So I added the following lines:

nameserver 8.8.8.8
nameserver 192.168.1.1

Then did sudo apt-get update. It just worked.

share|improve this answer
    
"...this problem is ... a short-lived problem with (or accessing) your DNS server. (The problem is not actually with the server at httpq://py.archive.ubuntu.com/ itself, though it may have been due to a configuration problem for that server's DNS record.)" Quotation from this answer. –  Gediminas Jeremiah Gudelis Jul 26 '13 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.