zypper options
This view focusses on packages. There are options to handle e.g. patches or repositories. That is not here.
show packages that can get installed
zypper list-updates
search for packages
zypper search
Search is a OR connection of all search words
You can use wildcards. ?
for one letter and *
for any number of letters.
get all options:
zypper search -help
search for an exact package name
zypper search --match-exact
search for already installed packages
zypper search --installed-only emacs
zypper search -i emacs
search only not installed packages
zypper search --not-installed-only emacs
zypper search -u emacs
search for more than one keyword with AND
zypper search for any of the given search terms, like a OR connection.
zypper search adobe font
gives for all results with adobe and all results with font.
To get a result where both terms have to be present like an AND operator seems not to be a function in zypper.
As a workaround you can combine the results of search terms with *
zypper search *adobe*font*
gives you all results with package names that start with that have adobe
in the name somewhere first and then after that fonts
somewhere. It does not give you results where fonts comes first and then adobe.
If that is not enough you could use regex.
search with regex
e.g.
sudo zypper search /lib.*Qt.*Chart/ /lib.*Qt.*Web/
clean the caches
zypper clean
Lock package version
- How to lock a Package version using zypper command
If you want to lock a certain package then you need to use the zypper al <package_name> command. In this example we are trying to lock gcc package using zypper al gcc command as shown below.
localhost:~ # zypper al gcc
localhost:~ # zypper addlock gcc
The specified lock has been successfully added.
- How to remove lock from a package Using zypper command
To remove the lock from a package you use the zypper rl <package_name> command. In this example we are removing lock from the gcc package.
localhost:~ # zypper rl gcc
localhost:~ # zypper removelock gcc
1 lock has been successfully removed.
- How to Check if there is a lock on any of the packages
If you want to check for a defined packages if there is a lock then you use the zypper ll command as shown below.
localhost:~ # zypper ll
localhost:~ # zypper locks