Duplicating app installs between systems
Posted on Nov 28, 2020
Intro
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.txt
- List all installed apps and output to file on new system
sudo apt list --installed >> child_installed_apps.txt
- Copy 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.txt
- Strip versions and branch from apt list, everything after the first /
awk -F'/' '{print $1}' apt_diff.txt >> app_diff.txt
- Install apps line by line
cat apt_diff.txt | xargs sudo apt install -yes
- Reboot system
I hope this helps someone else.