-y<\/strong><\/span> as shown in the below example.<\/p>\n# yum -y remove firefox<\/pre>\nRemoving a Package with YUM<\/h4>\n To remove a package completely with their all dependencies, just run the following command as shown below.<\/p>\n
# yum remove firefox.x86_64\r\n\r\nLoaded plugins: fastestmirror\r\nDependencies Resolved\r\n\r\n=========================================================================================================================================================\r\nPackage Arch Version Repository Size\r\n=========================================================================================================================================================\r\nRemoving:\r\nfirefox x86_64 68.6.0-1.el7.centos @updates 230 M\r\n\r\nTransaction Summary\r\n=========================================================================================================================================================\r\nRemove 1 Package\r\n\r\nInstalled size: 230 M\r\nIs this ok [y\/N]: y\r\n\r\nRunning transaction\r\nErasing : firefox-68.6.0-1.el7.centos.x86_64\r\n\r\nVerifying : firefox-68.6.0-1.el7.centos.x86_64 1\/1\r\n\r\nRemoved:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 firefox.x86_64 0:68.6.0-1.el7.centos\r\n\r\nComplete!<\/pre>\nSame way the above command will ask confirmation before removing a package. To disable confirmation prompt just add option -y<\/strong> <\/span>as shown in below.<\/p>\n# yum -y remove firefox<\/pre>\nUpgrading a Package using YUM<\/h4>\n We can also upgrade any installed package to the latest stable version. For e.g. we’ve to upgrade the version of vsftd<\/strong>.<\/span><\/span> Just run the following command it will automatically resolve all dependencies issues and install them.<\/p>\n# yum upgrade vsftpd\r\n\r\nLoaded plugins: fastestmirror\r\nDependencies Resolved\r\n\r\n==========================================================================================================================================================\r\n Package Arch Version Repository Size\r\n==========================================================================================================================================================\r\nUpdating:\r\n vsftpd i386 2.0.5-24.el5_8.1 updates 144 k\r\n\r\nTransaction Summary\r\n==========================================================================================================================================================\r\nInstall 0 Package(s)\r\nUpgrade 1 Package(s)\r\n\r\nTotal size: 144 k\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n Updating : vsftpd 1\/2\r\n Cleanup : vsftpd 2\/2\r\n\r\nUpdated:\r\n vsftpd.i386 0:2.0.5-24.el5_8.1\r\n\r\nComplete!<\/pre>\nDowngrading a Package using YUM<\/h4>\n There will be occasions when a program update may have lead to an unstable system due to hardware compatibility issues. For this or whatever the reason, if you want your previous version program back, you need to know how to downgrade the applications.<\/p>\n
# yum downgrade httpd-2.2.3-22.el5\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================================================================\r\nPackage Arch Version Repository Size\r\n====================================================================================================================================================\r\nInstalling:\r\nhttpd i386 2.2.3-22.el5 rhel-i386-server-5 1.2 M\r\nRemoving:\r\nhttpd i386 2.2.3-31.el5 installed 3.1 M\r\nRemoving for dependencies:\r\nhttpd-manual i386 2.2.3-31.el5 installed 3.4 M\r\nmod_ssl i386 1:2.2.3-31.el5 installed 173 k\r\n\r\nTransaction Summary\r\n====================================================================================================================================================\r\nInstall 1 Package(s)\r\nUpdate 0 Package(s)\r\nRemove 3 Package(s)\r\n\r\nTotal download size: 1.2 M\r\nIs this ok [y\/N]:<\/pre>\nList Packages using YUM<\/h4>\n Use the list<\/strong><\/span> function to search for the specific package with name, recently installed, updates available, etc. For example, to search for a package called OpenSSH<\/strong><\/span>, use the command.<\/p>\n# yum list openssh\r\n\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n* base: centos.mirrors.estointernet.in\r\n* extras: centos.mirrors.estointernet.in\r\n* updates: centos.mirrors.estointernet.in\r\nInstalled Packages\r\nopenssh.x86_64 7.4p1-21.el7 @anaconda<\/pre>\nTo list all the installed packages in a system, use the following command.<\/p>\n
# yum list installed<\/pre>\nTo list all recently installed packages, use the following command.<\/p>\n
# yum list recent<\/pre>\nUse the following command to list the packages with updates available.<\/p>\n
# yum list updates<\/pre>\nSearch for a Package using YUM<\/h4>\n If you don\u2019t remember the exact name of the package, then use search<\/strong><\/span> function to search all the available packages to match the name of the package you specified. For example, to search all the packages that match the word .<\/p>\n# yum search firefox\r\n\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n* base: centos.excellmedia.net\r\n* extras: centos.excellmedia.net\r\n* updates: centos.excellmedia.net\r\n=================================================== N\/S matched: firefox =============================================================\r\nfirefox.i686 : Mozilla Firefox Web browser\r\nfirefox.x86_64 : Mozilla Firefox Web browser<\/pre>\nGet Information of a Package using YUM<\/h4>\n Say you would like to know the information about a package before installing it. To get information about a package just issue the below command.<\/p>\n
# yum info firefox\r\n\r\nLoaded plugins: fastestmirror\r\n* base: centos.excellmedia.net\r\n* extras: centos.excellmedia.net\r\n* updates: centos.excellmedia.net\r\nAvailable Packages\r\nName : firefox\r\nArch : i686\r\nVersion : 68.6.0\r\nRelease : 1.el7.centos\r\nSize : 97 M\r\nRepo : updates\/7\/x86_64\r\nSummary : Mozilla Firefox Web browser\r\nURL : https:\/\/www.mozilla.org\/firefox\/\r\nLicense : MPLv1.1 or GPLv2+ or LGPLv2+\r\nDescription : Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability.<\/pre>\nList all Dependencies of a Package using YUM<\/h4>\n You can check the list of all Dependencies required by a specific package using the following command.<\/p>\n
# yum deplist vsftpd\r\n\r\nLoaded plugins: fastestmirror\r\n* base: mirrors.praction.in\r\n* extras: mirrors.praction.in\r\n* updates: mirrors.praction.in\r\npackage: vsftpd.x86_64 3.0.2-25.el7\r\ndependency: \/bin\/bash\r\nprovider: bash.x86_64 4.2.46-33.el7\r\ndependency: \/bin\/sh\r\nprovider: bash.x86_64 4.2.46-33.el7\r\ndependency: libc.so.6(GLIBC_2.15)(64bit)<\/pre>\nYum Provides Function<\/h4>\n Yum provides<\/strong><\/span> function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the \/etc\/ssh\/sshd_config<\/strong><\/span>.<\/p>\n# yum provides \/etc\/ssh\/sshd_config\r\n\r\nLoaded plugins: fastestmirror\r\n* base: centos.excellmedia.net\r\n* extras: centos.excellmedia.net\r\n* updates: centos.excellmedia.net\r\nopenssh-server-7.4p1-21.el7.x86_64 : An open source SSH server daemon\r\nRepo : base\r\nMatched from:\r\nFilename : \/etc\/ssh\/sshd_config\r\n\r\nopenssh-server-7.4p1-21.el7.x86_64 : An open source SSH server daemon\r\nRepo : @anaconda\r\nMatched from:\r\nFilename : \/etc\/ssh\/sshd_config<\/pre>\nCheck for Available Updates using Yum<\/h4>\n Find how many installed packages on your system have updates available, use the following command to check.<\/p>\n
# yum check-update<\/pre>\nUpdate System using Yum<\/h4>\n To keep your system up-to-date with all security and binary package updates, run the following command. It will install all the latest patches and security updates to your system.<\/p>\n
# yum update<\/pre>\nList all available Group Packages<\/h4>\n In Linux, number of packages are bundled to a particular group. Instead of installing individual packages with yum, you can install a particular group that will install all the related packages that belong to the group. For example to list all the available groups, just issue following command.<\/p>\n
# yum groups list\r\n\r\nLoaded plugins: fastestmirror\r\n* base: centos.excellmedia.net\r\n* extras: centos.mirror.snu.edu.in\r\n* updates: centos.mirror.snu.edu.in\r\nAvailable Environment Groups:\r\nMinimal Install\r\nCompute Node\r\nInfrastructure Server\r\nFile and Print Server\r\nBasic Web Server\r\nVirtualization Host\r\nServer with GUI\r\nGNOME Desktop\r\nKDE Plasma Workspaces\r\nDevelopment and Creative Workstation\r\nAvailable Groups:\r\nCompatibility Libraries\r\nGraphical Administration Tools\r\nSecurity Tools\r\nSystem Administration Tools<\/pre>\nInstall a Group Packages<\/h4>\n Install a particular package group, use option groups install<\/strong>. For example, to install \u201cDevelopment Tools<\/strong>\u201c, execute the below command.<\/p>\n# yum groups install \"Development Tools\"<\/pre>\nUpdate a Group Packages<\/h4>\n To update any existing installed group packages, just run the following command as shown below.<\/p>\n
# yum groups update 'DNS Name Server'<\/pre>\nGet details of a Group Packages<\/h4>\n Display details about a group of packages from the system, just use the below command.<\/p>\n
yum groups info \"System Administration Tools\"<\/pre>\nRemove a Group Packages<\/h4>\n Delete or remove any existing installed group from the system, just use the below command.<\/p>\n
#yum groups remove 'DNS Name Server'<\/pre>\nList Enabled Yum Repositories<\/h4>\n Get the list of all enabled Yum repositories in your system, use following command.<\/p>\n
# yum repolist\r\n\r\nLoaded plugins: fastestmirror\r\n* base: centos.excellmedia.net\r\n* extras: centos.excellmedia.net\r\n* updates: centos.excellmedia.net\r\nrepo id\u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 repo name\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0 status\r\nbase\/7\/x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CentOS-7 - Base\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10,097\r\nextras\/7\/x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CentOS-7 - Extras \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 341\r\nupdates\/7\/x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CentOS-7 - Updates\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1,787\r\nrepolist: 12,225<\/pre>\nList all Enabled and Disabled Yum Repositories<\/h4>\n The following command will display all enabled and disabled yum repositories on the system.<\/p>\n
# yum repolist all<\/pre>\nInteractive Yum Shell<\/h4>\n Yum utility provides a custom shell where you can execute multiple commands.<\/p>\n
# yum shell\r\n\r\nLoaded plugins: fastestmirror\r\n> search named\r\nLoading mirror speeds from cached hostfile\r\n* base: centos.excellmedia.net\r\n* extras: centos.excellmedia.net\r\n* updates: centos.excellmedia.net\r\n======================================================== N\/S matched: named =================================================================\r\npcp-pmda-named.x86_64 : Performance Co-Pilot (PCP) metrics for Named\r\nbind-chroot.x86_64 : A chroot runtime environment for the ISC BIND DNS server, named(8)\r\nbind-sdb-chroot.x86_64 : A chroot runtime environment for the ISC BIND DNS server, named-sdb(8)\r\n\r\nName and summary matches only, use \"search all\" for everything.\r\n><\/pre>\nClean Yum Cache<\/h4>\n By default yum keeps all the repository enabled package data in \/var\/cache\/yum\/<\/strong> with each sub-directory, to clean all cached files from enabled repository, you need to run the following command regularly to clean up all the cache and make sure that there is nothing unnecessary space is using.<\/p>\n# yum clean all<\/pre>\nView History of Yum<\/h4>\n To view all the past transactions of yum command, just use the following command.<\/p>\n
# yum history\r\n\r\nLoaded plugins: fastestmirror\r\nID | Login user | Date and time | Action(s) | Altered\r\n-------------------------------------------------------------------------------\r\n8 | root <root> | 2020-04-06 13:09 | Install | 1\r\n7 | root <root> | 2020-04-06 12:15 | Install | 31\r\n6 | root <root> | 2020-04-06 12:02 | Erase | 1 EE\r\n5 | root <root> | 2020-04-06 11:43 | Install | 1\r\n4 | root <root> | 2020-04-06 11:39 | Erase | 1 EE\r\n3 | root <root> | 2020-03-30 17:17 | Install | 84\r\n2 | root <root> | 2020-03-30 17:15 | Install | 1\r\n1 | System <unset> | 2020-03-30 16:50 | Install | 301\r\nhistory list<\/pre>\n","protected":false},"excerpt":{"rendered":"In this blog, we will learn how to install, update, remove, find packages, manage packages and repositories on Linux systems…<\/p>\n","protected":false},"author":1,"featured_media":829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[115,113,112,114],"yoast_head":"\n
Yum Commands Cheat Sheet for RHEL - Armour Infosec<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n