Hi, i've had this problem for quite a while now. But i've left it on the back burner. I get this error when trying to apt-get -f install
Failed to fetch http://archive.debian.org/debian-security/pool/updates/main/p/python2.7/python2.7-dev_2.7.3-6+deb7u4_armel.deb Hash Sum mismatch
W: Unable to read /etc/apt/preferences.d/ - FileExists (2: No such file or directory)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
What this might mean is that the hashes for your local copy of the package file list don't match the hashes on the remote package file list, for some reason. Perhaps at one point an update got interrupted, or you got a partially-updated list of files, or something of that nature.
To fix it, I'd start with:
apt-get clean
apt-get update
and then see if the problem persists. If it does, then remove the files in the /var/lib/apt/lists/ directory, try the two above commands again, and then re-try your download once more.
Hope this helps ! If neither of these suggestions help let us know and we can take things from there.
Make sure you're running it as root as well, it could be a permissions issue; but yes i would sudo mkdir -p /etc/apt/preferences.d/;sudo apt-get clean && sudo apt-get update && sudo apt-get -f install .
This is a warning W and not an error E. /path/to/foo.d are drop-in folders that do not have to exist, as they are intended for local config files that are not touched by package updates (as long as they are not part of a package themselves, like /etc/apt/apt.conf.d/70debconf). In contrast to e.g. /etc/pkg.conf or /etc/default/pkg.
$ mv -v /etc/apt/preferences.d{,x} && apt-get -f install; echo $?
`/etc/apt/preferences.d' -> `/etc/apt/preferences.dx'
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
W: Unable to read /etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)
0
In addition, a) Python2 has been out of support since 2020 and b) Debian 7 since 2018, they should therefore no longer be used as they no longer receive security updates. And because of b), apt-get update usually prints a KEYEXPIRED warning.