In case there were some problems during the last apt-get operation, is there a command that checks if something has to be continued in apt-get?
Asked
Active
Viewed 4.8k times
3 Answers
28
Use the command:
sudo apt-get -f install
If that doesn't work, you can direct dpkg to finish setting up any packages that were only partially set up:
sudo dpkg --configure -a
If it doesn't work than you can reconfigure all the packages with:
sudo dpkg-reconfigure -a
-
4I think reconfiguring all packages is not such a good idea and takes hours of manual work – rubo77 Feb 24 '14 at 11:51
-
-
-
On my problem the
-fdoesent make any difference, woth or without, I get no errors with apt-get but with atṕtitude, see: http://askubuntu.com/questions/425516/aptituse-problem-using-mariadb-on-ubuntu-13-10-32bit – rubo77 Feb 24 '14 at 12:04 -
-
2Is it possible that you meant
dpkg --configure -a? That's a subset of whatapt-get -f …does if there are unconfigured packages.dpkg-reconfigureis an entirely different operation. – David Foerster May 26 '18 at 16:22 -
Don't recommend
apt -f install- in certain scenarios it can purge your system from all software... – jave.web May 16 '23 at 16:53
8
In addition to the response by @Frantique, I would like to add:
sudo dpkg --configure -a
That solved my issue when the upgrade was interrupted during the process.
Jose Gómez
- 558
- 1
- 5
- 19
2
I had the same issue and in my case a Deb package was corrupted. I had to
delete the cached packages from
/var/cache/apt/archiveswithsudo apt-get cleanbefore running
sudo apt-get -f install
David Foerster
- 36,264
- 56
- 94
- 147
dpkg lockerror, see here. – Wilf Feb 24 '14 at 11:23sudo dpkg --configure some-packageand you encounter that SOME process is using SOME filesudo lsof /path/to/filecan give you PIDs of the processes tokill PID– jave.web May 16 '23 at 18:55