Wednesday 24 May 2017

Best Practical examples of RPM commands in linux

Basically Red Hat Package Manager (RPM) are a package management utility which are used for install, update , uninstall, query and verify of packages in Linux system like (RHEL,CentOS and Fedora).

Please find the below practical examples of rpm commands in Linux operating system.

➤ How to install an RPM packages.

To install the packages on Linux operating machine, please use the -i option for install. Please find the below example for installing the rpm.

[root@localhost]# rpm -ivh jdk-6u37-linux-amd64.rpm

Using above command you can install the rpm on linux operating machine. In the above command, -h print the has mark stat that package is archived and -v used as a verbose for better display.

➤ How to install an RPM packages without dependencies.

To install the packages on linux machine, please use --nodeps option. Please find the below example for installing the rpm without dependencies.

[root@localhost]# rpm -ivh --nodeps ftp-2.7.9-5.el6.2.i686.rpm

In above example, all the dependencies for installing the ftp server has been ignored.

➤ How to check a RPM signature.

To check the PGP signature of any rpm , please use the below command. This signature process is used for verification of the origin of rpm.

[root@localhost]# rpm --checksig jdk-6u37-linux-amd64.rpm

Using above command you can verify that the origin of installing rpm is valid. Normally this command is used before installing the rpm.

➤ How to check all installed rpm on Linux server.

To check the all installed rpm's on the linux machine, please use -q option. Please check the below example for checking all list.

[root@localhost]# rpm -q samba

Using above command you can find the all installed rpm related to packages.

➤ How to check recently installed RPM.

 To check the recently installed rpm, please use the -qa (query all) option. Please find the below example to check the recently installed rpm.

[root@localhost]# rpm -qa --last

The above command show you the list of all recently rpm in sequence of installation order. 

➤ How to list all installed RPM.

To check and print the list of all installed rpm on linux machine, use the below command.

[root@localhost]# rpm -qa

Command output show you the list of all installed packages on the linux machine.

➤ How to Upgrade a RPM Package.

If you want to upgrade already installed rpm on the linux machine, please check the command which is used in below example.

[root@localhost]# rpm -Uvh ftp-2.7.9-5.el6.2.i686.rpm

Here, -U option is used for upgrading the rpm packages which are installed on the linux machine.

➤ How to Remove a RPM Package.

To remove the package from linux server, you can use the -e option. Please find the below command with an example to remove the packages.

[root@localhost]# rpm -e ftp-2.7.9-5.el6.2.i686.rpm

You can use the below command syntax as well for removing the package from the linux machine.

 [root@localhost]# rpm -ev ftp

In last example, all the package dependencies are also removed with this command syntax.

➤ How to Remove a RPM Package without dependencies.

Please use the below command to remove a rpm package without removing any dependencies.

[root@localhost]# rpm -ev--nodeps samba

here, -nodeps command used for removing the package without any dependencies.

➤ How to query a information of Installed RPM package.

If you want to get all information regarding the installed rpm package, please use the -qi option. Please find the below example to query the information of installed rpm.

[root@localhost]# rpm -qi samba

Above command display all the information related to samba packages.

➤ How to verify a RPM package.

To verify a rpm package, please use the -Vp (Verify Package) option. Please check the below example to verify the package.

[root@localhost]# rpm -Vp ftp-2.7.9-5.el6.2.i686.rpm

Using this command you can verify the package.

Please let me know, if you have any concern regarding this topic.

No comments:

Post a Comment