The One and the Many

apt-get "Unable to find expected entry" errors

I updated to Debian jessie last evening and it went smoothly. This morning I wanted to see if there were any updates (it's been a while since I could expect much in the way of updates since I was running squeeze in oldstable). I encountered an error from apt-get update that I could not figure out even after several searches and playing with configs.

This is what I saw when trying to run apt-get update:

root@beast# apt-get update
Ign jessie InRelease
Get:1 jessie Release.gpg [2,373 B]
Get:2 jessie Release [148 kB]
Get:3 jessie/main i386 Packages [6,769 kB]
Get:4 jessie/contrib i386 Packages [49.6 kB]
Get:5 jessie/non-free i386 Packages [79.7 kB]
Fetched 7,048 kB in 27s (259 kB/s)
W: Failed to fetch
  Unable to find expected entry 'main/binary-i386 all/Packages'
  in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored,
  or old ones used instead.

There were others with similar problems but none of their solutions worked for me.

I thought that it have been a temporary problem with one of the apt mirrors but it persisted all day and I tried various mirrors.

Given the error I thought that there must be a problem with my entries in /etc/apt/sources.lists. I tried variations on what I had listed there for jessie. I tried examples from the Debian wiki and from the sources.list man page. None worked.

Eventually I thought to try seeing what other files were under /etc/apt and see if anything jumped out at me as a problem. I had looked already for any problem ones such as under /etc/apt/sources.list.d but I had not started digging through what else was there.

I discovered this file: /etc/apt/apt.conf.

Inside there was this line:

APT::Architectures "i386 all";

It looked innocent enough. I thought I may as well try what happens if I comment it out. With that line commented apt-get update worked again just fine.

I'm not sure where this line came from. I have a feeling I may have added it a long time ago when I was setting up an apt repository for my own packages and forgot about it. It shows that I need to add some comments about when I change configs like that!