When I run this command :
apt install libkf5*
I get the following error :
Unable to locate package libkf5*
I'm sure that the packages whose names start with libkf5
exist (tab-completion says so) . So the problem is not about the absence of those packages.(Note the asterisk at the end of that error message , the wildcard's not working at all)
I use apt
v.1.9.
Thanks in advance.
Recent versions of
apt
changed the way patterns are specified, andapt
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
with apt between 1.9.9 and 2.0.2, or the long form
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*"
Per the changelog of apt, version 2.1.0:
(Link: Launchpad #1872200)
The asterisk (and only asterisk) has been restored for all
apt
subcommands, includingapt install
.While 2.1.0 is too new to be shipped to Focal, it's been backported to 2.0.3 which is available in the
focal-proposed
repository. You can refer to the Ubuntu Wiki for enabling the Proposed repository, and then you can install apt 2.0.3 which has this feature backported.See for yourself:
Note: You may want to read What is the "proposed" repository? before proceeding with the Proposed repository.
Ubuntu 20.04 introduced Apt 2.0
From the Release Notes:
I found a small trick to use
apt
with wildcard. We just need to aliasapt
withapt-get
, but this method doesn't work because aliases are not passed tosudo
. To pass out this problem, you can add an second alias forsudo
in your.bashrc
file:Credits:
apt install "*" method in Ubuntu 20.04 does not work
How to pass alias through sudo