0

Trying to do sudo apt-get update for ubuntu 20.04 but it shows an error like this:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal/main/binary-amd64/Packages  404  Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/main/binary-amd64/Packages  404  Not Found [IP: 185.125.190.39 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

I have attached my screenshot of the error. Can anyone please help with it?

My sources.list screenshot enter image description here

/etc/apt => enter image description here

Output of dpkg --print-foreign-architectures enter image description here

  • 1
    What is your actual machine architecture (uname -m)? You seem to have a mix of "amd64" and "arm64" in your sources.list – steeldriver Sep 04 '22 at 12:53
  • @steeldriver it says x86_64 – immingmar Sep 04 '22 at 13:00
  • 1
    So why do you have arm64 in your sources? In particular, why do you have things like http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/main/binary-amd64/Packages (apparently trying to pull amd64 packages from the ports repo) and http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages (apparently trying to pull arm64 packages from the regular repo)? – steeldriver Sep 04 '22 at 13:09
  • Yeah, actually i messed all of my sources.list file by copying everyone of them without having any prior knowledge. What shall i do to solve this? @steeldriver – immingmar Sep 04 '22 at 13:12
  • 1
    If you [edit] your question to include the content of the edited file(s) (/etc/apt/sources.list and any in /etc/apt/sources.list.d that you may have modified) maybe someone will be able to offer some suggestions. As a last resort, see How do I restore the default repositories? – steeldriver Sep 04 '22 at 16:29
  • @steeldriver I have attached my contents of /etc/apt/sources.list – immingmar Sep 05 '22 at 11:53
  • I'd suggest commenting out (#) all the ubuntu-ports entries (i.e. the first 8 entries) and then seeing if sudo apt update runs without errors – steeldriver Sep 05 '22 at 12:47
  • E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.39 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.36 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.36 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.36 80] @steeldriver. Tried. It gave error like this – immingmar Sep 05 '22 at 13:03
  • So did you check /etc/apt/sources.list.d/ for other .list files? I don't see anything in the file you posted that would result in those errors. Look for lines possibly containing [arch=arm64]. – steeldriver Sep 05 '22 at 13:15
  • @steeldriver there is sources.list.d file in /etc/apt and no lines containing [arch=arm64]. I have attached my /etc/apt/ folder – immingmar Sep 05 '22 at 13:34
  • See this answer https://askubuntu.com/a/877051/124466 – Archisman Panigrahi Sep 05 '22 at 13:39
  • @ArchismanPanigrahi it did not worked as well – immingmar Sep 05 '22 at 13:45
  • @immingmar please show us the output of dpkg --print-foreign-architectures – steeldriver Sep 05 '22 at 13:47
  • @steeldriver It's i386 and arm64. I have attached the screenshot as well. – immingmar Sep 05 '22 at 13:50
  • @immingmar please no more screenshots of text! You can try to remove the incompatible foreign architecture with sudo dpkg --remove-architecture arm64 – steeldriver Sep 05 '22 at 13:59
  • @steeldriver Finally, it worked!! Thanks! – immingmar Sep 05 '22 at 14:06
  • @steeldriver Please consider posting an answer. – Random Person Oct 30 '22 at 17:15

0 Answers0