Copy installed packages between Ubuntu Linux

Submitted by slackstone on Wed, 11/24/2021 - 13:15

It can be useful to quickly copy an installed package list from one server to another.  When standing up a new development virtual box, you can use "apt-clone" to move over all your installed system packages.  

1) From the configured box:
> sudo apt-get install apt-clone
> sudo apt-clone clone ubuntu_host_clone
This step creates a zipped package list

2) copy the package list to new box
> scp ubuntu_host_clone.tar.gz user@new_VM:

3) restore the clone
> sudo apt-clone restore ubuntu_host_clone.tar.gz

After cloning, some installed packages may need to be reinitialized. 
Example, phpmyadmin.
>  sudo dpkg-reconfigure phpmyadmin

(attached Image: Files included in apt-clone tar.gz package)