5

I want to install to PC2 all the packages, that were installed by apt install on PC1. That is for Debian, but i think that since Debian and Ubuntu share same package system - the solution would be same. How to do that?

xakepp35
  • 325

1 Answers1

5

First, make sure that /etc/apt/sources.list and /etc/apt/sources.list.d on PC2 are equal to those on PC1.

Then, on PC1, do

dpkg --get-selections > installed-packages
apt-key exportall > repo-keys

Transfer the files installed-packages and repo-keys to PC2, and do

sudo apt-get install dselect
sudo apt-key add repo-keys
sudo dpkg --set-selections < installed-packages
sudo apt-get dselect-upgrade -y

If you don't have any packages installed from PPA's you can skip the repo-keys commands.

Disclaimer: this used to work a few years ago, I haven't had the need to try it recently.

Jos
  • 30,529
  • 8
  • 89
  • 96