Recover after removing nvidia-related packages

7,506

Fixed the problem by reinstalling the nvidia drivers:

sudo apt-get install nvidia-current
sudo modprobe nvidia-current
sudo lsmod | grep -i nvidia
sudo nvidia-xconfig

Followed the instructions on this website.

Share:
7,506
Praetorian
Author by

Praetorian

I write C & C++ software for 5G-NR & LTE base stations.

Updated on September 18, 2022

Comments

  • Praetorian
    Praetorian almost 2 years

    I recently upgraded my HTPC to 11.04 and since it comes with the Unity dock I decided to get rid of Cairo dock. Unfortunately, while trying to uninstall Cairo dock I ended up removing too many packages (I even saw some NVidia packages being removed) and Ubuntu won't run anymore. I get to a black screen which lists a bunch of daemons that have started and then it goes no further, not even a command prompt. I can get to the command prompt if I start in recovery mode.

    I have tried running the following commands but none of them fixed the problem:

    sudo apt-get install ubuntu-desktop
    

    This one completed successfully but did nothing.

    dpkg-reconfigure -phigh -a
    

    This failed, I don't have the exact error message right now, but it complained about an unrecognized image or some such thing.

    dpkg-reconfigure xserver-xorg
    

    This didn't seem to do anything.


    I can reinstall the OS without any loss of data because all of it is on a second drive, the only changes I'd made to the OS were installing XBMC, Samba and Cairo dock. However, to complicate things further, I can't boot off of a USB drive anymore! I know that used to work because that was how I'd installed Lucid in the first place, but now, even though the BIOS list an attached storage device, Grub (or maybe it's the BIOS? not sure which one) won't recognize that the USB drive is bootable. I've tried creating the bootable USB using UNetbootin and Universal USB Installer, with both 11.04 and 10.04, but no combination is working. The PC does not have an optical drive, so USB is the only option.

    Is there a command-line command to reinstall the OS? Or do I need to pull the hard drive and wipe it?


    EDIT 1

    Running ls /var/log/dpkg.* lists the following files:

    • /var/log/dpkg.log
    • /var/log/dpkg.log.1
    • /var/log/dpkg.log.2.gz

    ...

    • /var/log/dpkg.log.10.gz

    I tried to upload the first log file to pastebin using pastebinit /var/log/dpkg.log but it fails with the following error:

    IOError: [Errno socket error] [Errno 104] Connection reset by peer
    

    dpkg-reconfigure -phigh -a
    

    fails with the following error:

    update-initramfs: Generating /boot/initrd.img-2.6.35-22-generic-pae
    cron stop/waiting
    dpkg-maintscript-helper: error: couldn't identify the package
    
    • Oli
      Oli about 13 years
      Have you checked the boot sequence in the BIOS? Or do does it give a "Boot menu" option on boot. If it has booted to USB before, I can't see why it won't now. Other than that, you might want to check what got removed. It should have been logged. Run ls /var/log/dpkg.* to see what's available.
    • Oli
      Oli about 13 years
      pastebinit is a useful tool for getting big log files out of a headless system (it posts the whole file to paste.ubuntu.com so you can either get at it from a graphical system or share it with us.
    • Praetorian
      Praetorian about 13 years
      Thanks for the pastebinit tip, that should save me a whole bunch of typing :)
    • Praetorian
      Praetorian about 13 years
      @Oli: Added more info to the question. Thanks for your help so far!
    • Oli
      Oli about 13 years
      I suppose there isn't a network connection (hence not being able to upload). When you go into recovery mode make sure you pick the option that has networking turned on and make sure (if this is a laptop that usually connects wirelessly) you have a network cable connecting you to the router. Wireless/3g/etc is a PITA to configure from a terminal.
  • Praetorian
    Praetorian about 13 years
    Bluetooth is still dead, but I've read some bug reports suggesting bluez may be broken in Natty. I'll post that in another question if I can't get it working tonight.