2

I recently built a new machine, using Debian Jessie. Soon after I upgraded to stretch, and everything seems fine except, one stubborn error which keeps popping up when I run "apt-get update".

Err:12 http://security.debian.org stretch/updates/non-free Translation-en ***Could not open file /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 - open (13: Permission denied) [IP: 212.211.132.32 80]****

and finally

E: Failed to fetch http://security.debian.org/dists/stretch/updates/non-free/i18n/Translation-en  Could not open file /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 - open (13: Permission denied) [IP: 212.211.132.32 80]

At the time there was little advice about how the file should be formed, I simply took my existing sources.list, and replaced any mention of "Jessie" with "Stretch"

Can anyone pitch in with ideas?

4
  • are you running this as root, or with sudo? or are you running it as your non-root user?
    – cas
    Aug 5 '17 at 3:30
  • @cas If I remember right sudo is not installed by default in Debian. You can su - enter your password and then you can run apt-get update . Either way that command must be run with root privileges.
    – nullmeta
    Aug 5 '17 at 5:00
  • yeah, that's why i phrased my question the way i did. running apt-get as root is the important thing, sudo is just one way of doing that.
    – cas
    Aug 5 '17 at 5:04
  • ls -al /var/lib/apt/lists/partial
    – user192526
    Aug 5 '17 at 6:31
7

So the solution is to remove the content of the /var/lib/apt/lists/partial as root (just the content not the directory)

rm /var/lib/apt/lists/partial/*

and after do this command :

apt-get update

tell us if the problem persist ;).

2
  • 1
    Thanks for the answer, but...What I need to say is too long for a comment, so I added a new answer, Is that the right way to do it? seems overcomplicated to me =)
    – Blaklite
    Aug 5 '17 at 14:56
  • i add a comment to your answer. Aug 5 '17 at 16:00
2

Ok problem solved, and interestingly enough has uncovered a problem I didn't even know I had.

After making a copy of all of the "lists" directory, I deleted all of the contents (including the "partial" folder), re-ran apt-get update and voila, no errors.

And the bonus issue solved, was the fact that for some time, when I had run apt-get upgrade, it was coming back no updates to apply. I thought nothing of it, only that the teams might be a little slack. However now when I try the "upgrade" I am getting a healthy number of updates coming through.

Many thanks for your help. Might not seem it, but as usual ll it took was the input of a 3rd party, to help trigger a response I hadn't come to on my own. Who'd have thunk it, the system works!! =)

Cheers,

0

im sorry if this is not in the correct place (ie answering my own question with an update, but it was too long for a "comment", and I did not want to edit the previous answer, anywhoo here we go...

Thanks for your reply. First I tried to rm using sudo as advised, but got permission denied. Then was able to cd up to the "/var/lib/apt/lists/" directory, but no further. So using "su" I could cd into the "partial" directory and run "rm ./*", clearing out the contents.

Re-running "apt-get update" (as root... sigh*) first gave me

Ign:13 http://security.debian.org stretch/updates/non-free Translation-en
Hit:12 http://security.debian.org stretch/updates/non-free amd64 Packages
Err:13 http://security.debian.org stretch/updates/non-free Translation-en
  BZ2_bzread: /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 Read error (-5: DATA_ERROR_MAGIC)
Ign:14 tor+http://zcaptnv5ljsxpnjt.onion jessie InRelease
Hit:15 tor+http://zcaptnv5ljsxpnjt.onion jessie Release
Fetched 295 kB in 2s (130 kB/s)
Reading package lists... Done
E: Failed to fetch http://security.debian.org/dists/stretch/updates/non-free/i18n/Translation-en  BZ2_bzread: /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 Read error (-5: DATA_ERROR_MAGIC)
E: Some index files failed to download. They have been ignored, or old ones used instead.

The running update again gave me the same error as before...

Ign:13 http://security.debian.org stretch/updates/non-free Translation-en
Ign:12 http://security.debian.org stretch/updates/non-free amd64 Packages
Err:13 http://security.debian.org stretch/updates/non-free Translation-en
  Could not open file /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 - open (13: Permission denied) [IP: 195.20.242.89 80]
Ign:12 http://security.debian.org stretch/updates/non-free amd64 Packages
Fetched 62.9 kB in 1s (43.0 kB/s)
Reading package lists... Done
E: Failed to fetch http://security.debian.org/dists/stretch/updates/non-free/i18n/Translation-en  Could not open file /var/lib/apt/lists/partial/security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en.bz2 - open (13: Permission denied) [IP: 195.20.242.89 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

Here is the directory entry for my "partial" directory, are the permissions the same for everyone else?

drwx------ 2 _apt root    16384 Aug  5 15:41 partial

Thanks again for the help.

6
  • In Debian there is normally no sandboxuser _apt. But to be sure show apt-config dump | grep -i sand Edit your question for that.
    – user192526
    Aug 5 '17 at 15:51
  • for the rights i have drwxr-xr-x root root (755 root:root) for partial directory. try to remove the content of lists and partial and change rights and owners and after execute apt-get update you can always do a backup of the directory if you want befor removing. Aug 5 '17 at 15:58
  • It would seem that the _apt user has been introduced in the newer version of apt for sandboxing (I guess?)
    – Blaklite
    Aug 5 '17 at 16:49
  • i had upgrade my Wheezy to Jessie, and that was my rights and owner for the partial directory, this type of error can hapend when you break a process of update, and it's solved by removing the content of lists and partial directory folowed by the execution apt-get update or apt update of curse as a super user. try to do the both process Aug 5 '17 at 17:01
  • yep that's exactly what solved it, see my answer above. Many thanks for your time =)
    – Blaklite
    Aug 5 '17 at 17:15

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.