Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Relatively new to Linux but have been running an Ubuntu webserver problemfree for about a year now. However,

After running

sudo apt-get update
sudo apt-get upgrade

it complained about being unable to upgrade due to a package and suggested me to run the same command with the -f flag, so I did. Didn't help, still complained about a broken package.

Anyway, I restarted the whole computer using

sudo shutdown -r now

And now it is unable to complete a boot up. It gets stuck at

Stopping set console keymap

Stopping configure virtual network devices

And then nothing happens no matter how long I wait.

What has happened and how can I fix this? Would prefer not reinstalling the whole system.

Thankful for help!

Screenshot:

enter image description here

share|improve this question
    
I can choose between Ubuntu with Linux 3.5.0-34-generic, Linux 3.5.0-34-generic (recovery mode), Previous Linux versions, memtest86+ / memtest 86+ serial console. I dont see any failsafe mode :( –  Anka Jan 3 at 4:16
    
sorry I meant recovery mode not fail safe; if you can connect via Ethernet cable you should be able to finish your update, else it's gonna get a bit messy, and I'd recommend the install CD instead. –  virtualxtc Jan 3 at 4:20
    
It's currently been running via wireless but I can connect an ethnernet cable if needed for the update. Added a screenshot of the boot failure if it helps in the original post. Anyway how exactly do I go about with repairing this from the Recovery menu? –  Anka Jan 3 at 4:38
    
oh, that looks like a drive / mount problem, not just a broken package. Verify your drive cables are all properly seated and try again. If you still get the error, the fastest thing to do is a fresh install (maintaining your home directories), but if for some reason you don't want to do that you should change your question to reflect that you are having mount problems. –  virtualxtc Jan 3 at 4:51
    
Unfortunly that can't be the problem. The cables are fine. The server has been standing physically untouched since it was put online 1 year ago. All I did was to SSH into my server and run a apt-get update and upgrade as I do from time to time, but this time it complained about a broken package hence didn't let me run the apt-get upgrade command. Ran the apt-get -f upgrade as it asked me to do, didn't help. Decided to do a restart and it gets stuck in that screen. The computer only has that one single drive (Intel SSD.) –  Anka Jan 3 at 5:00
show 2 more comments

1 Answer 1

Try deleting the lock file i.e

rm /var/lib/dpkg/lock

and then run

dpkg-reconfigure -a

(sudo shouldn't be necessary since you are logged in to single user mode)


If you can't run that, then it's a mount issue / your dive is likely mounted as read-only try:

mount -o rw,remount / 
dpkg-reconfigure -a

Use aptitude instead of apt-get updates (and for future installs) as it keeps a much better log of which packages were installed as dependencies, and will provide you with a lot more options if you run into packages that have problems.

aptitude update && aptitude upgrade
share|improve this answer
    
After running the first command: Cannot remove /var/lib/dpkg/lock - Read only file system –  Anka Jan 3 at 5:47
    
mount -o rw,remount / gave no output after execution, so I assume it was successful. :) What would be the next step? –  Anka Jan 3 at 5:58
    
I ran dpkg-reconfigure -a (I assume it was a typo, googled it because it complained about --reconfigure being unknown). It was working for a while and gave no output in return, so I assume success on running that command. Next step? –  Anka Jan 3 at 6:12
    
Did the two aptitudes now. "Current status 4 updates [-76]. Errors were encountered initramfs-tools, linux-image-3.5.0-45-generic, linux-image-generic-lfs-quantal, linux-generic-lfs-quantal, udev, apparmor" –  Anka Jan 3 at 6:24
    
clear you cache: aptitude clean then install each problematic package one-by-one ie: aptitude install initramfs-tools –  virtualxtc Jan 3 at 6:32
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.