Say I want to install all the ubuntu-wallpapers
packages, so I would enter the following at the terminal:
sudo apt install ubuntu-wallpapers*
I am trying to get the same effect using
dpkg --set-selections < ./pkgs.txt
The problem is, this method does not support the *
wildcard in the pkgs.txt
file.
i was able to get the exact list of packages using
apt-cache search ^ubuntu-wallpapers
but I get the descriptions too. Is there a way to get only the package names so I can redirect the output to the pkgs.txt
file?
Best Answer
You can use
apt-cache pkgnames
to list only the names of all packages starting with a specific prefix:See
man apt-cache
for more info.Alternatively, you could process the output of
apt-cache search
and display only the first column by piping it e.g. through one of these commands below or anything similar: