APT upgrade fails because of permission denied

6,320

I finally figured out problem:-
1. delete partial packages using

sudo -i 
rm /var/lib/apt/lists/partial/*
exit

2. then updating and upgrading packages

sudo apt update    
sudo apt upgrade  

3.pipeline broken warning was fixed by adding below lines in /etc/apt/apt.conf

Acquire::http::No-Cache true;
Acquire::http::Pipeline-Depth 0;
Share:
6,320

Related videos on Youtube

Vineet Jain
Author by

Vineet Jain

C++, python, software development enthusiast. Support If you've found my questions and/or answers helpful, feel free to show your support or appreciation by up-voting. If you are looking for more of my content, you can visit a few of my selected Answers and Question. Setting up environment in virtaulenv using python Count continuous numbers in numpy virtual table and _vptr storage scheme SOreadytohelp

Updated on September 18, 2022

Comments

  • Vineet Jain
    Vineet Jain over 1 year

    While doing sudo apt-get upgrade I am getting this error. Please, Can anyone help me to get rid of this error...

    Err:29 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 DEP-11 Metadata
      Could not open file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_xenial-security_restricted_dep11_Components-amd64.yml.gz - open (13: Permission denied)
    Hit:42 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata
    Ign:45 http://security.ubuntu.com/ubuntu xenial-security/multiverse DEP-11 64x64 Icons
    Get:49 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [516 kB]
    Get:50 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [220 kB]
    Get:51 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [173 kB]
    Ign:52 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons
    Get:53 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [15.8 kB]
    Get:54 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [15.0 kB]
    Get:55 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [7,644 B]
    Ign:56 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata
    Ign:57 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons
    Get:58 http://in.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
    Get:59 http://in.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,584 B]
    Get:30 http://in.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [611 kB]
    Ign:40 http://in.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons
    Ign:47 http://in.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 DEP-11 Metadata
    Ign:52 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons
    Ign:56 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata
    Ign:57 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons
    Err:40 http://in.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons
      Could not open file /var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_xenial-updates_main_dep11_icons-64x64.tar.gz - open (13: Permission denied)
    Ign:47 http://in.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 DEP-11 Metadata
    Ign:52 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons
    Get:56 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [6,341 B]
    Ign:57 http://in.archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons
    Fetched 3,600 kB in 41s (87.2 kB/s)                                            
    Reading package lists... Done
    E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/dep11/Components-amd64.yml  Could not open file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_xenial-security_restricted_dep11_Components-amd64.yml.gz - open (13: Permission denied)
    E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/dep11/icons-64x64.tar  Could not open file /var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_xenial-updates_main_dep11_icons-64x64.tar.gz - open (13: Permission denied)
    E: Some index files failed to download. They have been ignored, or old ones used instead.   
    

    I use this steps:-

    sudo -i 
    rm /var/lib/apt/lists/partial/*
    exit
    sudo apt update   
    

    then it gives me following error:-

    179 packages can be upgraded. Run 'apt list --upgradable' to see them.
    W: http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-amd64/by-hash/SHA256/81b9f032b48cdd473075f9798b299617d9628050291cd0cd27c140f86fc21005: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)
    W: http://in.archive.ubuntu.com/ubuntu/dists/xenial-updates/restricted/binary-amd64/by-hash/SHA256/b9e26643ccf26941d9979437df6983487fcc21a2ef80ba4a59ab4447f339b321: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)   
    

    After that I run sudo apt upgrade but it is giving me following warning:-

    W: http://in.archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd_229-4ubuntu21_amd64.deb: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)
    
    • Verena Haunschmid
      Verena Haunschmid almost 4 years
      sudo apt clear followed by apt update fixed this for me
  • IT Gremlin
    IT Gremlin over 4 years
    Thank you, this has been bugging me on multiple machines, multiple networks and using different country repositories.