Duplicate Your Installation On Another Computer

From PCLinuxOSHelp Knowledge Base
Jump to: navigation, search

Duplicate Your Installation On Another Computer

When you install PCLinuxOS on your newer computer, you will undoubtedly want to install from a more recent ISO or LiveCD/DVD/USB. All of your favorite programs probably aren't included on the base PCLinuxOS live media. Sure, you could remaster your current installation, but then you drag all of the old baggage from your current installation along with you, and deposit it on your new computer. And, undoubtedly and in any case, you will definitely have some "tuning" to do on your new computer.

Old-Polack has what might be the best solution to the issue.

Download all three files here.


I have three scripts that, used in the order given, do just what you ask for. The first is used on the original installation that you wish to duplicate.

-------------------------- start -------------------------
#!/bin/sh
# Name: genlist
# Author: Polack
# Script to generate an existing system's installed package list
# to aid in re-installation, and upgrade.
#

rpm -qa --qf '%{NAME}\t\tinstall\n' | sort |grep -v kernel |grep -v lib > ~/installed-packages.txt

exit

---------------------------- end ---------------------------

Running this results in a text file named installed-packages.txt in your HOME directory. Copy this to a USB flash drive for later use in the new installation. Note that it is in a form that can be used directly by Synaptic, but does not include any library or kernel packages.

The next script is basically the same script, but with a different output text file, to be used on the new installation, to list the initial base installation packages.

---------------------------- start ---------------------------
#!/bin/sh
# Name: newlist
# Author: Polack
# Purpose: Script to generate a base installed package list, from a new installation,
# to aid in re-installation, and upgrade.
#

rpm -qa --qf '%{NAME}\t\tinstall\n' | sort |grep -v kernel |grep -v lib > ~/new-installed.txt

exit

---------------------------- end -----------------------------

Copy the text file from the USB flash drive into the new installation's HOME directory so that both the installed-packages.txt and the new-installed.txt files are visible, side by side.

The last script is named difflist and generates another new file named to-install.txt, which can be used directly by Synaptic to add all the user installed packages from the original installation, without having to reinstall all the base installation included packages.

---------------------------- start ----------------------------
#!/bin/sh
# Name: difflist
# Author: Polack
# Purpose: Script to generate a package list containing
# only packages added to a default installation,
# to aid in re-installation, and upgrade.
#

diff -dHrN -- installed-packages.txt new-installed.txt |grep \< |sed "s/< //" > to-install.txt

exit

----------------------------- end -------------------------------

In Synaptic, after running the initial upgrade procedure, under File --> Read Markings... navigate to, and select, /home/<your username>/to-install.txt, then click Apply.

Copy the text of each of the scripts into the text editor of your choice, save each, with the appropriate name, into a /home/<your username>/bin directory (which you need to create, and will automatically be in your $PATH) and make each executable. When you copy the installed-packages.txt file to the USB flash drive, also copy your /home/<your username>/bin directory to the flash drive as well, to transfer both to the new installation.

Now, by following Old-Polack's directions precisely, and executing his custom bash scripts, you can have all of your favorite programs installed in one fell swoop.