I was trying to upgrade just a single package, so I typed sudo apt-get upgrade packagename. (Now I know I'm supposed to use apt-get install for that.) Now apt-get is upgrading everything in my whole system. I stopped it with shutdown -h now (hey, it worked) as C-c doesn't seem to work very well.

However apt-get has a memory and now I can't do anything with apt-get such as install without it attempting to continue with a full system upgrade. How do I get apt-get to just abort the upgrade?

When I follow the instructions in the accepted answer as suggested by Itai Ganot, this is what happens:

$ sudo apt-get autoclean
[sudo] password for dsw: 
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
dsw@dsw-VirtualBox:~$ cd /var/cache/apt/archives/partial
dsw@dsw-VirtualBox:/var/cache/apt/archives/partial$ ls
dsw@dsw-VirtualBox:/var/cache/apt/archives/partial$ ls -a
.  ..

Following the instructions in the message:

sudo dpkg --configure -a

eventually stops. So the above method does seem to stop the apt-get update eventually.


There are two things you can do in order to cancel the upgrade:

  1. Try running the following command:

    # sudo apt-get autoclean
  2. Emptying /var/cache/apt/archives/partial To do that, open a file manager using the gksudo command, such as:

    # gksudo nautilus /var/cache/apt/archives/partial 

Delete the files within "partial" but not the folder itself.

  • this method did seem to work after apt-get did a few more things; there is no room to give the details in this little box, so I made them another answer; thanks – user233020 Jul 16 '14 at 19:14
  • 1
    Cannot do autoclean. E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable) E: Unable to lock the download directory – user391339 Feb 23 '18 at 20:31
  • Cannot install gksudo. E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? – user391339 Feb 23 '18 at 20:32
  • Use sudo before the command. – Itai Ganot Feb 23 '18 at 22:33

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.