Failed to fetch ubuntu xenial packages from sfo1.mirrors.digitalocean.com using apt-get update

December 5, 2018 2.2k views
Linux Commands Ubuntu 16.04

Seems like some packages are not present in http://sfo1.mirrors.digitalocean.com/ubuntu/dists. Here is the output when I run sudo apt-get update:

Ign:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Hit:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release
Hit:3 http://linux-packages.resilio.com/resilio-sync/deb resilio-sync InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:5 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease
Hit:8 https://deb.nodesource.com/node_7.x xenial InRelease
Hit:9 https://dl.yarnpkg.com/debian stable InRelease
Hit:10 https://repos.sonar.digitalocean.com/apt main InRelease
Get:6 http://sfo1.mirrors.digitalocean.com/ubuntu xenial InRelease [247 kB]
Get:11 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates InRelease [109 kB]
Get:12 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports InRelease [107 kB]
Hit:13 http://ppa.launchpad.net/fish-shell/release-2/ubuntu xenial InRelease
Hit:14 http://ppa.launchpad.net/longsleep/golang-backports/ubuntu xenial InRelease
Get:15 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main Sources [868 kB]
Get:16 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted Sources [4,808 B]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/main Sources [138 kB]
Get:18 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2,116 B]
Hit:20 http://ppa.launchpad.net/max-c-lv/shadowsocks-libev/ubuntu xenial InRelease
Get:21 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [88.3 kB]
Get:22 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [2,468 B]
Get:24 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [587 kB]
Hit:26 http://ppa.launchpad.net/wireguard/wireguard/ubuntu xenial InRelease
Ign:27 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Get:29 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [245 kB]
Get:30 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,204 B]
Get:19 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe Sources [7,728 kB]
Ign:32 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Get:23 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse Sources [179 kB]
Get:33 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,152 B]
Get:25 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Ign:28 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main armhf Packages
Get:35 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [402 kB]
Get:31 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main Translation-en [568 kB]
Get:34 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted amd64 Packages [8,344 B]
Ign:36 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted armhf Packages
Ign:37 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Get:38 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted Translation-en [2,908 B]
Get:40 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [157 kB]
Get:41 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3,724 B]
Ign:42 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Get:43 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,844 B]
Ign:27 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:32 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Get:39 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Ign:44 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe armhf Packages
Ign:37 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:42 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Ign:27 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Get:45 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe Translation-en [4,354 kB]
Get:46 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Ign:47 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse armhf Packages
Ign:32 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Ign:37 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Get:48 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse Translation-en [106 kB]
Ign:42 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Err:27 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
404 Not Found [IP: 91.189.91.26 80]
Get:49 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main Sources [327 kB]
Ign:32 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Get:50 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted Sources [2,528 B]
Ign:37 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:42 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Get:51 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe Sources [235 kB]
Get:52 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse Sources [8,740 B]
Get:53 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages [890 kB]
Ign:54 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main armhf Packages
Get:55 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main Translation-en [361 kB]
Get:56 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted amd64 Packages [7,556 B]
Ign:57 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted armhf Packages
Get:58 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted Translation-en [2,272 B]
Get:59 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 Packages [710 kB]
Ign:60 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe armhf Packages
Get:61 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe Translation-en [290 kB]
Get:62 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse amd64 Packages [16.6 kB]
Ign:63 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse armhf Packages
Get:64 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse Translation-en [8,440 B]
Get:65 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main Sources [4,856 B]
Get:66 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe Sources [6,740 B]
Get:67 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main amd64 Packages [7,288 B]
Ign:68 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main armhf Packages
Get:69 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main Translation-en [4,456 B]
Get:70 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe amd64 Packages [7,804 B]
Ign:71 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe armhf Packages
Get:72 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe Translation-en [4,184 B]
Ign:28 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main armhf Packages
Ign:36 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted armhf Packages
Ign:44 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe armhf Packages
Ign:47 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse armhf Packages
Ign:54 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main armhf Packages
Ign:57 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted armhf Packages
Ign:60 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe armhf Packages
Ign:63 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:68 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main armhf Packages
Ign:71 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe armhf Packages
Ign:28 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main armhf Packages
Ign:36 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/restricted armhf Packages
Ign:44 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe armhf Packages
Ign:47 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/multiverse armhf Packages
Ign:54 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main armhf Packages
Ign:57 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/restricted armhf Packages
Ign:60 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/universe armhf Packages
Ign:63 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:68 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main armhf Packages
Ign:71 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/universe armhf Packages
Err:28 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main armhf Packages
404 Not Found [IP: 198.199.99.226 80]
Err:54 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main armhf Packages
404 Not Found [IP: 198.199.99.226 80]
Err:68 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-backports/main armhf Packages
404 Not Found [IP: 198.199.99.226 80]
Fetched 570 kB in 10s (53.8 kB/s)
Reading package lists… Done
N: Skipping acquire of configured file ‘multiverse/binary-armhf/Packages’ as repository ’http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease’ doesn’t support architecture 'armhf’
N: Skipping acquire of configured file 'main/binary-armhf/Packages’ as repository ’https://repos.sonar.digitalocean.com/apt main InRelease’ doesn’t support architecture 'armhf’
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial/main/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial/restricted/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial/universe/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial/multiverse/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-updates/main/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-updates/restricted/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-updates/universe/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-updates/multiverse/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-armhf/Packages 404 Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-backports/universe/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

