Keeping RHEL and CentOS Systems Up to Date
RHEL systems:
To update your RHEL (Red Hat Enterprise Linux) system and install security updates, you can use the following commands:
sudo yum update --assumeno --security
sudo yum -y update --security
sudo reboot
The first command, sudo yum update --assumeno --security, allows you to preview the security updates that will be installed without actually performing the update. This gives you an opportunity to review the updates before proceeding.
The second command, sudo yum -y update --security, performs the actual update by installing the available security updates automatically without asking for confirmation. The -y flag is used to answer "yes" to all prompts during the update process, making it non-interactive.
After updating the system, it's a good practice to reboot to ensure that all the changes take effect. You can use the command sudo reboot to restart the system.
CentOS systems:
To update your CentOS system, including all available packages, you can use the following commands:
sudo yum update --assumeno
sudo yum -y update
The first command, sudo yum update --assumeno, allows you to preview the updates that will be installed without actually performing the update. This helps you review the changes before proceeding.
The second command, sudo yum -y update, performs the update by installing all available updates automatically without asking for confirmation. The -y flag is used to answer "yes" to all prompts, making the process non-interactive.
Version Locking: Protecting Specific Packages
Note: Version locking allows you to protect specific packages from being updated during system updates. This can be useful in certain scenarios where you need to maintain specific package versions for compatibility or stability reasons.
To version lock packages in RHEL or CentOS systems, follow these steps:
sudo yum versionlock python*
sudo yum versionlock qpid-proton*
The sudo yum versionlock command is used to lock the version of a package, ensuring that it will not be updated in the future. In the provided example, the versions of packages starting with "python" and "qpid-proton" are locked, preventing them from being updated when running regular system updates.
Version Unlock: Allowing Package Updates
If you need to unlock the version lock on packages and allow them to be updated, you can use the following commands:
sudo yum versionlock delete python*
sudo yum versionlock delete qpid-proton*
The sudo yum versionlock delete command is used to remove the version lock on packages. In the provided example, the version locks for packages starting with "python" and "qpid-proton" are deleted, allowing them to be updated again during
No comments:
Post a Comment