I want to backup my list of manually selected packages in Ubuntu, without listing packages installed as dependencies. For example,
dpkg --get-selections
returns a complete list of all installed packages, manually selected as well as dependencies. How can I filter dependencies?
I hacked myself a solution :)
That will first generate a complete list "all" of installed packages, then a list "auto" of automatically installed ones, and finally create a list of differences from all and auto, which is the list I need.
Any better suggestions?
You could filter out the lib packages and manually filter the remaining ones. I don't think that there's a standard way to do this.
# ASSUMING your dpkg Logs go back to the initial machine install
###(May/Probablly NOT work across dist-upgrades)
Create a full dpkg timeline log Now Filer out the packages initially installed by the OSapt-mark showauto >/tmp/auto.pkgs
If you want a list of packages that are not marked as automatically installed (which is not always the same as not being a dependency), you can do this in a simpler way using
aptitude
like so:If you are really concerned with weeding out all dependencies, you can look into the
~R
and~D
search patterns. I thinkaptitude
is the currently recommended front-end to dpkg and apt. You will find that it has a number of really useful command-line options, in addition to the ncurses interface.