Friday 12 April 2019

script - How to list manually installed software packages in Ubuntu?




Possible Duplicate:
How do you track which packages were installed on Ubuntu (Linux)?



Hello,


I'm using apt-get install to install various software on my PC. I have a handful of PCs that needs the same software packages installed all over them. How can I get list of software installed via apt-get install and the sequence in what the packages are installed. Okay, the sequence is not so important since the package manager resolves dependencies... I want to create a script that once run installs all needed software on the other PCs. All of these PCs are Ubuntu default installations. It is obvious that the packages list must not include all the packages that are installed trough a default installation :)


Also that list should not contain software installed via synaptic or dpkg if possible.



Answer



You can save a list of installed packages on the old machine with the command dpkg --get-selections > ~/packages and then restore it on the new one with sudo dpkg --set-selections < ~/packages && apt-get dselect-upgrade.


You shouldn't have to worry about the default install having a load of stuff already included, apt-get will look after everything for you.


You are going to end up with several text files called packages listing the packages that need installing on each machine. If you want you can add all these together and then get rid of duplicates using uniq, meaning that you would then have one set of packages to install rather than one set from each machine.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...