mikeinSantaRosa
mikeinSantaRosa

Reputation: 33

how can a feed a file list into dpkg --get?

I can use dpkg --get-selections | grep -v deinstall | cut -f 1 | tr '\n' ' ' > listpackages.txt

to fill a file with all my installed packages.

Is there a to install using dpkg or apt and reference the listpackages.txt file created above?

I want to be able to backup what I have installed as a package list, reinstall my distro and finally in one command install everything I had installed on the previous version.

-thanks u2!

Upvotes: 0

Views: 1701

Answers (2)

Michael Trausch
Michael Trausch

Reputation: 3165

Use the --set-selections flag to do this.

To export the package list from one system: dpkg --get-selections followed by whatever filtering you want.

To re-import the list to another system, pipe it into dpkg --set-selections, and then run aptitude install. The dpkg --set-selections command will only queue the install process; you then actually have to execute it.

Upvotes: 1

wRAR
wRAR

Reputation: 25560

apt-get install `cat listpackages.txt`

Upvotes: 1

Related Questions