I have Ubuntu WSL installed on two different Windows 10 accounts. I want to have the same packages installed in Acct-2 as I have in Acct-1. Is there an easy way? I have a complex way.
Asked
Active
Viewed 595 times
1 Answers
1
Here is my complex answer. Make sure that Acct-2 uses the same repositories as Acct-1. Create a list of packages from Acct-1 in a directory accessible to both Accounts, e.g. /mnt/c/WorkTemp and then remove the packages already installed in Acct-1. Install the remaining packages in Acct-2
Specifically, on Acct-1:
sudo apt-get update
sudo apt-get upgrade
aptitude search '~i!~M' | sort > /mnt/c/WorkTemp/aptitudelist-1
Do the same on Acct-2 piping into /mnt/c/WorkTemp/aptitudelist-2
comm -23 /mnt/c/WorkTemp/aptitudelist-{1,2} >/mnt/c/WorkTemp/pkglist
Review /mnt/c/WorkTemp/pkglist deleting the lines containing packages you don't want in Acct-2. Then in Acct-2:
sudo apt-get install $(tr -s ' ' </mnt/c/WorkTemp/pkglist |cut -d ' ' -f2)

Wes
- 179
- 1
- 9
-
This automatic parts of this answer only work well when the two wsl installations are the same version. For example, xenial and bionic changed enough so that I had to visually scan the package lists to determine the significant differences. – Wes Feb 21 '20 at 00:13
sudo apt install libreoffice
), and let Apt handle all the details. – user535733 Nov 09 '18 at 16:27