Those patterns are not regexps, they're commonly referred to as glob patterns.
And in no case will the shell correctly expand glob patterns for package names
to be used with apt-get. Shells will only expand glob patterns based on files
that are present on your local file system.
The other shells that you've used also fail to expand that pattern, but rather
than reporting an error they pass on the argument as typed to apt-get which
then is able to match the pattern itself and do so against the names of
available packages. You can get that behavior from zsh by using:
But it would be better to get used to quoting special characters like
you do not want those patterns to be expanded by the shell. If you happened to
have a file which matched that pattern in your current directory when running
that command any of those shells would expand the pattern to match that file
before running apt-get, this is unlikely to give the results that you are
Any of the following would work in any of those shells, even if you have files
which match the pattern:
sudo apt-get install llvm-3.1\*
sudo apt-get install 'llvm-3.1*'
sudo apt-get install "llvm-3.1*"
That would prevent the shell from trying to incorrectly expand the pattern, and
for zsh it will avoid the error message if the pattern cannot be expanded.