How To Install prunerepo on Fedora 34

prunerepo is Remove old packages from rpm-md repository

Introduction

In this tutorial we learn how to install prunerepo on Fedora 34.

What is prunerepo

RPM packages that have newer version available in that same repository are deleted from filesystem and the rpm-md metadata are recreated afterwards. If there is a source rpm for a deleted rpm (and they both share the same directory path), then the source rpm will be deleted as well. Support for specific repository structure (e.g. COPR) is also available making it possible to additionally remove build logs and whole build directories associated with a package. After deletion of obsoleted packages, the command “createrepo_c –database –update” is called to recreate the repository metadata.

We can use yum or dnf to install prunerepo on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install prunerepo.

Install prunerepo on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install prunerepo using dnf by running the following command:

sudo dnf -y install prunerepo

Install prunerepo on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install prunerepo using yum by running the following command:

sudo yum -y install prunerepo

How To Uninstall prunerepo on Fedora 34

To uninstall only the prunerepo package we can use the following command:

sudo dnf remove prunerepo

prunerepo Package Contents on Fedora 34

/usr/bin/prunerepo
/usr/lib/python3.9/site-packages/prunerepo
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info/PKG-INFO
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info/SOURCES.txt
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info/dependency_links.txt
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info/entry_points.txt
/usr/lib/python3.9/site-packages/prunerepo-1.21-py3.9.egg-info/top_level.txt
/usr/lib/python3.9/site-packages/prunerepo/__init__.py
/usr/lib/python3.9/site-packages/prunerepo/__pycache__
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/__init__.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/__init__.cpython-39.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/helpers.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/helpers.cpython-39.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/main.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/main.cpython-39.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/pair_srpm_rpm.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/prunerepo/__pycache__/pair_srpm_rpm.cpython-39.pyc
/usr/lib/python3.9/site-packages/prunerepo/helpers.py
/usr/lib/python3.9/site-packages/prunerepo/main.py
/usr/lib/python3.9/site-packages/prunerepo/pair_srpm_rpm.py
/usr/share/licenses/prunerepo
/usr/share/licenses/prunerepo/LICENSE
/usr/share/man/man1/prunerepo.1.gz
/usr/bin/prunerepo
/usr/lib/python3.9/site-packages/prunerepo-1.18-py3.9.egg-info
/usr/lib/python3.9/site-packages/prunerepo-1.18-py3.9.egg-info/PKG-INFO
/usr/lib/python3.9/site-packages/prunerepo-1.18-py3.9.egg-info/SOURCES.txt
/usr/lib/python3.9/site-packages/prunerepo-1.18-py3.9.egg-info/dependency_links.txt
/usr/lib/python3.9/site-packages/prunerepo-1.18-py3.9.egg-info/top_level.txt
/usr/share/licenses/prunerepo
/usr/share/licenses/prunerepo/LICENSE
/usr/share/man/man1/prunerepo.1.gz

References

Summary

In this tutorial we learn how to install prunerepo on Fedora 34 using yum and dnf.