Get to know it, because you'll be using it a LOT. I recommend the following reading list:
zypper reading list
- For starters, read Chapter 8. Managing Software with Command Line Tools of the openSUSE 11.4 Reference (for some unfathomable reason, this material was left out of the 12.2 Reference)
- Then, dive in even deeper if you dare: SDB:Zypper usage 12.2
- Also, don't forget to learn about the
rpm
command, because it has some listing functionality that is not duplicated inzypper
-- take a look, e.g., at "RPM basics: querying the package database" right here at Smithfarm - the Brain. - SDB:Vendor change update
/etc/zypp/zypp.conf
zypper cheat sheet
Frequently forgotten
zypper
commands:- zypper packages -i [REPO] (list all installed packages from REPO) Note on the 'i' and 'v' letters in the first column: the 'i' means "Installed", which is clear enough. The 'v' means "Another version installed", or in other words: multiple versions of this package are currently available from different repos _and_ a version from a different repo is installed. Note that this does not help if you want to list packages for which zypper shows the repo as "System Packages". In reality, these packages have no repo associated with them - i.e. they were installed from some repo that has since been removed.
- List packages not associated with any repo:
zypper se -s --installed|awk '/System Packages/ { print $3 }'
- Remove all packages not associated with any repo (note: make sure to run
zypper up
first!):zypper rm $(zypper se -s --installed|awk '/System Packages/ { print $3 }')
- zypper search -s [STRING] (search for packages matching STRING and show details such as 'i'/'v' letters explained above, version, and repository name)
- zypper search --requires [STRING] (list packages that require packages matching STRING)
- zypper search --recommends [STRING] (list packages that recommend packages matching STRING)
- zypper packages --orphaned (list packages that were installed from repos that have since been removed)
- zypper rm --clean-deps (remove a package or packages along with all dependencies of these packages that are no longer needed)
No comments:
Post a Comment