3

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?

Oli
  • 289,791
  • 117
  • 680
  • 835
js-coder
  • 2,237
  • 6
  • 20
  • 18
  • 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
  • 3
    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

3 Answers3

2

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.

0

I'm going to put @enzotib's comment here, because I missed it the first time coming here.

  1. Enter "Recovery Mode" in grub

  2. select, "Drop To Root Shell Prompt (read-only mode)"

  3. In the shell execute the command below to re-mount / in read/write mode:

    mount -o remount,rw /
    

I was unable to login to tty2 in ubuntu 20.04 as the root password is not defined by default, and a the default user setup on system install doesn't apparently have login access here.

monkut
  • 281
  • 1
  • 4
  • 11
0

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.

enzotib
  • 92,255
  • 11
  • 164
  • 178