Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Install from file containing output from apt list –installed

I have a file that contains the output of apt list --installed from another machine.

i.e.

accountsservice-ubuntu-schemas/focal,focal,now 0.0.7+17.10.20170922-0ubuntu1 all [installed,automatic]
accountsservice/focal-updates,focal-security,now 0.6.55-0ubuntu12~20.04.5 amd64 [installed,automatic]
acl/focal,now 2.2.53-6 amd64 [installed,automatic]

…and so on.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is there an easy way to install these packages using the aforementioned file and the command line?

>Solution :

You can extract the part before the first / and use that with xargs to install via apt:

xargs -a <(awk -F/ '{print $1}' some-file) apt install

Or:

awk -F/ '{print $1}' some-file | xargs apt install -y
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading