Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | yum |
Time | 5m |
yum syntax to update all except Kernel
The syntax is:
yum --exclude=packgeName\* update
yum --exclude=packgeName1\* --exclude=packgeName2\* update
yum -x 'packageName*' update
yum -x 'packageName1*' -x 'packageName2*' update
Examples
To prevent yum command from updating the Kernel type:
yum -y --exclude=kernel\* update
OR
yum -y -x 'kernel*' update
How do I prevent yum from Updating the Kernel permanently?
Edit /etc/yum.conf file, enter:
# vi /etc/yum.conf
Append/modify exclude directive line under [main] section, enter:
exclude=kernel*
Save and close the file. Now, you can just run the following without passing the -x or –exclude option to yum command:
# yum -y update
See also
- Force yum update Command To Exclude Certain Packages
- See Linux yum command examples for more info
- Man pages: yum.conf(5)
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 4 comments so far... add one ↓
🐧 4 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
It suggest leaving out the ‘-y’ option in the example or at least explain its use lest someone expecting to be prompted ends up surprised.
Thanks it is useful article, I agree with Chris if we do without -y then we can verify the packages.
i need a help. I want to upgrade the packages & kernel in the servers that are running
Eg: if there are around 200 packages now who to upgrade them at once. kindly reply me
I tried this on a vm, unfortunately the kernel was still updated anyway.