Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was using Ubuntu 11.10 and installed the KDE Desktop and I was happy with that. But I wanted to get my old login screen back so I removed the package kdm. When I boot my PC now, it keeps booting and nothing happens.

How can I add the kdm package again? I got into recovery mode, terminal and tried to execute sudo apt-get instal kdm but I got an error message.

W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Unable to write to /var/cache/apt/
E: The package lists or status file could not be parsed or opened

I'm pretty desperate now, could somebody please help me?

share|improve this question
You can show the correct message with LC_ALL=C sudo apt-get install kdm. I think it could be a read-only mount problem. – enzotib Dec 25 '11 at 15:36
@enzotib Thanks, I updated the error message above! Do you have any idea how I can fix that? – js-coder Dec 25 '11 at 15:41
I cannot remember just now how recovery works, so my tentative would be to remount / in rw mode, with mount -o remount,rw / – enzotib Dec 25 '11 at 15:43
Have you tried booting normally, going to tty1 with Ctrl-Alt-F1, logging in and starting the GUI with startx? – enzotib Dec 25 '11 at 15:48
@enzotib Thank you so much, you helped me so much! :) I suggest you make a new answer about the tty1 approach, I will accept+up vote it then. – js-coder Dec 25 '11 at 16:07
up vote 1 down vote accepted

I suggest you to go to tty1 with Ctrl-Alt-F1, log in and then start the GUI with startx.

At that point you can reinstall the package kdm.

share|improve this answer

If you need to install package in recovery mode, you can first ask for repairing packages (it will mount / in rw mode as suggested by enzotib) and then, when you use the root terminal, you will be able to install new packages and avoid the error you mentioned.

share|improve this answer

Your Answer


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.