1

I am working with a Raspberry Pi 3 and I got a problem with these commands :

sudo apt-get update

and

sudo apt-get upgrade

I got this output for the error :

W: Failed to fetch
http://mirrordirector.raspbian.org/raspbian/dists/jessie/InRelease 
Unable to find expected entry 'main/binary-amd64/Packages' in Release
file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/jessie/InRelease  Unable to
find expected entry 'main/binary-amd64/Packages' in Release file
(Wrong sources.list entry or malformed file)

W: Failed to fetch
http://archive.raspberrypi.org/debian/dists/jessie/InRelease  Unable
to find expected entry 'main/binary-amd64/Packages' in Release file
(Wrong sources.list entry or malformed file)

I looked at other forums but it didn't solve my problem, this one for example : https://ubuntuforums.org/archive/index.php/t-2153680.html

This is my sources list (/etc/apt/sources.list) :

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib    non-free rpi 

deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi 

deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

So, I don't know where exactly comes from my problem, maybe it's a problem of architecture.

migrated from stackoverflow.com Jan 8 '17 at 13:48

This question came from our site for professional and enthusiast programmers.

  • I fixed text including http: string for you to avoid confusion. Please check if I did it right. – Dmitry Grigoryev Jan 13 '17 at 10:38
1

Your problem is clearly because apt-get is trying to get amd64 packages which don't exist for the RPi (the RPi has an arm7hf architecture). You said you looked at other forums, but did you actually execute some of the troubleshooting steps from those forums? The one you've linked to deals with amd64, so if you did any of those steps you might have created an issue somewhere.

Also, I just noticed that the contents of your /etc/apt/sources.list have issues, the correct content should be:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi

deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

Note the "http://" prefix which was incorrectly spelled in your pasted example. Can you retry with these fixes?

  • 2
    I think maybe what happened with the "htp" thing (notice the first error doesn't match the file) is because the OP did not format it correctly and the system rejected it because there's a limit on the number of links you include. Or, that could really be the error... – goldilocks Jan 8 '17 at 14:18
  • I think I had to change the architecture for installing a package few times ago. How is possible to get back back the right architecture ? The arm7hf one. The file sources.list is correct, I couldn't post more than two links, that's why I deleted a "t" for http://, the problem doesn't come from there. – DjibTgy Jan 13 '17 at 10:21
1

You seem to have configured a wrong architecture on your RPi. Run dpkg --print-architecture to see which architecture you have. What you need is armhf:

dpkg-architecture -a armhf

You may also want to remove unused architectures (like amd64) with

dpkg --remove-architecture amd64

And while you're at it, you may remove AMD64 packages if you don't need them, by running the following command (check the list of packages to be purged before accepting!):

apt-get purge .*:amd64
  • Thanks, now I can update : sudo apt-get update, but the command : sudo apt-get purge .*:amd64 is not working, I got that : E: Unable to locate package .* E: Couldn't find any package by regex '.*' Morevover, I got some troubleshooting with the upgrade command (sudo apt-get upgrade) : insserv: warning: script 'influxdb.sh' missing LSB tags and overrides – DjibTgy Jan 13 '17 at 15:21
  • That error means you don't have any packages to purge (which is good). Regarding the insserv warning, you may just ignore it, or fix the tags manually. – Dmitry Grigoryev Jan 14 '17 at 16:14
  • dpkg --remove-architecture arm worked for me – Dmitry R Feb 12 at 4:50
0

Only after removing arm and amd64 architectures was I able to successfully run sudo apt-get update && sudo apt-get upgrade

Weirdly though dpkg --print-architecture did not show arm or amd64.

This was a fresh install of raspberry jessie on an SDCard from Mac OSX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.