Cloning a system - or: How to make a copy of installed packages from one computer to another

To set up a new Trisquel system that would have the same applications as an existing Trisquel system, one does not need to manually select the same list of packages and to download them again. This manual explains how to save time and bandwidth. It is, in fact, not specific to Trisquel: it applies to any Debian derivative where the "Synaptic Package Manager" is (or can be) installed.

On the system to clone, to export the list of packages installed:

  1. launch the "Synaptic Package Manager" (in the "System Settings") and enter your password;
  2. click on "Save Markings" in the "File" menu;
  3. choose where to save the list of installed packages and a name for that file;
  4. click, at the bottom of the window, the box that says "Save full state, not only changes" and, finally, the "Save" button.

That file must now end up on the new system, where Trisquel was freshly installed. To do so, you can use a removable device (such as a USB key), SSH (an SSH server must then be installed on one of the two systems) or any other mean.

Many, if not all, the DEB packages that relate to this list are in the "/var/cache/apt" directory of the system to clone. There is no need to download them again: the "/var/cache/apt" directory can be copied to the analog directory in the fresh installation. However, if the two systems have different architectures, then only the /var/cache/apt/archives/*_all.deb files should be copied (architecture-dependent packages will be downloaded from Trisquel's repository). Also, if some packages come from external repositories (e.g., PPAs), the content of the "/etc/apt" directory needs to be copied to the analog directory in the fresh installation.

Again, all this can be achieved through a (large-enough) removable device or through SSH or... Administrative rights are required to write in "/var/cache/apt" or in "/etc/apt". In a terminal, 'sudo' grants them ('sudo cp' if the files are on a removable device, 'sudo scp' from a remote terminal).

Finally, to actually install the packages on the fresh Trisquel:

  1. launch the "Synaptic Package Manager" (in the "System Settings") and enter your password;
  2. click on "Read Markings..." in the "File" menu;
  3. open the list of packages you have transfered;
  4. click the "Apply" button and confirm.

To copy user files (e.g., the personal configuration for the applications, i.e., the hidden files and directories in the home folder, whose names start with a dot), any mean can be employed. However, one should regularly backup user files, e.g., using Back In Time in the "System Settings". The files can then be restored from the backup onto the fresh install. A warning may be displayed to indicate that the system is different from the one used to backup.

Revisions

10/13/2016 - 15:10
GNUbahn
10/13/2016 - 18:29
Magic Banana
09/20/2024 - 20:15
knife