3

I'm in a pretty bad situation right now. I ran the following terminal commands to upgrade my Laptop from 12.04 LTS to 14.04 LTS, and left my computer to let it sit to do its thing. When I came back, the terminal window that was running the upgrade contained some prompt about installing an upgrade to the package manager. The moment I touched my keyboard to respond to said prompt, the terminal window closed mid upgrade...

Commands I ran:

$ sudo apt-get update
$ sudo apt-get install update-manager-core
$ sudo do-release-upgrade

I'm not to concerned about those, since they were working. Only felt the need to use them because my update manage still hadn't picked up 14.04 by like 4:00PM today and that's the way I know to make it grab it.

How can I fix things and get my system sane again? I'm currently able to use it, it's just the following issues are present: Any time I try to access the update manager, I see a prompt with the header "Not all Updates can be installed" with details and the options "Partial Upgrade" and "Continue". Clicking continue gets me the following message.

Software Index is Broken:

It is impossible to install or remove any software. Please use the package manager    
"Synaptic" or run "sudo apt-get install -f" in a terminal to fix this issue at first."

Trying to run the mentioned command generates the terminal error:

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?

lsb_release.a lists that I am on 14.04, but I definitely appear to be between versions. I've tried to re-start the upgrade process but get greeted with the same error in the terminal window that I mentioned earlier when I do. I haven't attempted a system reboot, but I'm scared to, since I think it will break my OS.

How on earth can I fix this mess?

Braiam
  • 69,112

3 Answers3

2

I would say that the best that you could do is to backup your data, keep your settings ( ~/.config/ etc, see below) and do a clean install of 14.04, because I think that more things than just your package management system may have been messed up.

Finding out what has happened and how to fix it would be a very difficult thing to do.

A full guide for settings backup is How to backup settings and list of installed packages

For a start what to backup - and to make very clear it's not just ~/.config/:
At least any dir of file in $HOME starting with a dot, ~/.*. You can then sort out things like large, irrelevant dirs or subdirs: ~/.thumbnails, ~/.mozilla/firefox/*/CACHE ... - There is certainly more config data elsewhere; but not much more.

hytromo
  • 4,891
0

as I can't comment, I'll try and address what seems to be the problem. did you C^c anything on the install? as it seems that one of the updates crashed unexpectedly. (could not get lock).

The course of action I would recommend would be to first check that no update managers, or rogue threads are trying to update your system. ps -e | grep apt. kill anything that comes up.

Second, you'll need to delete the lock file for aptitude removing the lock file should solve this rm /var/lib/dpkg/lock.

After this, try running apt-get update && apt-get upgrade. This should hopefully get you back to were you were.

EDIT
It seems that the first error you're coming across is related to the package manager. Broken Software Index Repair. Try going through that and see if it unlocks, and resets your application database.

0

Try this solution that was originally posted by "Bruno Pereira"

Remove your /var/lib/dpkg/lock file and force package reconfiguration.

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

It should work after this.

David Foerster
  • 36,890
  • 56
  • 97
  • 151