top of page
Recent Posts

How to install and remove software package in rhel8.2

Updated: Oct 3, 2021

Document ID: RHEL004


In my last post i've discussed about VIM the powerful text editor, in this post I'm going to discuss about software package installation, update and removal process in Red Hat Enterprise Linux 8.2



rpm, is a tool that can get information about content of the package file and installed package


rpm, also use to install, upgrade and remove software package from RedHat Linux System


yum , rpm command can be used to install and upgrade software package but it is not designed to work with package repositories or resolve dependencies, to resolve dependencies we use yum.


In this tutorial we’ll see how we can use both rpm and yum commands to install and upgrade software from RHEL DVD


To check installed software list we can use below command


Using rpm command:

[root@RHEL82 ~]# rpm –qa

[root@RHEL82 ~]# rpm -qa |less

[Press “Enter” or “space” to check details and then press ‘q’ to exit]


Using yum command:

[root@RHEL82 ~]# yum list

[root@RHEL82 ~]# yum list |less

[Press “Enter” or “space” to check details and then press ‘q’ to exit]



To check whether a specific package installed or not

Using rpm command:

[root@RHEL82 ~]# rpm -qa |grep httpd

Output:

redhat-logos-httpd-81.1-1.el8.noarch

httpd-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64

httpd-filesystem-2.4.37-21.module+el8.2.0+5008+cca404a3.noarch

httpd-manual-2.4.37-21.module+el8.2.0+5008+cca404a3.noarch

httpd-tools-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64



Using yum command:

[root@RHEL82 ~]# yum list httpd

Updating Subscription Management repositories.

Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Installed Packages

httpd.x86_64 2.4.37-21.module+e



If the software package is not installed the command output is blank

[root@RHEL82 ~]# rpm -qa |grep vsftpd

[root@RHEL82 ~]#



[root@RHEL82 ~]# yum list vsftpd

Updating Subscription Management repositories.

Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Error: No matching Packages to list



We saw that vsftp (ftp server package) is not installed in the system.


To install ftp package using rpm command from RHEL DVD


Step1:

For Physical Server: Insert RHEL8.2 DVD into DVD-ROM

For Virtual Machine: CD Drive- Path- RHEL8.2.ISO file as image file in the virtual machine setting like below example




Step2: Mount RHEL8.2 DVD to /media directory

[root@RHEL82 /]# mount /dev/sr0 /media/

mount: /media: WARNING: device write-protected, mounted read-only.

[root@RHEL82 /]# cd /media/

[root@RHEL82 media]# ls

AppStream BaseOS EFI EULA extra_files.json GPL images isolinux media.repo RPM-GPG-KEY-redhat-beta RPM-GPG-KEY-redhat-release TRANS.TBL

[/dev/sr0 or it may be /dev/sr1, we can use /dev/sr then press “tab” key to check available devices name]


Now, DVD has mounted in /media directory.


Step3: Go to /media/AppStream//Packages/

[root@RHEL82 Packages]# cd /media/AppStream//Packages/

[root@RHEL82 Packages]# pwd

/media/AppStream/Packages


Step4: To check the vsftpd package available in the DVD media

[root@RHEL82 Packages]# ls |grep vsftpd

vsftpd-3.0.3-31.el8.x86_64.rpm



Step5: Now install vsftpd package

[root@RHEL82 Packages]# rpm -ivh vsftpd*

warning: vsftpd-3.0.3-31.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Verifying... ################################# [100%]

Preparing... ################################# [100%]

Updating / installing...

1:vsftpd-3.0.3-31.el8 ################################# [100%]



Step6: To check the installation

[root@RHEL82 Packages]# rpm -qa |grep vsftpd

vsftpd-3.0.3-31.el8.x86_64



To update package using rpm command we have to use “Uvh” option

[root@RHEL82 Packages]# rpm -Uvh vsftpd*

warning: vsftpd-3.0.3-31.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Verifying... ################################# [100%]

Preparing... ################################# [100%]

package vsftpd-3.0.3-31.el8.x86_64 is already installed



To remove vsftpd package using rpm command we have to use “evh” option

To remove/erase a package we have to use full package name


[root@RHEL82 Packages]# rpm -qa |grep vsftpd

vsftpd-3.0.3-31.el8.x86_64

[root@RHEL82 Packages]# rpm -evh vsftpd-3.0.3-31.el8.x86_64

Preparing... ################################# [100%]

Cleaning up / removing...

1:vsftpd-3.0.3-31.el8 ################################# [100%]



[root@RHEL82 Packages]# rpm -qa |grep vsftpd

No output means package is not installed



Important RPM commands:

#rpm -qa

List all installed rpm packages in the sytem


#rpm -q package_name

Display the version of package installed in the system


#rpm -ivh package_name

To install a package


#rpm -Uvh package_name

To update a pacakge


#rpm -evh package_name

To erase/remove a package from system


#rpm -qi package_name

Display detailed information about package


#rpm -ql package_name

Display all files included in the package


#rpm -qc package_name

Display configuration files included in the pacakge


#rpm -qd package_name

Display documentation files included in the package


#rpm -q --changelog package_name

Display short summary of reason to new release


#rpm -q --scripts package_name

Display all shell scripts run on package installation , upgrade and removal







674 views1 comment

Recent Posts

See All

1 comentario


Dipto saha
Dipto saha
05 jun 2021

Thanks Vai. It works❤❤❤

Me gusta
Log In to Connect With Members
View and follow other members, leave comments & more.
bottom of page