This article was reviewed by Stan Kats and by wikiHow staff writer, Hannah Dillon. Stan Kats is a Professional Technologist and the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan holds a BA in International Relations from The University of Southern California. He began his career working in the Fortune 500 IT world. Stan founded his companies to offer an enterprise-level of expertise for small businesses and individuals.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 11,455 times.
If you're on one of the Linux distributions based on Red Hat, such as Fedora, CentOS, Rocky Linux, or RHEL, you may be wondering how you can use yum to update your packages. Thankfully, updating your packages with yum is simple: just run the yum update command. You can also use yum to update only the packages that have pending updates—keep reading to learn how.
Quick Steps
- Open the terminal.
- Check for package updates with yum check-update (optional).
- Type yum update, but don't run it yet.
- Add package names after the update command, or leave it blank to update all packages.
- Press Enter to run the command.
Steps
-
Open the terminal. You can do this by pressing Ctrl+Alt+T on your keyboard. Alternatively, you can press the super user (Windows) key on your keyboard to open the Activities menu and search for "terminal".
-
Check for package updates (optional). If you prefer, you can check for any available package updates with the "check-update" subcommand. If you already know what packages you need to update or you just want to update them all, you can skip this step.
- In the terminal, write yum check-update and press Enter.
- All of the packages that yum can update will be listed.
Advertisement -
Run the update command for some or all of your packages. To do this, type yum update. Without any package names with it, the yum update command will try to update every package you have.[1]
- To specify a package (like the ones found in Step 3 with "check-update"), type its name after the yum update command.
- Once the packages are done updating, you can close out of the terminal.
Expert Q&A
Video
Tips
-
In RHEL 8 and RHEL 9, software management is based on dnf.[2] However, yum commands have been maintained (as a dnf symlink in RHEL 8 and a dnf alias in RHEL 9) to ensure compatibility with RHEL 7.Thanks
-
If you are restricted from using the yum command, put the sudo command before it (i.e. sudo yum update). Just note that when you use sudo, you'll have to verify the super user (admin) password for verification.Thanks
-
You can also use yum upgrade instead of yum update. The yum upgrade command will update your packages and delete obsolete ones. As such, yum update is the safer update option, so you don't lose the packages you're currently using.Thanks