Revision of Cloning a system - or: How to make a copy of installed packages from one computer to another from Fri, 01/06/2017 - 11:10
The revisions let you track differences between multiple versions of a post.
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.
To export the list of packages installed on the system to clone:
- launch the "Synaptic Package Manager" (in the "System Settings") and enter your password;
- click on "Save Markings" in the "File" menu;
- choose where to save the list of installed packages and a name for that file;
- 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. If the two systems have different architectures (32 bits and 64 bits), only the /var/cache/apt/archives/*_all.deb files, which are the same on both architectures, should be copied.
Again, this can be achieved through a (large-enough) removable device or through SSH or... Administrative rights are required to write in "/var/cache/apt". 'sudo' grants them if you want to do the copy from a terminal ('sudo cp' if the files are on a removable device, 'sudo scp' to copy through SSH). To do the same graphically, open a file browser by executing the following command in a terminal:
$ gksu nautilus
To install the same packages on the fresh Trisquel:
- launch the "Synaptic Package Manager" (in the "System Settings") and enter your password;
- click on "Read Markings..." in the "File" menu;
- open the list of packages you have just transfered;
- 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 the eponymous tool 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.