Similar to the zypper cheat sheet is there a reference for equivalent rpm and zypper commands?
For example, if i run the command
rpm -qi psmisc
it returns the following information
Name : psmisc
Version : 23.0
Release : lp150.4.3.1
Architecture: x86_64
Install Date: Fri 23 Nov 2018 03:58:43 AM EST
Group : System/Monitoring
Size : 155658
License : GPL-2.0-or-later
Signature : RSA/SHA256, Fri 18 May 2018 03:02:58 PM EDT, Key ID b88b2fd43dbdc284
Source RPM : psmisc-23.0-lp150.4.3.1.src.rpm
Build Date : Fri 18 May 2018 03:02:45 PM EDT
Build Host : cloud137
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE
URL : https://gitlab.com/psmisc/psmisc/
Summary : Utilities for managing processes on your system
Description :
The psmisc package contains utilities for managing processes on your
system: pstree, killall and fuser. The pstree command displays a tree
structure of all of the running processes on your system. The killall
command sends a specified signal (SIGTERM if nothing is specified) to
processes identified by name. The fuser command identifies the PIDs of
processes that are using specified files or filesystems.
Distribution: openSUSE Leap 15.0
If i run the command
zypper info psmisc
, it returns the following details;
Repository : openSUSE-Leap-15.0-Update
Name : psmisc
Version : 23.0-lp150.4.6.1
Arch : x86_64
Vendor : openSUSE
Installed Size : 152.0 KiB
Installed : Yes (automatically)
Status : out-of-date (version 23.0-lp150.4.3.1 installed)
Source package : psmisc-23.0-lp150.4.6.1.src
Summary : Utilities for managing processes on your system
Description :
The psmisc package contains utilities for managing processes on your
system: pstree, killall and fuser. The pstree command displays a tree
structure of all of the running processes on your system. The killall
command sends a specified signal (SIGTERM if nothing is specified) to
processes identified by name. The fuser command identifies the PIDs of
processes that are using specified files or filesystems.
Comparatively it doesn’t display the same information. For example, in the latter it includes “Release”, “Group”, “Signature”, etc.
Why does the zypper command display less information?
The rpm and zypper commands are no equivalents of each other. Each exists and have there own use.
The rpm command is more spread and used by several distros. It is about the packages also called RPMs and how to create, manage, install, … them.
On openSUSE there is software zypplib that works with RPMs, repositories, a database of installed packages, dependancies of packages, etc. The system managers interfaces to zypplib are zypper and YaST > Software.
Thus you can e.g. install an RPM using rpm, but then that will be inknown by the zypplib environment.
You can install an RPM using zypper and that will drwa in automaticaly dependent packages and will be registered in the zypplib environment.
Depending on what you want to know from a package you can use the tool that fits best your requirement. Be glad that you have choice. When both zypper and rpm would provide exactly the same output on a package inspection, one of them would be superfluous.
Thanks hcvv. While i understand that the the commands may have discrete use cases, there appears to be a common set of outputs. I am interested in learning the collection of common outputs so that i can leverage a single command as much as possible and only defer to another command such as rpm when it is absolutely necessary.
Well, read the man pages, experiment by creating several output combinations with both tools and compare. I assume that is what most people do. When they need some information they will consult the man pages of the relevant tools (aend of course it is important to know what tools exist!), do some trial output and then decide what they are going to use for a particular purpose.
I e.g. on a regular base, make a list of installed packages with
rpm -qa --qf '%{NAME}:%{VERSION}:%{RELEASE}:%{INSTALLTID}:%{SUMMARY}
' | sort | while IFS=':' read NAM VER REL DAT SUM
and then use those parameters to construct an HTML table.
This works already for more then 10 years on all RPM based distros.