I was trying to install all python packages using sudo apt install python3*, but it gave me this error:

newtron@newtron:~$ sudo apt install python3*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3*
  • 6
    I think you are fortunate it failed. Had it worked, it would have installed over 5400 packages.
    – user535733
    Commented Apr 30, 2020 at 13:41
  • thank you for suggestion Commented Apr 30, 2020 at 13:58

2 Answers 2


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.


  • The apt(8) command no longer accepts regular expressions or wildcards as package arguments, use patterns (see New Features).
  • 3
    so what is the replacement or alternative for it. Commented Apr 30, 2020 at 14:02
  • 1
    Replacement: "mostly a subset of aptitude, see apt-patterns(7) for more details"
    – user535733
    Commented Apr 30, 2020 at 15:11
  • @NewtronMalayalam The closer I can see is the regex pattern for package names. For example if you have multiple kernel installed, and you want to remove in one command everything related to a particular version, you can use sudo apt autoremove --purge ~n.*5.6.10.* You can see the .* regular regex. I like this new approach a lot, it's way more flexibile once you get it! Commented May 21, 2020 at 7:08
  • apt-get works with * Commented Sep 17, 2020 at 7:34

I have reported this as bug to launchpad - https://bugs.launchpad.net/bugs/1860366 against Ubuntu 20.04 LTS.

You can still use apt-get for this purpose:

sudo apt-get install "python3*"

will do what you (and really me) want. We need to change our habits here.


Not the answer you're looking for? Browse other questions tagged .