Kitz Forum
Computer Software => Linux => Topic started by: Weaver on September 28, 2018, 01:42:08 AM
-
I hit control-Z in the middle of a mistaken apt-get install command and it has left a right old mess. If I try to remove the packages that it half-installed I get all kinds of errors relating to other packages that I have never heard of that were dependencies. I managed to fix a load of lockfile errors, but there is still more evil and some of these packages cannot be installed or removed now. An attempted remove operation on them tells you to install the first, and then that fails anyway.
Any ideas for a clean solution?
-
<Ctrl-Z> would have only paused, i.e. suspended, the process. It could have been resumed with a fg command. :(
-
After I corrupted the whole database I could not think of any way of completely blitzing it and resetting everything, so no further apt-get operations worked properly. Not a good advert for Ubuntu, one mistake and the system is rendered unusable for good. They need a proper database with transactions, commit, roll-back that sort of thing. Could have been a power cut. Scary.
-
sudo apt-get clean cleans out any cached debs
sudo apt-get autoclean removes any partial installs
sudo apt-get install -f fixes any broken packages
sudo apt-get install --fix-missing as it implies...
Follow up by do apt-get update
Hope i'm not teahing anyone to suck eggs ... :)
-
Perfect. That is just what I needed. Many thanks.
I got one error out of that lot:
W: Problem unlinking the file .nfs000000000004078500000c61 - pkgAcquire::Clean (16: Device or resource busy)
I found the cause of that - for some reason there was some other process in existence that looked like it was running a stuck instance of apt-get or something. I could not kill it not matter how I tried, so I rebooted the machine. And error message gone.