NapoleonTheCake NapoleonTheCake - 21 days ago 9
Linux Question

Wildcards exclude

I want to install all fonts from Ubuntu official repo. However, just using apt install font* will meet conflicts. So I need to somehow include all font* but exclude something like *-tail so package font-test will be installed but font-test-tail.

Thanks.

Answer

You can search for all font packages and filter as required and then use the resulting list for the install command:

# apt install $(apt-cache search font | grep '^font-' | grep -v '-tail$' | awk '{print $1}')

The above syntax works with bash.

Comments