Thought I might as well make a thread.
Scenario: formatting & reloading each time a new distro comes out.
- need to save packages installed.
apt-cache --installed pkgnames > installed.packages.lst
Save the installed.packages.lst somewhere safe, i.e a thumbstick or usb drive - need to install packages on new installation
sudo apt-get install cat installed.packages.lst
As suggested via Skype, rather do dist upgrades, but before you do, clone your linux so you can always revert back. I like to use DD.
How to create an image of your linux partition: (without compression)
dd if=/dev/sda4 of=28-05-2014.img bs=64K
Explanation:
IF is the input, look at your partitions and check where your / mount point is (root)
OF is the output, in this case we are just simply creating an output to the current directory we are in.
Adjust these as required
BS is just the block size.
*note you can change the path of the output to send the img to a usb drive.
restoring the image due to a failed dist-upgrade
Boot from a linux live CD/DVD then open the terminal/konsole
dd if=28-05-2014.img of=/dev/sda4 bs=64K
*note you can change the path of the input to look at the img on the usb drive.
If you wish to make an image but compress it you can do the following:
dd if=/dev/sda4 bs=64K | gzip -c > 28-05-2014.img
to restore the image (boot from live cd/dvd again):
gunzip -c 28-04-2014.img.gz | dd of=/dev/sda4 bs=64K
Note: I’m using dd here only to clone partitions, if you wish to clone the entire hard drive you would use /dev/hda or /dev/hdb depending on your install.
Upgrading your distro, use the three commands in order:
Sudo apt-get update
Sudo apt-get upgrade
Sudo apt-get dist-upgrade
@Arby can correct me if I’m wrong here, he’s the nix guru.