I am developing C++ on my Linux (Ubuntu) machine and I have installed many libraries both by using apt-get and installing from source. Lets say I would like to recreate my environment on another (freshly installed) Linux machine (same version / same distribution), so I don't have to type all sudo apt-get install and sudo make install etc.

Is there a way to get a snapshot of all my install libraries and copy it to another machine?

  • 2
    This would require you copy every library you want to migrate, then create folder structures on the other machine manually, you would spend more time doing that then installing them with apt-get and make install.
    – Ramhound
    Aug 27, 2018 at 15:18
  • 1
    Today we have to treat systems like cattle and not pets. @santosh's answer is useful but you need to ensure that you have a profile of the whole system. Generally, you want to use automation and scripts to create and manage your systems so that you can easily re-create an environment.
    – Hogstrom
    Aug 27, 2018 at 15:49
  • @Hogstrom Is there is an opensource tool for automation of system creation/install in Linux?
    – motam79
    Aug 27, 2018 at 15:51
  • 1
    Chef and Puppet come to mind as does Ansible as tools. I'm not sure of a macro tool but others probably have other ideas.
    – Hogstrom
    Aug 27, 2018 at 19:48

1 Answer 1


Managing a packages like rpm and libraries is very important in all the distribution of Linux. There are two ways to copy the packages from one System to another.

  1. You can create File of current list of Softwares as below:
    rpm -qa > installed-software.txt
    Copy the above file into new Server: If the both machines are of Same Distros: we can do the below in Ubuntu Distros:
    apt-get -y install $(cat /home/user/installed-software.txt)

  2. On Systems using apt or Debian and derivatives like ubuntu, mint...
    sudo apt-get install apt-clone
    apt-clone clone installedsoftware

tar that file using tar -cvzf installedsoftware.tar.gz installedsoftware and copy this installedsoftware to new machine.

sudo apt-get install apt-clone
sudo apt-clone restore installedsoftware.tar.gz


Thanks Santosh G.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .