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.6k times
19
rubo77
- 31,573
- 49
- 159
- 281
-
2If you get a `dpkg lock` error, see [here](http://askubuntu.com/a/99538/178596). – Wilf Feb 24 '14 at 11:23
-
apt-get doesen't suggest anything here, but aptitude does, but a very strange suggestion on my laptop: http://askubuntu.com/questions/425516/aptituse-problem-using-mariadb-on-ubuntu-13-10-32bit – rubo77 Feb 24 '14 at 11:59
-
Depends where it was interrupted. Sometimes you interrupt dpkg sometimes you interrupt apt-get. apt-get itself can be interrupted any time since it's just an frontend for dpkg, dpkg otherwise is not for some operations. – Braiam Feb 24 '14 at 16:04
-
If you're going down the rabbit hole through `sudo dpkg --configure some-package` and you encounter that SOME process is using SOME file `sudo lsof /path/to/file` can give you PIDs of the processes to `kill PID` – jave.web May 16 '23 at 18:55
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 `-f` doesent 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 what `apt-get -f …` does if there are unconfigured packages. `dpkg-reconfigure` is 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
- 35,754
- 55
- 92
- 145
Matthias Beaupère
- 141
- 5