Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie sarlacii's Avatar
    Join Date
    May 2005
    South Africa

    Lightbulb Recovering your system after a dodgy package upgrade (PClinuxOS flavoured) - [Readme]

    Okay, so you decided to upgrade or install some package (LinCity) using Synaptic, and some other package caught your eye (HAL daemon). Good stuff, you think, that looks like it is way behind, so let's upgrade it aswell. Cool.

    So you select the packages, download and install them. All good. You then shutdown for the night and the next day you switch your PC back on, to discover, OMG some issue about HAL module not loading owing to an incompatible install (kernel etc.) and as a result, something is seriously broken (eg. your keyboard and mouse do not work, if it was hal... or your system is flaky because /proc won't mount, whatever!). So no fixing it on the fly, as you can't type (!) things without major errors.


    1. Reboot using another distro, like your PClinuxOS CD, or Knoppix DVD.
    2. Mount your root drive as say, "/mnt/root",
    3. and then run the magical command "chroot /mnt/root"
    4. This will give you a "virtual" root system within your buggered distro, with a working keyboard thanks to your live distro.
    5. The chroot command without any extra options will automatically try to run your default SHELL, in my case /bin/bash... or /bin/sh failing that.
    6. Now, you have a shell, and you have root... but you cannot start running commands just yet.
    7. First, check out your /etc/fstab using less or more or whatever. "less /etc/fstab"
    8. See the lines...
    none /proc proc defaults 0 0
    none /dev/pts devpts mode=0620 0 0
    none /proc/bus/usb usbfs defaults 0 0
    /dev/sdb7 swap swap defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    9. You need some of these if things are going to work.
    10. So, type "mount /dev/sdb7" to get swap drive, "mount /proc" to get your kernel paramters in their virtual filesystem, "mount /dev/pts" for pseudo-terminal master and slave instances, "mount /dev/shm" to get your shared memory going - not really required, but what the hell, and lastly "mount /proc/bus/usb" to get your usb devices.
    11. Now the master stroke... Synaptic installed , for example, hal, which buggered up your install, because the kernel wasn't upgraded at the same time. Trying to uninstall hal will not work owing to convoluted dependencies, and since you are now using apt-get at the command line, you cannot ignore errors.
    12. So run a "apt-get update".
    13. Then run "apt-get dist-upgrade".
    14. This is a BFG approach, I know, but I'm working on the case where you wanted to upgrade some things anyway. After everything has downloaded and installed, you'll likely have a new kernel to contend with. Edit your grub conf (or lilo) if you want, or else just reboot and select the new kernel.

    May the Force be with you. BTW, yes I really did bugger my hal up, and as a result my mouse and keyboard were dead. LOL
    [Comments, errors and other suggestions?]

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Hi sarlacii ... you asked for comments
    I suggest you chroot something like
    mount -t ext3 /dev/sda1 /media/sda1
    mount -t proc proc /media/sda1/proc
    mount -t sysfs sys /media/sda1/sys
    mount -o bind /dev /media/sda1/dev
    chroot /media/sda1 /bin/bash
    running mount -a should sort other required mounts ...

    I can't really comment much on apt-get since I have used update, upgrade and install options only.

  3. #3
    Linux Newbie sarlacii's Avatar
    Join Date
    May 2005
    South Africa
    Ta... I was half expecting flames for a "dodgy" fix. At least you didn't laugh me out of the forum! LOL

    Thanks for the info... it adds to the howto. I forgot about the -a option for auto-mounting the contents of fstab.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts