0% found this document useful (0 votes)
60 views

Yum Commands

yum commands

Uploaded by

Tim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
60 views

Yum Commands

yum commands

Uploaded by

Tim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 25
222 20 YUM Commands fr Linux Package Mangement 20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management Ravi Saive | Last Updated: July 3, 2020 CentOS, Fedora, Linux Commands, Linux Distros, RedHat | 69 Comments In this article, we will learn how to install, update, remove, find packages, manage packages and repositories on Linux systems using YUM (Yellowdog Updater Modified) tool developed by RedHat. The example commands shown in this article are practically tested on our CentOS 6.3 server, you can use these material for study purpose, certifications or just to explore ways to install new packages and keep your system up-to-date. The basic requirement of this article is, you must have a basic understanding of commands and a working Linux operating system, where you can explore and practice all the commands listed below. 20 YUM Commands 20 Linux Yum Commands What is YUM? hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 15 aitire024 20.YUM Commands for Linux Package Mangement YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system ‘administrator to easily install, update, remove or search software packages on a systems. It was developed and released by Seth Vidal under GPL (General Public License) as an open source, means anyone can allowed to download and access the code to fix bugs and develop customized packages. ‘YUM uses numerous third party repositories to install packages automatically by resolving their dependencies issues. 1. Install a Package with YUM To install a package called Firefox 14, just run the below command it will automatically find and install all required dependencies for Firefox. # yum install firefox Loaded plugins: fastestmirror Dependencies Resolved Package Arch Versio Repository Updating firefox 686 10.0.6-1.e16.centos _updates Updating for dependencies xulrunner 686 18.0.6-1.el6.centos updates ransaction Summary Install @ Package(s) Upgrade 2 Package(s) Total download size: 32 M Is this ok [y/N]: y Downloading Packages (aay x-10.0,6-1.e16.centos. i68 | 20 me (2/2): xulrunner-10.0.6-1.e16. centos.1686.rpm | 22 m8 otal 63 kB/s | 32 mB @2 Updated: x.4686 0:10.0.6-1.e16.centos Dependency Updated: 1686 @:10.0.6-1.e16.centos Complete! A hitps:lwwztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 2125 aitire024 20.YUM Commands for Linux Package Mangement The above command will ask confirmation before installing any package on your system. If you want to install packages automatically without asking any confirmation, use option -y as shown in below example. # yum -y install firefox 2. Removing a Package with YUM To remove a package completely with their all dependencies, just run the following command as shown, below, # yum remove firefox Loaded plugins: fastestmirror Setting up Remove P Resolving Dependencies > Running transaction check > Package firefox. i686 0:10.0.6-1.e16.centos set to be erased > Finished Dependency Resolution Dependencies Resolved Package Arch Versio Repository Removing firefox 686 10.0.6-1.e16.centos @updates ransaction Summary Remove 1 Package(s) Reinstal @ Package(s) Downgrade @ Package(s) Is this ok [y/N]: y Downloading Packages Running rpm_check_debug Running Transaction Test ransaction Test Succeeded Running Transaction Erasing firefox-10.0.6-1.e16.centos.1686 Removed: firefox. i686 0:10.0.6-1.e16.centos hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 3125 2ni2a2 20 YUM Commands fr Linux Package Mangement onplete! 30 Days Free for Limited Time ‘The #1 Online t Ki vast ¥ Same way the above command will ask confirmation before removing a package. To disable confirmation prompt just add option -y as shown in below. # yum -y remove firefox 3. Updating a Package using YUM Let’s say you have outdated version of MySQL package and you want to update it to the latest stable version. Just run the following command it will automatically resolves all dependencies issues and install them. # yum update mysql Loaded plugins mirror hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 4128 2ni2a2 20 YUM Commands fr Linux Package Mangement Package Arch Version Repository Updating: vsftpd 4386 2.0.5-24.e15_8.1 updates Transaction Summary Install @ Package(s) Upgrade 1 Package(s) Total size: 144 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating vsftpd Cleanup vsftpd Updated: vsftpd.i386 @:2.0.5-24.e15 8.1 Complete! 4. List a Package using YUM Use the list function to search for the specific package with name. For example to search for a package called openssh, use the command, # yum list openssh Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn epel: mirror.neu.edu.cn * extras: mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.net * updates: mirror.nus.edu.sg Installed Packages openssh.i386 4.3p2-72.e15_6.3 Available Packages 4,3p2-82.e15 hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 222 20 YUM Commands fr Linux Package Mangement To make your search more accurate, define package name with their version, in case you know. For example to search for a specific version openssh-4.3p2 of the package, use the command. # yum list openssh-4.3p2 5, Search for a Package using YUM If you don’t remember the exact name of the package, then use search function to search all the available packages to match the name of the package you specified. For example, to search all the packages that matches the word . # yum search vsftpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.net * updates: ac.in Matched: vsftpd A robust log colorizer pure-#tpd-selinux.i386 : SELinux support for Pure-FTPD vsftpd.i386 - Very Secure Ftp Daemon 6. Get Information of a Package using YUM Say you would like to know information of a package before installing it. To get information of a package just issue the below command. # yum info firefox Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn * epel: mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.ne * updates: ftp.iitm.ac.in Available Pack Name firefox Arch 386 Version 6 hitps:lwwztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 6125 2ni2a2 20 YUM Commands fr Linux Package Mangement Release e15.centos Size 20M Repo updates Summary Mozilla Firefox Web browser URL. http: //wav.mozilla.org/projects/Ffirefox/ License MPLV1.1 or GPLv2+ or L6PLv2+ Description: Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. 7. List all Available Packages using YUM To list all the available packages in the Yum database, use the below command. # yum list | less 8. List all Installed Packages using YUM To list all the installed packages on o system, just issue below command, it will display all the installed packages. # yum list installed | less 9. Yum Provides Function Yum provides 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/httpd/conf/httpd.conf, # yum provides /etc/httpd/conf/httpd.conf Loaded plugins: fastestmirror httpd-2.2.3-63.e15.centos.i386 : Apache HTTP Server Matched from Filename Jetc/httpd/conf/httpd. conf httpd-2.2.3-63.e15.centos.1.4386 : Apache HTTP Server Repo updates Matched from Filename Jetc/nttpd/conf/nt! httpd-2.2.3-65.e15.centos.i386 : Apache HTTP Server a Repo updates hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 7128 2ni2a2 20 YUM Commands fr Linux Package Mangement Match Filename etc/httpd/conf/httpd.conf http Provides-natc! 10. Check for Available Updates using Yum To find how many of installed packages on your system have updates available, to check use the following command # yum check-update 11. Update System using Yum To keep your system up-to-date with all security and binary package updates, run the following command. It will install all latest patches and security updates to your system # yum update 12. List all available Group Packages In Linux, number of packages ore bundled to particular group. Instead of installing individual packages with yum, you can install particular group that will install all the related packages that belongs to the group. For example to list all the available groups, just issue following command # yum grouplist Installed Groups: DNS Name Server Dialup Networking Support Edit Engineering and Scientific FTP Server Java Development legacy Network Server Available Groups: a Authoring and Publishing hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 8125 2ni2a2 20 YUM Commands fr Linux Package Mangement Base Beagle Cluster Storage Clustering Development Libraries Development Tools Eclipse Educational Software KDE (K Desktop Environment) KDE Software Development 13. Install a Group Packages To install a particular package group, we use option as groupinstall. Fore example, to install "MySQL. Database’, just execute the below command. # yum groupinstall ‘MySQL Database’ Dependencies Resolved Package Arch Version Updating vunix0DBC 1386 2.2.11-10.e15 base 28 Installing for dependencies: unixODBC-libs i386 [email protected] base 55 Transaction Summary Install 1 Package(s) Upgrade 1 Package(s) Total size: 841 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing unixODBC-libs 13 Updating unixoDBc 2/3 Cleanup + unixODBC 3/3 Dependency Installed: hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 2ni2a2 20 YUM Commands fr Linux Package Mangement unixODBC-1ibs. 1386 @:2.2.11-10.e15 Updated: unixODBC, i386 @:2.2.11-10.e15 Complete! 14. Update a Group Packages To update any existing installed group packages, just run the following command as shown below. # yum groupupdate "DNS Name Server’ Dependencies Resolved Package Arch Version Repos Updating: bind 1386 30:9.3.6-20.P1.e15_8.2 updat! bind-chroot 4386 30:9.3,6-20.P1.¢15_8.2 updat. Updating for dependencies: bind-libs 4386 30:9.3.6-20.P1.e15 8.2 updat. bind-utils 41386 30:9.3.6-20.P1.e15_8.2 updat: Transaction Summary Install @ Package(s) Upgrade 4 Package(s) Total size: 2.0m Is this ok [y/N]: y Downloading Package Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction updating : bind-libs we Updating : bind 2/8 Updating : bind-chroot, 3/8 Updating : bind-utils 4/8 Cleanup bind 5/8 Cleanup + bind-chroot 6/8 Cleanup bind-utils 78 a Cleanup bind-libs 8/8 hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 10725 2ni2a2 20 YUM Commands fr Linux Package Mangement Updated: bind. i386 3 -3.6-20.P1.e15_8.2 bind-chroot.i386 30:9,3.6-20.P1.¢ Dependency Updated: bind-libs.1386 30:9.3.6-20.P1.e15_8.2 bind-utils.1386 30:9.3.6-20.P1.el Complete! 15. Remove a Group Packages To delete or remove any existing installed group from the system, just use below command. # yum groupremove "DNS Name Server’ Dependencies Resolved Package Arch Version Repository Removing: bind 4386 30:9.3.6-20.P1.e15 8.2 installed bind-chroot 4386 30:9.3.6-20.P1.e15 8.2 installed Transaction Summary Remove 2 Package(s) Reinstall @ Package(s) Downgrade @ Package(s) Is this ok [y/N]: y Downloading Package Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Erasing : bind 12 warning: /etc/sysconfig/named saved as /etc/sysconfig/named.rpnsave Erasing : bind-chroot, 2/2 Removed: bind. i386 30:9.3.6-20.P1.¢15_8.2 bind-chroot Complete! hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 115 2ni2a2 20 YUM Commands fr Linux Package Mangement 16. List Enabled Yum Repositories To li all enabled Yum repositories in your system, use following option. # yum repolist repo id repo nane base Centos-5 = Base enab epel Extra Packages for Enterprise Linux 5 - i386 enab extras Centos-5 - Extras enab mod-pagespeed mod-pagespeed enab rpmforge RHEL 5 - RPMforge.net - dag enab dates Centos-5 - Updates enab epolist: 20,824 16. List all Enabled and Disabled Yum Repositories The following command will display all enabled and disabled yum repositories on the system, # yum repolist all repo repo name (5.0-base centos-5.@ - Base €5.0-centosplus centos-5.@ - Plus (5.0-extras centos-5.@ - Extras base Centos-5 - Base epel Extra Pi extras centos-5 - repolist: 20,824 17. Install a Package from Specific Repository To install a particular package from a specific enabled or disabled repository, you must use -enablerepo option in your yum command. For example to Install PhpMyAdmin 3.5.2 package, just execute the command # yum --enablerepo=epel install phpmyadmin hitps:lww tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 1278 2ni2a2 20 YUM Commands for Linux Package Mangement Dependencies Resolved Package arch Version Repository Size Installing: phpMyAdmin noarch 3.5.1-1.e16 epel 42M Transaction Summary Install, 1 Package(s) Total download size: 4.2 ™ Installed size: 17 Is this ok [y/N]: y Downloading Packages: phpMyAdmin-3.5.1-1.e16.noarch. rpm | 4.2 B 00:25 Running epm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : phpMyAdmin-3.5.1-1.e16.noarch wa Verifying : phpllyAdmin-3.5.1-1.e16.noarch wa Installed: phpMyAdmin.noarch @:3.5.1-1.e16 Complete! 18. Interactive Yum Shell Yum ul lity provides a custom shell where you can execute multiple commands. # yum shell Loaded plugin: Setting up Yum Shell > update httpd Loading mirror speeds from cached hostfile fastestmirror * base: mirrors.sin3.sg.voxel.net * epel: ftp.riken.jp * extras: mirrors.sin3.sg.voxel.net * updates: mirrors. sin3.sg.voxel.net Setting up Update Process hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 1325 aysio021 20 YUM Commands for Linux Package Mangement 19. Clean Yum Cache By default yum keeps all the repository enabled package data in /var/eache/yum/ 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. We don't want to give the output of the below command, because we like to keep cached data as it i. # yum clean all 20. View History of Yum To view all the past transactions of yum command, just use the following command, # yum history Loaded plugins: fastestmirror 1D | Login user history list ‘We have tried to cover all the basic to advance yum commands with their examples. if anything related to yum commands may have missed out. Please update us through our comment box. So, we keep updating the same based on feedback’s received < 20 Netstat Commands for Linux Network 8 Linux Nslookup Commands to Troubleshoot DNS Management {Domain Name Server) > If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 1412s 222 20 YUM Commands fr Linux Package Mangement If You Appreciate What We Do Here On TecMint, You Should Consider: eeeeeee TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all If you like what you are reading, please consider buying us a coffee (or 2) as a token of appreciation. RedHat RHCSA and RHCE Certification Preparation Guide -| Get This Book Related Posts ° te a ‘ ee | re © rue 8 san How to Co-author Documents in Linux with ONLYOFFICE Docs hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 15925 222 20 YUM Commands fr Linux Package Mangement eee How to Install Latest Vim Editor in Linux Systems cae Create a°KVM Virtual Machine Template How to Create a KVM Virtual Machine Template How to Set Up High Availability for Resource Manager - Part 6 How to Set Up High Availability for Resource Manager ~ Part 6 hitps:lwwuz tecmint.com!20-nux-yur-yellowdog-updater-madtied-commands for-package-mangement! 16128 222 20 YUM Commands fr Linux Package Mangemer Pee roel al + & Basicdetals Performance Name: debian-10 cPus uno: .28365247-2923-4470-8124-b31dF5/33c80 Memory Status: [Bal Running (Booted) Boot options title: Has EDEL Description: IDECDROM1 NIC:59:18:64 Mouse How to Manage Virtual Machines in KVM Using Virt-Manager Perea enr yt] ia eee} esr Tey eres ene se eee Help fees eee ete How to Create Virtual Machines in KVM Using Virt-Manager hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 728 222 20 YUM Commands fr Linux Package Mangement 69 thoughts on “20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management” + Older Comments Sai Parthiv February 10, 2021 at 3:07 am Just started using Linux on my AWS EC2 instance, These yum commands have been super helpful. Thank you. Reply sushant January 24, 2020 at 4:38 pm Good to know... Very useful. keep posting, Reply Raghavan alias Saravanan Muthu August 16, 2019 at 12:21 am Just starting with the CentOS and Yum for the first time.. Thanks for the nice write up! Reply Andrei Sevostianov July 12, 2019 at 6:50 am I tried to find the ‘yum’ substitute for ‘apt-key add’ but wasn't able to do it. Does it exist? hitps:lwwuz tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands-for-package-mangement! 18125 222 20 YUM Commands fr Linux Package Mangement Reply iret? January 16, 2019 at 9:00 pm had use “yum upgrade yum" but I don't really understand what's for, can you explain it please? Reply Ravi Saive January 17, 2019 at 12:03 pm @rct7, ‘The command is wrong, it should be “yum upgrade” or you can also use “yum update” - both will update your system to latest release version. Reply sathish November 28, 2018 at 8:14 am How to degraded the RHEL version, for example 7.5 to 7.2? Reply Ravi Saive November 28, 2018 at 10:12 am @Sathish, To downgrade the redhat-release package from the current release to previous minor release, Use the following command, # yum downgrade redhat-release hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 19128 222 20 YUM Commands fr Linux Package Mangement Reply Shan November 2, 2018 at 5:48 pm Dear, You missed out deplist option in yum Reply Ravi Saive November 7, 2018 at 10:20 am @Shan, ‘Thanks for the tip, we will include an example about dep! examples. st command in this yum command Reply shailendra October 19, 2018 at 5:18 pm Its is really a wonderful article for users who are new and start learning Linux. Dear friend please keep writing for the community.Thank you Reply Yagnik Pandya August 18, 2018 at 10:19 pm Appreciate for making such @ wonderful article l! It is helpful for beginners who wish to be familia with "YUM" commands, hitps:lwwuz tecmint.com!20-nux-yum-yellowdog-updater-moditied-commands-for-package-mangement! 20125 222 20 YUM Commands fr Linux Package Mangement Thanks a lot. Reply + Older Comments Got something to say? Join the discussion. Have a question or suggestion? Please leave a comment to start the discussion, Please keep in mind that all comments are moderated and your email address will NOT be published Name * Email * Website © Save my name, email, and website in this browser for the next time | comment. O Notify me of followup comments via e-mail. You can also subscribe without commenting mment This site uses Akismet to reduce spam. Learn how your comment data is processed. Over 3,500,000+ Readers hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 2115 222 20 YUM Commands fr Linux Package Mangement A Beginners Guide To Learn Linux for Free [with Examples] Linux Foundation LFCS and LFCE Certification Study Guide [eBooks] hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 225 222 20 YUM Commands fr Linux Package Mangement Learn Linux Commands and Tools Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser vlock - A Smart Way to Lock User Virtual Console or Terminal in Linux How to View Configuration Files Without Comments in Linux How to Record and Replay Linux Terminal Sessions using ‘script’ and ‘scriptreplay’ Commands How to Send a Message to Logged Users in Linux Terminal ifconfig vs ip: What's Difference and Comparing Network Configuration &TECMINT #1 Wor.'s LEADING Linux BLOG Do You WANT To LEARN LINUX? Get weekly Linux tutorials, tricks & tips and other useful Open Source resources in your INBOX. Jou Now ... IT's Free! hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 23105 222 20 YUM Commands fr Linux Package Mangement Linux Server Monitoring Tools pyDash - A Web Based Linux Performance Monitoring Tool bmon - A Powerful Network Bandwidth Monitoring and Debugging Tool for Linux Monitor Server Logs in Real-Time with “Log.io” Tool on RHEL/CentOS 7/6 SARG - Squid Analysis Report Generator and Internet Bandwidth Monitoring Tool BpyTop — Resource Monitoring Tool for Linux Install OpenNMS Network Monitoring in Debian and Ubuntu Learn Linux Tricks & Tips How to View Colored Man Pages in Linux Learn The Basics of How Linux /O (Input/Output) Redirection Works Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux How to Delete Root Mails (Mailbox) File in Linux Gogo - Create Shortcuts to Long and Complicated Paths in Linux How to Split Large ‘tar’ Archive into Multiple Files of Certain Size Best Linux Tools 7 Best IRC Clients for Linux 10 Best Clipboard Managers for Linux 5 Most Notable Open Source Centralized Log Management Tools 9 Best Twitter Clients for Linux That You Will Love to Use 8 Best Screen Recorders for Desktop Screen Recording in Linux 10 Best GitHub Alternatives to Host Open Source Projects Donate to TecMint Contact Us Advertise on TecMint Linux Services Copyright Policy Privacy Policy r Sponsored Post hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 205 222 20 YUM Commands fr Linux Package Mangement Tecmint: Linux Howtos, Tutorials & Guides © 2021. All Rights Reserved, The material in this site cannot be republished either online or offline, without our permission, Hosting Sponsored by : Linede Cloud Hosting hitps:lwwuztecmint.com!20-nux-yum-yellowdog-updater-moditied-commands for-package-mangement! 2575

You might also like