Problem using wildcard with apt

Recent versions of apt changed the way patterns are specified, and apt no longer supports regular expressions directly or wildcards, other than * for which support was restored in 2.1.0 and backported to 2.0.3.

You should now use

apt install '~nlibkf5.*'

with apt between 1.9.9 and 2.0.2, or the long form

apt install '?name(libkf5.*)'

available slightly earlier.

See the apt-patterns manpage (man apt-patterns) for details.


One can still use plain apt-get for such purpose.

For the OP's example it will look like

sudo apt-get install "libkf5*"


Ubuntu 20.04 introduced Apt 2.0

From the Release Notes:

New Features

  • Commands accepting package names now accept aptitude-style patterns. The syntax of patterns is mostly a subset of aptitude, see apt-patterns(7) for more details.

Incompatibilities

  • The apt(8) command no longer accepts regular expressions or wildcards as package arguments, use patterns (see New Features).

Tags:

Apt