Home > Bash, Linux > Move your Ubuntu/Debian installation to another computer

Move your Ubuntu/Debian installation to another computer

To move your Ubuntu/Debian installation to another computer:

1. Start a terminal window on your old computer

2. ‘dpkg –get-selections > ~/instsoft.log’

3. Copy all files from your home folder to an external USB-drive

. (if you use Nautilus instead, remember to press CTRL+H to get all hidden files)

On the new computer:

1. Install the new computer with the same Linux version as the old one

2. Enter the folder containing your home folder copy (from step 3 above)

3. Start a terminal window

4. ‘sudo apt-get install dselect’

5. ‘sudo dpkg –set-selections < instsoft.log’

6. ‘sudo dselect’

7. Select ‘i’ and press Enter to start the software installation

. (internet access required)

ALT METHOD

To copy the entire disk to another disk (with partitions already prepared):

1. Mount the destination disk: sudo mkdir /mnt/extusb && mount -t ntfs-3g /dev/sda2/mnt/extusb

2. Copy all files: sudo cp -rpx / /mnt/extusb

3. Install Grub2 on the new disk

sudo mount /dev/sda2 /mnt

sudo mount –bind /dev /mnt/dev

sudo chroot /mnt

grub-install –recheck /dev/sda

dpkg-reconfigure linux-image-`uname -r`

Categories: Bash, Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.