I have:

~$ dpkg -l | grep -i nvidia
rc  libnvidia-compute-396:i386  396.54-0ubuntu0~gpu18.04.1  i386 NVIDIA libcompute package

When I do:

~$ sudo apt-get remove --purge libnvidia-*

this package is not removed?

Other "libnvidia" package is removed with this command, this one for example:

rc  libnvidia-compute-390:amd64   390.48-0ubuntu3      amd64  NVIDIA libcompute package

In the remove log it says:

Package 'libnvidia-compute-396' is not installed, so not removed. Did you mean 'libnvidia-compute-396:i386'?

And when I remove it with full name it gets removed.


Apt (or, rather dpkg) operates on the default architecture by, well, default. From the output it looks like i386 is not your default architecture, so you have to specify it. For example, see the Debian Multiarch HOWTO, which shows you have to specify the foreign architecture for both installing and removing such packages.

You could do:

sudo apt-get remove --purge 'libnvidia-.*:i386'

(Note that apt doesn't use wildcards, but regex. See apt-get remove with wildcard removed way more than expected. why?)

  • I was following this answer: askubuntu.com/a/206289/754424. It looks like the answer should really state "sudo apt-get remove --purge nvidia-.*" instead of "sudo apt-get remove --purge nvidia-*"? Note the dot before *. – croraf Nov 17 '18 at 11:58
  • 1
    The way it works is, apt matches across the full package name - so if you wanted to remove all packages that had nvidia anywhere in the package name, that still works (because the regex -* matches the empty string as well). So that particular mistake might be harmless, but still worth fixing. – user894115 Nov 17 '18 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.