linuxmint / mintsystem

https://www.linuxmint.com
53 stars 34 forks source link

Linux Mint 20: apt is not working with * symbol #114

Closed kelebek333 closed 4 years ago

kelebek333 commented 4 years ago

Hi,

apt is not working with * symbol.

sudo apt purge nvidia-prime*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package nvidia-prime*

but apt-get is working.

sudo apt-get purge nvidia-prime*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'nvidia-prime' for glob 'nvidia-prime*'
Note, selecting 'nvidia-prime-applet' for glob 'nvidia-prime*'
The following packages will be REMOVED:
  nvidia-prime* nvidia-prime-applet*
0 upgraded, 0 newly installed, 2 to remove and 58 not upgraded.
After this operation, 104 kB disk space will be freed.
Do you want to continue? [Y/n]
xenopeek commented 4 years ago

Linux Mint's apt uses /usr/bin/apt for package installs and removals. From /usr/bin/apt version 2.0, which is used on Linux Mint 20/Ubuntu 20.04 LTS, wildcards like nvidia-prime* are not supported and instead it uses aptitude style patterns like ~n^nvidia-prime for the same. This is a contentious change and upstream is reverting the removal of wildcards: https://lists.debian.org/deity/2020/03/msg00055.html

For your example the syntax would be: apt purge '~n^nvidia-prime'. Meaning, purge all packages with name (~n) starting (^) with nvidia-prime. BTW you don't need to use sudo with apt.

xenopeek commented 4 years ago

/usr/bin/apt not supporting wildcards is a change upstream is reverting. Meanwhile as you say you can still use apt-get with wildcards. /usr/bin/apt now uses aptitude style patterns and with #118 that now works correctly in apt.