0

How do I get a list of all installed packages with the .rpm extension?

I am testing this on a Fedora 28.

2

You can use a query format, eliminating the sed and the temporary file.

rpm --queryformat "%{name}-%{version}-%{release}.%{arch}.rpm\n" -qa

Example output:

python3-decorator-4.3.0-2.fc30.noarch.rpm
webkit2gtk3-2.24.2-1.fc30.x86_64.rpm
tuned-2.11.0-1.fc30.noarch.rpm
nftables-0.9.0-5.fc30.x86_64.rpm
perl-encoding-2.22-10.fc30.x86_64.rpm
0

First:

rpm -qa > INSTALLED_PACKAGES

I found that I can append .rpm as SUFFIX to each line in the INSTALLED_PACKAGES file

sed 's/$/.rpm/' INSTALLED_PACKAGES

this way I have the extension.

Result:

librados2-12.2.12-1.fc28.x86_64.rpm
dconf-0.28.0-1.fc28.x86_64.rpm
abrt-addon-ccpp-2.10.10-1.fc28.x86_64.rpm
claws-mail-plugins-vcalendar-3.16.0-1.fc28.x86_64.rpm
python3-firewall-0.5.5-1.fc28.noarch.rpm
dhcping-1.2-19.fc28.x86_64.rpm
xorg-x11-server-common-1.19.6-10.fc28.x86_64.rpm
NetworkManager-l2tp-1.2.12-1.fc28.x86_64.rpm
perl-HTML-Parser-3.72-11.fc28.x86_64.rpm
shared-mime-info-1.10-1.fc28.x86_64.rpm
libblockdev-lvm-2.16-2.fc28.x86_64.rpm
xfce4-power-manager-1.6.1-2.fc28.x86_64.rpm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.