Duplicating app installs between systems
A simple way to duplicate apps installed on one Linux system onto another.
Recently I built a new PC which meant moving a bunch of system settings and duplicating installed apps over to that new system.
This was actually a lot less painful that it could have been, especially when it came to duplicating installed apps. So to save others the hassle of having to find multiple different SO threads or even reading manuals I've gone ahead and set out instructions below on what is needed (well what I used, I'm sure there is an even easier method).
Duplicating installed apps
List all installed apps and output to file on old system
sudo apt list --installed >> parent_installed_apps.txtList all installed apps and output to file on new system
sudo apt list --installed >> child_installed_apps.txtCopy parent_installed_apps.txt to new system, same folder as previous file
Compare and strip duplicates and put in new file
grep -vf parent_installed_apps.txt child_installed_apps.txt > apt_diff.txtStrip versions and branch from apt list, everything after the first /
awk -F'/' '{print $1}' apt_diff.txt >> app_diff.txtInstall apps line by line
cat apt_diff.txt | xargs sudo apt install -yesReboot system
I hope this helps someone else.