how to get rid of arm64 in apt

W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_cuda-repo-8-0-local_Release
N: Skipping acquire of configured file 'non-free/binary-arm64/Packages' as repository 'http://repository.spotify.com stable InRelease' doesn't support architecture 'arm64'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

After I installed Jetpack for Jetson tx1, my ubuntu constantly tries to fetch arm updates. Is there a way to disable this?

EDIT:

$dpkg --print-architecture
amd64

$dpkg --print-foreign-architectures
i386
arm64

I see that arm64 is included in foreign architectures. How do I remove it?


Solution 1:

You can remove a foreign architecture by running

sudo dpkg --remove-architecture arm64

After that, you need to update your software lists.

sudo apt update

If you still get some errors or warnings, you can try deleting all your software lists and completely re-downloading them from the server, to make sure nothing old is left. Note that the complete download will take a bit longer than usual:

sudo rm -rf /var/lib/apt/lists
sudo apt update

Solution 2:

Faced same issue while working with jetson-tx2 arm64. This manual refers the solution in advanced setup scenario It turns out you can't remove architecture without removing packages.

This is useful when a foreign architecture has been added, causing "404 Not Found" errors to appear when the repository meta-data is updated. For example, if you wanted to restrict a repository to only the amd64 and i386 architectures, it would look like:

deb [arch=amd64,i386] <url>

Provide the above option for all repositories in "sudo gedit /etc/apt/sources.list"

Now "sudo apt update" and it will fetch only from amd64 and i386.

Solution 3:

I had this same issue and as Byte Commander mentioned if you cant directly run

sudo dpkg --remove-architecture arm64

You have have bunch of cross-compile arm64 packages installed and need to run this before removing arm64. Run the following commands in the order listed:

sudo apt autoremove 
sudo dpkg --remove-architecture arm64
sudo apt-get update