apt-get update failure 12.04

Asked by frank

I have been unable to update the server software for about 14 days and always get the same messages.

Following the instructions at https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure I get the following output:

Please note the follwoing was done via a ssh link to a remote server I do not think this had any affect but just to be clear.

fsmith@StruttsTwo:~$ sudo update-manager
gpg: /tmp/tmpsq4LWL/trustdb.gpg: trustdb created
fsmith@StruttsTwo:~$ sudo grep -R proxy /etc/apt/*
fsmith@StruttsTwo:~$ sudo fuser -vvv /var/lib/dpkg/lock
fsmith@StruttsTwo:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
fsmith@StruttsTwo:~$ uname -a
Linux StruttsTwo 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux
fsmith@StruttsTwo:~$ sudo rm /var/lib/apt/lists/lock
fsmith@StruttsTwo:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
fsmith@StruttsTwo:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
fsmith@StruttsTwo:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
fsmith@StruttsTwo:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-badfsmith@StruttsTwo:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/availablefsmith@StruttsTwo:~$ sudo rm -rf /var/lib/dpkg/updates/*
fsmith@StruttsTwo:~$ sudo rm -rf /var/lib/apt/lists
fsmith@StruttsTwo:~$ sudo rm /var/cache/apt/*.bin
fsmith@StruttsTwo:~$ sudo mkdir /var/lib/apt/lists
fsmith@StruttsTwo:~$ sudo mkdir /var/lib/apt/lists/partial
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get clean
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-3.2.0-31* linux-headers-3.2.0-31-generic-pae*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 67.5 MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 178367 files and directories currently installed.)
Removing linux-headers-3.2.0-31-generic-pae ...
Removing linux-headers-3.2.0-31 ...
Setting up linux-image-3.2.0-32-generic-pae (3.2.0-32.51) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-32-generic-pae /boot/vmlinuz-3.2.0-32-generic-pae
update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic-pae
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-32-generic-pae /boot/vmlinuz-3.2.0-32-generic-pae
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-32-generic-pae /boot/vmlinuz-3.2.0-32-generic-pae
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-32-generic-pae /boot/vmlinuz-3.2.0-32-generic-pae
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-32-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-32-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-31-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-31-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-29-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-29-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda2
done
Setting up linux-image-generic-pae (3.2.0.32.35) ...
Setting up linux-generic-pae (3.2.0.32.35) ...
Setting up linux-headers-3.2.0-32 (3.2.0-32.51) ...
Setting up linux-headers-3.2.0-32-generic-pae (3.2.0-32.51) ...
Setting up linux-headers-generic-pae (3.2.0.32.35) ...
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000
Err http://archive.ubuntu.com precise InRelease

Err http://archive.ubuntu.com precise-updates InRelease

Err http://archive.ubuntu.com precise-backports InRelease

Err http://archive.ubuntu.com precise-security InRelease

Err http://archive.ubuntu.com precise Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
Err http://archive.ubuntu.com precise-updates Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
Err http://archive.ubuntu.com precise-backports Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
Err http://archive.ubuntu.com precise-security Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-security/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.
fsmith@StruttsTwo:~$ sudo dpkg --configure -a
fsmith@StruttsTwo:~$ sudo dpkg --clear-avail
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
fsmith@StruttsTwo:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Err http://archive.ubuntu.com precise InRelease

Err http://archive.ubuntu.com precise-updates InRelease

Err http://archive.ubuntu.com precise-backports InRelease

Err http://archive.ubuntu.com precise-security InRelease

Err http://archive.ubuntu.com precise Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com precise-updates Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com precise-backports Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com precise-security Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-security/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.200 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
fsmith@StruttsTwo:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 #
     2
     3 # deb cdrom:[Ubuntu-Server 12.04.1 LTS _Precise Pangolin_ - Release i386 (20120817.3)]/ precise main restricted
     4
     5 # deb cdrom:[Ubuntu-Server 12.04.1 LTS _Precise Pangolin_ - Release i386 (20120817.3)]/ precise main restricted
     6
     7 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     8 # newer versions of the distribution.
     9 deb http://archive.ubuntu.com/ubuntu precise main restricted
    10 deb-src http://archive.ubuntu.com/ubuntu precise main restricted
    11
    12 ## Major bug fix updates produced after the final release of the
    13 ## distribution.
    14 deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
    15 deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted
    16
    17 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    18 ## team. Also, please note that software in universe WILL NOT receive any
    19 ## review or updates from the Ubuntu security team.
    20 deb http://archive.ubuntu.com/ubuntu precise universe
    21 deb-src http://archive.ubuntu.com/ubuntu precise universe
    22 deb http://archive.ubuntu.com/ubuntu precise-updates universe
    23 deb-src http://archive.ubuntu.com/ubuntu precise-updates universe
    24
    25 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    26 ## team, and may not be under a free licence. Please satisfy yourself as to
    27 ## your rights to use the software. Also, please note that software in
    28 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    29 ## security team.
    30 deb http://archive.ubuntu.com/ubuntu precise multiverse
    31 deb-src http://archive.ubuntu.com/ubuntu precise multiverse
    32 deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
    33 deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse
    34
    35 ## N.B. software from this repository may not have been tested as
    36 ## extensively as that contained in the main release, although it includes
    37 ## newer versions of some applications which may provide useful features.
    38 ## Also, please note that software in backports WILL NOT receive any review
    39 ## or updates from the Ubuntu security team.
    40 deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
    41 deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
    42
    43 deb http://archive.ubuntu.com/ubuntu precise-security main restricted
    44 deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted
    45 deb http://archive.ubuntu.com/ubuntu precise-security universe
    46 deb-src http://archive.ubuntu.com/ubuntu precise-security universe
    47 deb http://archive.ubuntu.com/ubuntu precise-security multiverse
    48 deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse
    49
    50 ## Uncomment the following two lines to add software from Canonical's
    51 ## 'partner' repository.
    52 ## This software is not part of Ubuntu, but is offered by Canonical and the
    53 ## respective vendors as a service to Ubuntu users.
    54 # deb http://archive.canonical.com/ubuntu precise partner
    55 # deb-src http://archive.canonical.com/ubuntu precise partner
    56
    57 ## Uncomment the following two lines to add software from Ubuntu's
    58 ## 'extras' repository.
    59 ## This software is not part of Ubuntu, but is offered by third-party
    60 ## developers who want to ship their latest software.
    61 # deb http://extras.ubuntu.com/ubuntu precise main
    62 # deb-src http://extras.ubuntu.com/ubuntu precise main

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#1

This seems like a problem with the server
OR
maybe you are under a proxy connection that not work correctly.

Try to change the server "Download From" and try again
you can do that from Ubuntu Software Center > Edit > Software Sources > Ubuntu updates > and change the Download From : to another server and try again.

OR else (if you are under a proxy server)

you can try this command

~$ echo 'Acquire::http::Proxy "http://17X.XX.XX.X:8080";' | sudo tee /etc/apt/apt.conf

replace the XXX with your proxy's IP.

Thanks

Revision history for this message
frank (fhsmith) said :
#2

NikTh

Thanks for the suggestions but I'm sorry I don't think the problem is solved as:

1. If it is a problem with the software update server it is widespread as I have tried both the UK and the main Ubuntu servers.

2. The downloading machine is behind a NAT firewall and no Proxy is involved.

Having said that, I agree with your basic deductions in that the files are not being found on the server and I agree I have seen similar problems before for short periods which then resolve themselves when the source server is updated. However, in this case it has been continually happening for fourteen days now which is not usual.

Sorry

Frank

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you run:

ping -c 4 archive.ubuntu.com/ubuntu

Do you get replies?

Revision history for this message
frank (fhsmith) said :
#4

Hi

Ping does not resolve the server it does however resolve the bbc.co.uk and others so I'm, a bit lost at that point unless the server has disappeared from DNS.

Frank

Revision history for this message
frank (fhsmith) said :
#5

Sorry a bit more information the base server is resolved with ping -c 4 archive.ubuntu.com

Frank

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Try:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.con > /dev/null
sudo apt-get update

Is it now smooth?

Revision history for this message
frank (fhsmith) said :
#7

Still not resolving the server and the Google DNS address is clearly now in /etc/resolv.conf!

I don't understand?

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#8

Try this and tell me if working

~$ echo 'Acquire::http::Proxy "false";' | sudo tee /etc/apt/apt.conf

copy-paste the command from here to the terminal for more accuracy.

Reboot your PC.

Thanks

Can you help with this problem?

Provide an answer of your own, or ask frank for more information if necessary.

To post a message you must log in.