In this article, we will see how to install rpm on Ubuntu/Debian. rpm is a free and open source package management utility in Linux. It is mostly used for installing and managing rpm packages on Fedora, CentOS, RHEL based systems and very rarely or uncommonly used on debian or ubuntu based systems. Except in few cases, it is best recommended not to use rpm utility to install rpm packages on Ubuntu or Debian based systems. However there might be specific scenarios where using RPM could be considered. We will see all those scenarios in a moment. Nevertheless, it is quite easy to install and use rpm on Ubuntu or debian systems, just like on RHEL, CentOS, Fedora based systems.
Although there might be a need to install rpm package but at the same time it is important to understand all the risks involved in following this approach and the caution you need to take:-
Also Read: How to Install aptitude on Ubuntu 22.04
a) You should have a running Ubuntu/Debian
Server. In our case, we are using Ubuntu 22.04 LTS (Jammy Jellyfish)
Server.
b) You should have sudo
or root
access to run privileged commands.
c) You should have apt
or apt-get
utility available in your Server.
Like everytime before installing any new packages, we first check for all the available updates and install them, this time also we have to do the same. Always look for all the latest security fixes and updates available and install them by using sudo apt update && sudo apt upgrade
command before installing rpm utility in your system.
cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:3 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:6 https://ngrok-agent.s3.amazonaws.com buster InRelease
Hit:7 https://ppa.launchpadcontent.net/libreoffice/ppa/ubuntu jammy InRelease
Hit:8 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:9 https://ppa.launchpadcontent.net/unit193/encryption/ubuntu jammy InRelease
Fetched 229 kB in 5s (45.8 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Also Read
You can then install rpm from default Ubuntu repo by using sudo apt install rpm
command as shown below. This will download and install rpm package along with all its dependencies.
cyberithub@ubuntu:~$ sudo apt install rpm [sudo] password for cyberithub: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: debugedit libfsverity0 librpm9 librpmbuild9 librpmio9 librpmsign9 rpm-common rpm2cpio Suggested packages: alien elfutils rpmlint rpm-i18n The following NEW packages will be installed: debugedit libfsverity0 librpm9 librpmbuild9 librpmio9 librpmsign9 rpm rpm-common rpm2cpio 0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. Need to get 626 kB of archives. After this operation, 2,398 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 debugedit amd64 1:5.0-4build1 [47.2 kB] Get:2 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 libfsverity0 amd64 1.4-1~exp1build1 [10.4 kB] Get:3 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 librpmio9 amd64 4.17.0+dfsg1-4build1 [93.2 kB] Get:4 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 librpm9 amd64 4.17.0+dfsg1-4build1 [189 kB] Get:5 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 librpmbuild9 amd64 4.17.0+dfsg1-4build1 [80.3 kB] Get:6 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 librpmsign9 amd64 4.17.0+dfsg1-4build1 [11.7 kB] Get:7 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 rpm-common amd64 4.17.0+dfsg1-4build1 [33.7 kB] Get:8 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 rpm2cpio amd64 4.17.0+dfsg1-4build1 [9,882 B] Get:9 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 rpm amd64 4.17.0+dfsg1-4build1 [151 kB] ...............................................................
After successful installation, you can check the current installed version by using rpm --version
command as shown below.
cyberithub@ubuntu:~$ rpm --version RPM version 4.17.0
Also Read
You can also check the installation status by running dpkg -s rpm
command as shown below. Check more about dpkg on 21+ Practical dpkg Command Examples for Linux Beginners.
cyberithub@ubuntu:~$ dpkg -s rpm Package: rpm Status: install ok installed Priority: optional Section: admin Installed-Size: 494 Maintainer: Ubuntu Developers Architecture: amd64 Version: 4.17.0+dfsg1-4build1 Depends: libc6 (>= 2.34), libelf1 (>= 0.131), libpopt0 (>= 1.14), librpm9 (>= 4.16), librpmbuild9 (>= 4.17.0+dfsg1), librpmio9 (>= 4.14.0+dfsg1), librpmsign9 (>= 4.17.0+dfsg1), perl:any, rpm2cpio, debugedit (>= 1:5), rpm-common (= 4.17.0+dfsg1-4build1) Suggests: alien, python3, elfutils, rpmlint, rpm-i18n Description: package manager for RPM The RPM Package Manager (RPM) is a command-line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. . On Debian and derived systems it is recommended to use "alien" to convert RPM packages into .deb format instead of bypassing the Debian package management system by installing them directly with rpm. Original-Maintainer: RPM packaging team Homepage: https://rpm.org/
To explore all the other options available with rpm utility, use rpm --help
command as shown below.
cyberithub@ubuntu:~$ rpm --help
Usage: rpm [OPTION...]
Query/Verify package selection options:
-a, --all query/verify all packages
-f, --file query/verify package(s) owning file
-g, --group query/verify package(s) in group
-p, --package query/verify a package file
--pkgid query/verify package(s) with package identifier
--hdrid query/verify package(s) with header identifier
--triggeredby query the package(s) triggered by the package
--whatconflicts query/verify the package(s) which require a dependency
--whatrequires query/verify the package(s) which require a dependency
--whatobsoletes query/verify the package(s) which obsolete a dependency
..................................................
After using rpm package management tool, you can choose to remove it from your system by using sudo apt remove rpm
command as shown below. To remove all dependencies all with the package, use --auto-remove
option with below command.
cyberithub@ubuntu:~$ sudo apt remove rpm [sudo] password for cyberithub: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: debugedit libfsverity0 librpmbuild9 librpmsign9 Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: rpm 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 506 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 238206 files and directories currently installed.) Removing rpm (4.17.0+dfsg1-4build1) ... Processing triggers for man-db (2.10.2-1) ...
One of the most critical gaps in traditional Large Language Models (LLMs) is that they…
Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…
What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…
Wouldn’t it be wonderful to wake up one day with a desire to explore AI…
Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…
Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…