Kitz Forum

Computer Software => Linux => Topic started by: Weaver on September 28, 2018, 01:42:08 AM

Title: Apt-get errors after aborting command
Post 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?
Title: Re: Apt-get errors after aborting command
Post by: burakkucat on September 28, 2018, 03:28:35 PM
<Ctrl-Z> would have only paused, i.e. suspended, the process. It could have been resumed with a fg command.  :(
Title: Re: Apt-get errors after aborting command
Post by: Weaver on September 28, 2018, 03:53:54 PM
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.
Title: Re: Apt-get errors after aborting command
Post by: parkdale on October 07, 2018, 10:19:40 AM
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 ... :)
Title: Re: Apt-get errors after aborting command
Post by: Weaver on October 08, 2018, 12:22:57 AM
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.