- What is RPM and how do I use it?
- What is RPM?
- Why do people use it?
- How can you use it?
- Install
- Upgrade
- Remove RPM Package
- Query Package Information After Installing
- Query RPM Package Information Before Installing
- List Documentation of Installed RPM Package
- Verify RPM Package
- RPM vs. Packagecloud
- Unified Environment
- Highly Compatible
- Support & Great Documentation
- Wrapping up
- Set up your own package repository.
- How to Use RPM Command in Linux
- 1: What is the RPM Command
- 2: RPM Command Syntax
- 3: RPM Command Options
- 4: Install RPM Packages
- 5: Upgrade RPM Packages
- 6: Remove RPM Packages
- 7: List Installed RPM Packages
- 8: Display Package Information Before Installing
- 9: Display Package Information After Installing
- 10: Check RPM Package Dependencies Before Installing
- 11: List All Files of an Installed Package
- 12: RPM Command in Different Linux Distros
- RPM Package Management in Red Hat-Based Systems
- RPM Package Management in Debian-Based Systems
- RPM Package Management in Arch-Based Systems
- Conclusion
- About the author
- Kashif
What is RPM and how do I use it?
Linux is one of the most popular operating systems. It powers numerous corporate servers and personal desktops. Among many, what makes their ecosystem strong is their package management systems. Those systems allow you to have access to a vast amount of packages.
Using them, people can easily install and use that software. RPM is one of the management software that provides that functionality. In this article, we will learn what RPM is and how you can use it.
But, before we start, check what you can achieve with Packagecloud. Packagecloud helps users to manage packages. People can deploy to any environment from our intuitive interface, on-premise, or in the cloud.
What is RPM?
RPM stands for Red Hat Package Manager. It is a free and open-source package management system. The name, RPM, was derived from the .rpm file format. The manager was designed to be used for Linux distributions. Initially, it was made to be used in Red Hat Linux. Now, it’s widely used in other Linux distributions including Fedora, CentOS, OpenSUSE, OpenMandriva, and Oracle Linux. Most RPM files are binary with the compiled version of the software.
RPMs are centrally stored in one or more repositories on the Internet. A repo location has its own RPM repositories that either act as local mirrors of those Internet repositories or collections of RPMs that are locally maintained.
Why do people use it?
RPM provides a good range of convenient features for package management. Let’s have a look at the major benefits of using it:
- RPM is easy and simple to use. It allows users to experience the simplest installation experience for Linux.
- RPM files are pre-built according to machines and Linux distributions. This dramatically reduces a change of compatibility error while installing.
- PRM packages become globally recognizable. If you manually download and install a package into /usr/local/, chances are other software cannot use it.
- When you remove a package using RPM, you can get rid of it cleanly with almost no remaining trace. When you uninstall, it automatically checks dependencies and removes the package safely.
- RPM is known for enhanced security. When you install packages using RPM, it writes records into a database that keeps track of detailed information about your packages. If something is found to be suspicious, you can refer to the database. This also makes debugging easy.
How can you use it?
Now, let’s find out how you can actually use it. Before you start to use RPM, you’ll probably have a package you want to install already.
Before you use the commands, make sure you gain the sudo permission.
Install
To install the dummy.rpm file, you can execute the following command:
$ rpm -i [package_file_name].rpm
Upgrade
If you want to upgrade the version of an existing package, in this case, dummy_v11, run the following command:
$ rpm -U [package_file_name].rpm
Remove RPM Package
To uninstall a package, you need to use a package name instead of the full RPM file name. By adding more package names, you can remove multiple packages in one command.
$ rpm -e [package_name] [another package_name. ]
Here, -e option means erase . For your information, you can add an option, —nodeps, in the command to forcefully remove the rpm package without checking its dependencies. However, unless it is absolutely necessary, it is not recommended since it can break other applications.
Let’s check further useful commands to retrieve rpm package information.
Query Package Information After Installing
After you install an RPM package, you can check more information in detail about the package. -qi stands for query info.
Query RPM Package Information Before Installing
You can even check package info before you install it. This command below will print out the information.
List Documentation of Installed RPM Package
You can list available documentation of an install package. Use an option, -qdf (query document file).
$ rpm -qdf /usr/bin/[package_name]
Verify RPM Package
To verify an installed RPM package, try the command below.
$ rpm -Vp sqlbuddy-1.3.3-1.noarch.rpm
RPM vs. Packagecloud
We have learned how we can use RPM. The package management tool, as we could see, offers ways to efficiently manage Linux packages. However, when you start scaling up your servers and having different Linux distributions, using RPM alone will not be enough. You will need a scalable solution to manage packages for many servers that can have other package management tools other than RPM. This section will give you a good opportunity to see how Packagecloud can help you to manage packages in a scalable way.
Unified Environment
When you use RPM in a server, it applies to that server only. To repeat it all across your servers, it will be extremely time-consuming. In contrast, Packagecloud provides a way that can deliver the packages you wrote to any infrastructure in a unified environment. You can easily create your own repositories and let each server install your packages via Packagecloud’s CLI or API.
Highly Compatible
Although you can use RPM in many different Linux distributions, there still are operating systems that aren’t RPM-based. However, Packagecloud provides both CLI and API to interact with your repositories in virtually all distributions using any of the mainstream programming languages.
Support & Great Documentation
One big difference between a paid service and an open source is the quality of support and documentation. Packagecloud maintains clean and up-to-date documentation that helps users to easily browse APIs and CLI commands. Also, Packagecloud opens supporting channels (including Advisory Services ) wide open for its users. They have a Slack channel and Twitter account so that you can contact them whenever you need expert support for package management.
Wrapping up
This article introduced RPM and shared how to use the tool. Also, we could see how using Packagecloud can make things different. RPM has connected users to a wide range of powerful packages. The tool helped people to easily use and manage packages. However, when you have different Linux distributions that need to be scaled up, using RPM alone may not be enough. Packagecloud can fill up the gap between your growing infrastructure and the necessity to effectively manage your servers.
To check more about Packagecloud, try our free trial today.
Set up your own package repository.
Fast, reliable, and secure software starts here.
How to Use RPM Command in Linux
If you’re a Linux user, you’ve likely come across the term RPM. RPM is an acronym for Red Hat Package Manager, and it is a powerful command-line tool for managing software packages on Linux systems. This article will cover everything you need to know about the RPM command in Linux, including its syntax, usage, and some common examples.
1: What is the RPM Command
The RPM command is a software management tool for Linux operating systems. It is used to manage the installation, removal, verification, and upgrading of software packages. RPM is designed to work with packages that are in the RPM format, which is a binary format that contains all the files necessary for installing and running the software.
2: RPM Command Syntax
The basic syntax of the RPM command is as follows:
Here, [OPTIONS] refers to the command options that you can pass to the RPM command, and [PACKAGE] refers to the package that you want to manage.
3: RPM Command Options
To check the complete list of command options, run:
Here are some commonly used options for the RPM command:
-i: install a package
-U: upgrade a package
-e: erase/remove a package
-q: query a package
-V: verify a package
-F: freshen an installed package
-h: display help for a specified RPM command
-v: verbose mode (displays more detailed output)
–test: test mode (simulate the specified command without performing it)
–nodeps: skip dependency checks when installing, upgrading, or removing a package
Note that there are many more options available for the RPM command, and you can find a complete list in the RPM manual page by running man rpm in your terminal.
4: Install RPM Packages
To install an RPM package using the rpm command, follow this syntax:
This command includes the options
- -i for install
- -v for verbose output
- -h to print hash marks to indicate the progress of the installation process
Before installing, ensure that you have downloaded the appropriate package file compatible with your system architecture.
For example, to install the vim-enhanced rpm package, use the following command:
We can also install an RPM package with download link using the following command:
5: Upgrade RPM Packages
During an RPM upgrade, the current version of the package is uninstalled, and the latest version is installed.
The following command can be used to upgrade packages:
This command includes the options
To upgrade vim-enhanced, use:
Manually installing additional dependencies may be required if the new version requires them. In the output after running the command, RPM shows the required dependencies that are missing.
Add the –nodeps option to the command to ignore the message and update without dependencies:
6: Remove RPM Packages
To remove RPM packages, run:
For example, to remove the vim-enhanced RPM, run:
Using yum is another option for uninstalling RPM packages.
For example, to remove vim using yum command run:
7: List Installed RPM Packages
Run the following command to list all installed RPM packages:
The command includes the -qa option, which instructs RPM to query all.
8: Display Package Information Before Installing
Before installing a package, the following command displays information about the RPM package:
To obtain information about a package and confirm its validity, use the options:
For example, to display the information related to vim-enhanced RPM package run:
9: Display Package Information After Installing
An RPM package’s available information can be viewed by using the -qi option, which instructs the program to query the package details:
The output gives us information such as package details.
For example, the following command will give us info related to vim-enhanced:
10: Check RPM Package Dependencies Before Installing
The RPM commands also allow us to check the dependencies of packages before we can install them. Make sure the RPM package is already downloaded for which you want to see the list of dependencies.
The command syntax we use is:
Following is the list of options this command includes:
For example, to list all required dependencies by vim-enhanced package you can run:
11: List All Files of an Installed Package
We can also list all the files associated with a package using -ql option, this will instruct RPM to query the list:
For example, we can list vim-enhanced rpm package files using:
12: RPM Command in Different Linux Distros
While the RPM command works similarly across different Linux distributions, there may be some differences in usage and syntax. Here’s a brief overview of RPM commands in different Linux distros:
RPM Package Management in Red Hat-Based Systems
In Red Hat-based systems, RPM is the default package manager. The RPM package management system is used to manage software packages in these systems. To install a package in a Red Hat-based system, you can use the following command:
To remove a package, you can use the following command:
RPM Package Management in Debian-Based Systems
In Debian-based systems, the default package manager is apt. However, you can still use RPM to manage packages in these systems.
RPM is a package manager for the Red Hat system so by default it is not installed on Debian. To install the RPM package manager in a Debian-based Linux system, run:
To install a package in a Debian-based system using RPM, you can use the following command:
Note: The alien utility will convert the RPM package to deb, which you can install using the following command:
RPM Package Management in Arch-Based Systems
In Arch-based systems, the default package manager is pacman. However, you can still use RPM to manage packages in these systems. To install a package in an Arch-based system using RPM, you can use the following command:
Conclusion
The RPM command is a powerful tool for managing software packages in Linux. Whether you’re installing new packages, upgrading existing ones, or removing old ones, RPM makes it easy to keep your system up-to-date and running smoothly. By following the tips and tricks mentioned in this article, you can become proficient in using the RPM command for managing software packages.
About the author
Kashif
I am an Electrical Engineer. I love to write about electronics. I am passionate about writing and sharing new ideas related to emerging technologies in the field of electronics.