You can format your rpm
output using --qf
.
Query formats are modified versions of the standard printf(3) formatting. The format is made up of static strings (which may include standard C character escapes for newlines, tabs, and other special characters) and printf(3) type formatters. As rpm already knows the type to print, the type specifier must be omitted however, and replaced by the name of the header tag to be printed, enclosed by {} characters.
I took the egrep
out of your statement and used the formatting.
sudo rpm -qa --qf "Name\t : %{Name}\nVersion\t : %{Version}\nArchitecture: %{Arch}\nInstall Date: %{INSTALLTIME:date}\nVendor\t : %{Vendor}\nDescription : %{Description}\n\n"
Output
Name : vim-enhanced
Version : 7.4.629
Architecture: x86_64
Install Date: Tue 29 Oct 2019 02:53:20 PM UTC
Vendor : CentOS
Description : VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more. The
vim-enhanced package contains a version of VIM with extra, recently
introduced features like Python and Perl interpreters.
Install the vim-enhanced package if you'd like to use a version of the
VIM editor which includes recently added enhancements like
interpreters for the Python and Perl scripting languages. You'll also
need to install the vim-common package.
Name : wget
Version : 1.14
Architecture: x86_64
Install Date: Tue 29 Oct 2019 02:54:15 PM UTC
Vendor : CentOS
Description : GNU Wget is a file retrieval utility which can use either the HTTP or
FTP protocols. Wget features include the ability to work in the
background while you are logged out, recursive retrieval of
directories, file name wildcard matching, remote file timestamp
storage and comparison, use of Rest with FTP servers and Range with
HTTP servers to retrieve files over slow or unstable connections,
support for Proxy servers, and configurability.
Note: the formatting looks different in markup than it does on my screen.
Also note the egrep wasn't giving you a description because descriptions start on a new line.
And finally, descriptions can have spaces. This method will capture the full description.
You can see what tags are available using:
rpm --querytags
References