You can use the yum command to check and apply only security updates on a Red Hat or CentOS system. The yum-security plugin provides this functionality.
Here’s how you can do it:
- Install the
yum-securityplugin:sudo yum install yum-plugin-security
- Check for available security updates:
sudo yum update-minimal --security
- Apply the available security updates:
sudo yum update-minimal --security --sec-severity=Critical
Explanation:
update-minimalis ayum-securitycommand that only updates packages that have security updates available.--securityoption specifies that only security updates should be considered.--sec-severity=Criticaloption specifies that only critical security updates should be installed.
Note: The yum-security plugin is available in Red Hat Enterprise Linux and CentOS, but not in Fedora. If you’re using Fedora, you’ll need to use a different method to manage security updates.