Linux help / guide

Most of the things on this page are something that I've had to look for, at one point or the other. Since I needed them and some of the we're really pain to find, I thought it might be a good idea to have them all on one page.
Most of the problems below are specific to Ubuntu Linux.

Samba "broken package"

Keywords: ubuntu synaptic "subprocess pre-removal script returned error exit status 102"
Specs: I think this appeared after upgrade from Breezy to Dapper.

Synaptic (and apt-get) reported of a broken package and neither could fix the problem.

Solution:
  1. Remove or rename '/etc/rc2.d/samba' and '/etc/rc3.d/samba
  2. Relink both to '../init.d/samba' with following on command line: 
  3. Then run Synaptic or sudo apt-get -f install on command line

Interrupted system upgrade

Keywords: upgrade dist-upgrade interrupted
Specs: I ran system upgrade from terminal with sudo update-manager -c and at some point about midway through managed to kill the upgrade/update process. Things didn't work and after reboot system wouldn't boot at all, just gave me "kernel panic" errors and other similarily scary info.

I'm typing this from memory, so there might be some errors somewhere.
  1. I quickly downloaded a ISO-image of the latest Ubuntu release (at this time being 6.10), burned it onto a CD-R and booted with it. I then proceeded to join #Ubuntu on freenode and the guys there helped me
  2. First I needed to mount the old / to the live system I had just booted up from the burned CD. So I figured out which partition was the linux main one with sudo fdisk -l and then made a new folder to /mnt called hda2, to which I mounted the said partition
  3. I then did sudo chroot /mnt/hda2 to gain access to the dead system on my HD
  4. Then I did sudo apt-get install -f and the upgrade finished and fixed the problems

Stuff to be added after clean install (added 1.10.2007)

See Restricted Formats page in the Ubuntu Documentation site.


Cloning a operating system over network (added 18.10.2007)

This is something I picked up when trying to figure out how to clone a Ubuntu Desktop environment to another exactly similar (hardware wise anyway) laptop, when I don't have extra hard discs for the operation. This is what I found:

Run this on the system you want the image from:
dd if=/dev/sda | nc 192.168.0.1 9000

and this on the receiving side:
nc -l -p 9000 | dd of=/dev/sda

Of course, both systems will need to be booted with a CD and have access to the network drivers and the netcat program (Knoppix, Ubuntu LiveCD).

See Few useful ntcat tricks in Terminally Incoherent blog, which this was just one small bit off of.