0

I know this question has been asked before in various forms but I never really found an exact clear answer, maybe I didn't really look all that well.

I have a clean install of Ubuntu 14.04 and I installed a couple of packages like node, git, vscode, chrome etc. I'd like to make a copy of the current system with all these new packages and configurations so that other people could install it and not go through the same process of installing everything from scratch.

Does anyone know if this is possible and if so got any good documentation or tutorials I could view ?

Some of the potential issues I can think of is, username and passwords. Will those get carried over ? If so how's that best to be handled ? I tried something like SystemBack but it didn't really look to achieve what I was looking for.

1 Answers1

0

I had a similar problem to get a new computer started with Ubuntu and hated to do all my specific settings again. If you are looking at the installed software alone, one solution would be to write a short script that basically consists of all your installation steps

#!/bin/sh
echo "Installing software"
sudo apt install -y gparted
sudo apt install -y clonezilla

It did not work for me, because more work was the configuration of the programs. Just too much hassle to find out how to modify the settings via the script. Hence the method for me is using Clonezilla. I just clone the ubuntu partition to an USB drive. For this I use a start CD made from the clonezilla ISO (you can download it from clonezilla.org). The CD autostarts and is quite straight forward to navigate. I select 'Beginner mode' and 'save partition' to save the Ubuntu partition. You might want to use gparted prior to that to note down the correct partition name, e.g. /dev/sda2. You can ignore the swap partition. The great think is that it contains all, including user names and accounts. Also the network setup is the same.

On the new computer, I just run an installation CD, select "Try Ubuntu" and start gparted (it is available on the live CD). Then I create a new swap partition and a Ubuntu partition with a bit larger size than the copied one. Then I reboot the computer with the Clonezilla CD and select 'Beginner mode' and 'restore partition'. I select the USB disk and the saved partition and select as target the newly created partition. The ony thing left is to make sure that the system is able to boot into the new partition. Then I exit clonezilla to a command line and enter

sudo upgrade-grub
sudo grub-install /dev/sda

Which installs the grub boot manager on your hard disk. If you have several hard disks, you may need to select another name than /dev/sda. You could also do that from a terminal windows of a live CD. Then the system should boot into a gub menu. You then need to select the correct disk and boot into the new image.

Login and modify network setup or create another user as required. Before rebooting, run the above grub commands again, to get rid of any left overs from the clonezilla or live CD.

It sound very complicated, but after having done this a few time, its very quick and definetly easier that reinstalling.

CatMan
  • 1,449
  • 1
  • 19
  • 48