1

I'm relatively new to Linux but have been running an Ubuntu web server problem free 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. It suggested me to run the same command with the -f flag, so I did. It didn't help, and it still complained about a broken package.

I restarted shut down the computer using sudo shutdown -r now and restarted and now it is unable to boot successfully. It gets stuck at a black screen that says:

initctl: Event failed
Stopping set console keymap
Stopping configure virtual network devices

enter image description here

karel
  • 114,770
Anka
  • 11
  • 3
  • 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 03 '14 at 04: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 03 '14 at 04: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 03 '14 at 04: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 03 '14 at 04: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 03 '14 at 05:00
  • Sorry, to clarify, were you able to boot to a prompt from the recovery menu? if so, what's the output of sudo apt-get install -f? – virtualxtc Jan 03 '14 at 05:04
  • The only prompt it lets me boot into is the Root Prompt or what it was called in the Recovery mode. The output when trying (with as well as without sudo) apt-get install -f was: Not using locking for read-only lockfile /var/lib/dpkg/lock Unable to write to var/cache/apt The package lists or status file could not be parsed or opened. – Anka Jan 03 '14 at 05:10

1 Answers1

0

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
virtualxtc
  • 3,294
  • 2
  • 25
  • 38
  • After running the first command: Cannot remove /var/lib/dpkg/lock - Read only file system – Anka Jan 03 '14 at 05:47
  • mount -o rw,remount / gave no output after execution, so I assume it was successful. :) What would be the next step? – Anka Jan 03 '14 at 05: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 03 '14 at 06: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 03 '14 at 06:24
  • clear you cache: aptitude clean then install each problematic package one-by-one ie: aptitude install initramfs-tools – virtualxtc Jan 03 '14 at 06:32
  • Temporary failure resolving se.archive.ubuntu.com – Anka Jan 03 '14 at 06:42
  • I suggest you research / post that as a new question. – virtualxtc Jan 03 '14 at 06:43
  • I got the network problem solved now, noticed I could manually activate networking at the Recovery Mode-screen as I restarted the computer. However, now it instead gives this error upon trying to install them one by one. Error processing apparmor - dependency problems, leaving unconfigured. This is no matter which of the packages I try and install. – Anka Jan 03 '14 at 07:05
  • welcome to linux package management - as stated, I'd make this a new question, but try having a look at what's already answered first: http://askubuntu.com/questions/360023/i-get-this-error-after-upgade-please-help http://askubuntu.com/questions/279543/unmet-dependencies-not-configured-yet http://askubuntu.com/questions/252777/how-can-i-resolve-dpkg-dependency – virtualxtc Jan 03 '14 at 07:28
  • http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies is quite detailed as well – virtualxtc Jan 03 '14 at 07:32