Ubuntu 64-bit "Failed to fetch file [..] binary-i386/Packages" error while updating apt repos
I have the following issue on Ubuntu 12.04 LTS on a 64-bit machine: Whenever I try to update the aptitude repos, the update will strangely fail with a i386-related error. I assume that this shouldn't be happening on a 64-bit system.
root@liv-HP-Compaq-dc7900:/home/liv# apt-get update
Ign file: apt-build Release.gpg
Get:1 file: apt-build Release [107 B]
Ign file: apt-build/main TranslationIndex
Err file: apt-build/main i386 Packages File not found
[..]
W: Failed to fetch file:/var/cache/apt-build/repository/dists/apt-build/main/binary-i386/Packages File not found
E: Some index files failed to download. They have been ignored, or old ones used instead.I tried to restore status-old with no luck:
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
I also tried:
root@liv-HP-Compaq-dc7900:/home/liv# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 90 not upgraded.But it doesn't seem to do or report anything useful. Each subsequent apt-get update ends up in an error.
For the record, my /etc/apt/sources.list file looks like this:
# deb cdrom:[Xubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/main/binary-i386/
# deb cdrom:[Xubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/multiverse/binary-i386/
# deb cdrom:[Xubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Xubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/universe/binary-i386/
# deb cdrom:[Xubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ precise main multiverse restricted universe
# See for how to upgrade to
# newer versions of the distribution.
deb precise main restricted
deb-src precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb precise-updates main restricted
deb-src precise-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb precise universe
deb-src precise universe
deb precise-updates universe
deb-src precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb precise multiverse
deb-src precise multiverse
deb precise-updates multiverse
deb-src precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb precise-backports main restricted universe multiverse
deb-src precise-backports main restricted universe multiverse
deb precise-security main restricted
deb-src precise-security main restricted
deb precise-security universe
deb-src precise-security universe
deb precise-security multiverse
deb-src precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb precise partner
# deb-src precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb precise main
deb-src precise main
deb precise/
# deb-src precise/
# deb precise partner
# deb-src precise partnerAnd the kernel in use is:
liv@liv-HP-Compaq-dc7900:~$ uname -a
Linux liv-HP-Compaq-dc7900 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/LinuxWhat is wrong and how can I fix it?
54 Answers
I had the same issue using my own apt-mirror server to update the git-core package.
In my case, I resolved the issue by adding [arch=amd64] in the original entry in the /etc/apt/sources.list.
Example:
Original: deb precise main
Solution: deb [arch=amd64] precise main
The details can be found at:
In your case, you need to edit /etc/apt/sources.list.d/apt-build.list.
As suggested by the accepted answer, I had to edit the contents of:
/etc/apt/sources.list.d/apt-build.listFrom:
deb file:/var/cache/apt-build/repository apt-build mainto:
deb [arch=amd64] file:/var/cache/apt-build/repository apt-build mainNote that the error came solely from apt-build.list. No changes to /etc/apt/sources.list were needed to fix the problem.
I had to make one more slight correction, i.e.:
deb [arch=amd64 trusted=yes] file:/var/cache/apt-build/repository apt-build mainbefore apt stopped complaining - I've never dealt with the sources.list's [options] before, so it took me a few minutes of googling and trial/errorring to get it right...
Basically, if you want to keep a mess with your OS and different architecture repositories, then you can add [arch=amd64] as a one-off fix (you will need to do it for each repository, which is annoying)
Especially, whenever you need to do it at the company level, it is easier to do like this:
sudo dpkg --remove-architecture i386