1

Kind of getting to a good stage of using Linux. I am having a problem with updating my Ubuntu 20.04. Every time I run sudo apt update I get "file failed to fetch" error messages. I have tried modifying the source.list file but no luck. Would appreciate some help.

Example

Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.39 80]

Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.39 80]

Kenneth Shibaba
  • 53
  • 1
  • 1
  • 7

1 Answers1

2

All arm64 packages ONLY exist on the ports.ubuntu.com repositories. Your errors are because you are using the standard archives - which only carry i386 and amd64 architechtures - and will be breaking.

Based on your comment indicating your system architecture is x86_64, you need amd64 packages, and NOT arm64 packages. Why your system is searching for ARM64 packages is beyond me, so we're going to fix that. So let's fix that problem first, because you shouldn't need arm64 packages on a standard install.

  1. Remove arm64 from foreign architectures that dpkg/apt looks for.

    sudo dpkg --remove-architecture arm64
    
  2. Reset your sources list back to previous.

    Use something like this:

    deb http://gb.archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    #deb-src http://gb.archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb http://gb.archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    #deb-src http://gb.archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb http://gb.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    #deb-src http://gb.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb http://gb.archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    #deb-src http://gb.archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    deb http://archive.canonical.com/ubuntu focal partner
    #deb-src http://archive.canonical.com/ubuntu focal partner
    

    (Note I commented out the deb-src lines, unless you're doing things like apt source calls or such you probably don't need them).

  3. Run sudo apt update again. You should see no more errors.

Thomas Ward
  • 74,764
  • Hi. Thank you for your kind response. I did that and this is what got : The repository 'http://ports.ubuntu.com/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://ports.ubuntu.com/ubuntu focal-updates Release' does not have a Release file. – Kenneth Shibaba Aug 06 '23 at 00:28
  • I forgot to include updating /ubuntu to /ubuntu-ports - try updating that part as well and it should work. – Thomas Ward Aug 06 '23 at 01:37
  • Hey Thomas. Do forgive me. Should I put it like this, deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted – Kenneth Shibaba Aug 06 '23 at 18:51
  • Updated it and this is what I got. E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal/main/binary-i386/Packages 404 Not Found [IP: 2620:2d:4000:1::19 80]

    E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages 404 Not Found [IP: 2001:67c:1562::15 80]

    E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/main/binary-amd64/Packages 404 Not Found [IP: 2620:2d:4000:1::19 80] .

    – Kenneth Shibaba Aug 06 '23 at 19:07
  • @KennethShibaba See updated post, I added an example of what your sources.list should look like. – Thomas Ward Aug 07 '23 at 13:35
  • Thank you very much for this help. I copied the exact example you showed and updated it in my sources list file. Unfortunately I am still getting the same error messages. I must say I did not comment any line out. I have backup sources list files in the etc/apt should I remove them? – Kenneth Shibaba Aug 07 '23 at 18:16
  • 1
    @KennethShibaba You have some weirdness in your system i believe. Your system is looking for amd64, i386, and arm64. WHat is the actual architecture on your system? uname -i for this info. There should not be any cases where you're mixing standard AMD64/i386 repos and ARM repos. – Thomas Ward Aug 07 '23 at 20:04
  • Ithank you once again. totally agree. Its really weird. So after executing uname -i I got x86_64. I have a dual boot system as well – Kenneth Shibaba Aug 07 '23 at 22:15
  • 1
    Dual boot doesn't matter in this case. I've updated my answer completely now. – Thomas Ward Aug 07 '23 at 22:34
  • Whaow! IT WORKED!! Oh my goodness. I am more than grateful. This has been a very educative experience for me. No errors. 350 packages can be upgraded. Guess I'd do that. Thank you Thomas. – Kenneth Shibaba Aug 08 '23 at 08:17
  • @KennethShibaba glad to hear it! Don't forget to hit the checkmark to accept this answer and mark the question as solved! :) – Thomas Ward Aug 08 '23 at 14:16