1

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.

Wes
  • 179
  • 2
  • 10

1 Answers1

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
  • 2
  • 10