In Red Hat, the popular package used for installation usually have the .rpm extension and can be installed through different means. Before starting to install the package, let’s take a look at the naming convention used by the system to describe packages.
Package Syntax: package_name-version-release.arch.rpm
As an example, let’s look at the seahorse package, which is used to install GnuGP for encrypting files.
seahorse-0.8.2-2.el5.kb.i386.rpm
You can see the name of the package is seahorse. The version is 0.8.2 and it means for 32 bit system. The -2 is the release, and the el5 is something that you can find in Red Hat packages. Being understand the version of the package is very important. Based on these informations you can avoid the security rick of older versions. Moreover, it’s easy for you to find the dependencies for your packages.
Now I will show you some basic steps to manage your packages using RPM command.
Step 1. Install your package. You can use wget command to download your package to local and start to install it.
Step 2. Upgrade your package. Just in case you already installed your application in your machine and now you want to upgrade it from another package which just downloaded from the Internet.
The result shows that “package … is already installed” because I used the same package. Just ignore and remove it by your newer package.
Step 3. Remove your package.
# rpm -e nano
Step 4. Query your package
If you just installed your package want to verify it, you can also use rpm command with some options.
The -q options help you to verify that your package is installed successfully or not. However, it just can find the package with the exactly name. If the name is different, you need to conduct in another way. For example, I will find the vim package.
There are many ways to find and verify your packages. If you want to make sure that your application was installed in your machine, let’s use -qa options.
Bonus: Now I will give you some more query options when working with package management.
1- Query information
2- Query the package that file belongs to
3- Query all config files
4- Query document files
Have fun!