1 comment
2 Answers

So I finally figured it out. I have installed resilio-sync which add armhf as foreign architecture (your architecture maybe i386 or amd64). Launch this command to verify:

dpkg --print-foreign-architectures

The output includes armhf, so I simply remove it by running the command:

sudo dpkg --remove-architecture armhf

But I met this error:

dpkg: error: cannot remove architecture 'armhf' currently in use by the database

To fix this issue, run:

dpkg --get-selections | awk '/armhf/{print $1}'

And then if happy with them being removed, run:

apt-get remove --purge `dpkg --get-selections | awk '/armhf/{print $1}'`

And then retry:

dpkg --remove-architecture armhf

Finally, launch sudo apt-get update again.

Reference:

Hey friend,

Try this and see if it helps:

rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update

Jarland

  • Thank you for your suggestion. However, I’m seeing the same error following the steps.

    • Oops, my bad. I totally missed the actual issue. It seems that apt is looking for packages for armhf. Is there any chance that your sources.list may have been altered to reference this instead of amd64?

      Probably back up before doing what I’m going to suggest, with a quick copy:

      cp -R /etc/apt /etc/apt.bak
      

      Because then I’m going to suggest this:

      for i in $(find /etc/apt -type f); do sed -i 's/armhf/amd64/g' $i; done
      

      For good measure, top it off with those commands from before:

      rm -rf /var/lib/apt/lists/*
      apt-get clean
      apt-get update
      

      Fingers crossed :)

      • Thanks. It does not help either. Looks like my sources.list is not looking for armhf:

        ## Note, this file is written by cloud-init on first boot of an instance
        ## modifications made here will not survive a re-bundle.
        ## if you wish to make changes you can:
        ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
        ##     or do the same in user-data
        ## b.) add sources in /etc/apt/sources.list.d
        ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
        
        # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
        # newer versions of the distribution.
        deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
        deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
        
        ## Major bug fix updates produced after the final release of the
        ## distribution.
        deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
        deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
        
        ## 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 http://mirrors.digitalocean.com/ubuntu/ xenial multiverse
        deb-src http://mirrors.digitalocean.com/ubuntu/ xenial multiverse
        deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates multiverse
        deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-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 http://mirrors.digitalocean.com/ubuntu/ xenial-backports main restricted universe multiverse
        deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-backports main restricted universe multiverse
        
        deb http://security.ubuntu.com/ubuntu xenial-security main restricted
        deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
        deb http://security.ubuntu.com/ubuntu xenial-security universe
        deb-src http://security.ubuntu.com/ubuntu xenial-security universe
        deb http://security.ubuntu.com/ubuntu xenial-security multiverse
        deb-src http://security.ubuntu.com/ubuntu xenial-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 http://archive.canonical.com/ubuntu xenial partner
        # deb-src http://archive.canonical.com/ubuntu xenial partner
        
        • I must say I’m at a loss. Something must have the system convinced that it’s on arm architecture, as the errors show the armhf attempts:

          E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
          E: Failed to fetch http://sfo1.mirrors.digitalocean.com/ubuntu/dists/xenial-backports/universe/binary-armhf/Packages 404 Not Found [IP: 198.199.99.226 80]
          E: Some index files failed to download. They have been ignored, or old ones used instead.
          

          I have never seen something like that occur, so I’m not sure what could have triggered it. I’m hoping another reader here might see my struggle and offer some better advice :(

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!