Introduction
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.
$ rpm -qi [package_name]
Query RPM Package Information Before Installing
You can even check package info before you install it. This command below will print out the information.
$ rpm -qip [package_name]
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.