sudo apt-get update error

Asked by Sudarshan Mukherjee

sudarshansky@ubuntu:~$ sudo apt-get update
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.91.14 80]
Err http://archive.ubuntu.com precise-updates Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com precise-backports Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com precise-security Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 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.91.14 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.91.14 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.91.14 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.91.14 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.
sudarshansky@ubuntu:~$

sudarshansky@ubuntu:~$ ubuntu-support-status
Support status summary of 'ubuntu':

You have 968 packages (70.6%) supported until April 2017 (5y)

You have 404 packages (29.4%) that can not/no-longer be downloaded
You have 0 packages (0.0%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details
sudarshansky@ubuntu:~$ cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
sudarshansky@ubuntu:~$ cat/etc/dpkg/dpkg.cfg.d/multiarch
bash: cat/etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
sudarshansky@ubuntu:~$ dpkg --print-foreign-architectures

sudarshansky@ubuntu:~$ dpkg --print-foreign-architectures

sudarshansky@ubuntu:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for sudarshansky:
sudarshansky@ubuntu:~$ grep proxy /etc/environment
sudarshansky@ubuntu:~$ echo $http_proxy

sudarshansky@ubuntu:~$ echo $ftp_proxy

sudarshansky@ubuntu:~$ grep proxy /etc/bash.bashrc
sudarshansky@ubuntu:~$ grep proxy ~/.bashrc
sudarshansky@ubuntu:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
sudarshansky@ubuntu:~$ sudo fuser -vvv /var/lib/dpkg/lock
sudarshansky@ubuntu:~$ sudo fuser -vvv /var/cache/apt/archives/lock
sudarshansky@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
sudarshansky@ubuntu:~$ uname -a
Linux ubuntu 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux
sudarshansky@ubuntu:~$ sudo rm /var/lib/apt/lists/lock
sudarshansky@ubuntu:~$ sudo rm /var/cache/apt/archives/lock
sudarshansky@ubuntu:~$ sudo rm /var/lib/dpkg/lock
sudarshansky@ubuntu:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup

sudarshansky@ubuntu:~$
sudarshansky@ubuntu:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudarshansky@ubuntu:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudarshansky@ubuntu:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudarshansky@ubuntu:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudarshansky@ubuntu:~$ sudo rm -rf /var/lib/dpkg/updates/*
sudarshansky@ubuntu:~$ sudo rm -rf /var/lib/apt/lists
sudarshansky@ubuntu:~$ sudo rm /var/cache/apt/*.bin
sudarshansky@ubuntu:~$ sudo mkdir /var/lib/apt/lists
sudarshansky@ubuntu:~$ sudo mkdir /var/lib/apt/lists/partial
sudarshansky@ubuntu:~$ LANG=C;sudo apt-get clean
sudarshansky@ubuntu:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
sudarshansky@ubuntu:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudarshansky@ubuntu:~$ LANG=C;sudo apt-get --fix-missing 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.91.14 80]
Err http://archive.ubuntu.com precise-updates Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com precise-backports Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com precise-security Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.14 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.91.14 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.91.14 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.91.14 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.91.14 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.
sudarshansky@ubuntu:~$ sudo dpkg --configure -a
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-29-generic-pae
Warning: No support for locale: en_US.utf8
Processing triggers for desktop-file-utils ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for software-center ...
INFO:softwarecenter.db.update:no translation information in database needed
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for gnome-menus ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
sudarshansky@ubuntu:~$ sudo dpkg --clear-avail
sudarshansky@ubuntu:~$ 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.
sudarshansky@ubuntu:~$ 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.
sudarshansky@ubuntu:~$ 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.91.13 80]
Err http://archive.ubuntu.com precise-updates Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.13 80]
Err http://archive.ubuntu.com precise-backports Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.13 80]
Err http://archive.ubuntu.com precise-security Release.gpg
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.91.13 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.91.13 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.91.13 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.91.13 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.91.13 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.
sudarshansky@ubuntu:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

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

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
Manfred Hampl (m-hampl) said :
#1

There seems to be a problem with your network connection.

Please provide the output of the following terminal commands:

ping -c 3 8.8.8.8
ping -c 3 archive.ubuntu.com
ping -c 3 91.189.91.13

Revision history for this message
Jeff (jbg144) said :
#2
Revision history for this message
Jeff (jbg144) said :
#3

I am encountering the same error when attempting apt-get update on precise (12.04 LTS)

Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]

 W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/partner/source/Sources 404 Not Found [IP: 91.189.92.150 80]

Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/partner/binary-i386/Packages 404 Not Found [IP: 91.189.92.150 80]

I am able to successfully "ping" to security.ubuntu.com, archive.canonical.com, as well as addresses 91.189.91.14 and 91.189.92.150 so it appears that my internet connectivity is OK.

Any suggestions would be welcome.

Thanks,

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

The error message now is different, no more "Unable to connect to archive.ubuntu.com" but 404 file not found. So apparently the network connection now is available.

Now the question is why you are seeing 404 messages in the output. In fact these files do not exist, but that is something that the package management system should be able to cope with (it is trying Packages, Packages.gz, Packages.bz2 and accepts the file either uncompressed or in a number of compressed formats and should not fail if at least one of these files is present).

If you try accessing http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/binary-i386/Packages with your web browser, what do you see on screen, and what do you see for http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/binary-i386/Packages.gz

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Oops, I just see that there are two different persons:

@Jeff: Please do not piggyback on someone else's question, but create your own question document. Your error messages are different, so most probably there is a different root cause. Your input is irrelevant for Sudarshan Mukherjee's problem, and as you see the supporters might be mislead with such meddling.

@Sudarshan Mukherjee: please ignore my second comment, but provide the output of the commands as asked for.

Can you help with this problem?

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

To post a message you must log in.