Introduction
Blocking package and kernel updates in CentOS or Rocky Linux can be crucial for maintaining system stability, especially in production environments. This guide will show you how to effectively block updates, ensuring your server remains consistent and reliable. This method can be particularly beneficial when hosting on a Windows VPS UK.
Prerequisites
- A CentOS or Rocky Linux server with root access
- Basic knowledge of Linux commands
Step 1: Update Your System
Before proceeding, ensure your system is up to date:
sudo dnf update -y
Step 2: Block Kernel Updates
To prevent kernel updates, create a configuration file for DNF to exclude kernel packages:
sudo nano /etc/dnf/dnf.conf
Add the following line to the configuration file:
exclude=kernel*
This will block any updates related to the kernel package.
Step 3: Block Specific Package Updates
If you wish to block specific packages, you can do so by adding them to the exclude
line in the same configuration file. For example:
exclude=kernel* httpd php
This line will block updates for both the kernel and the Apache HTTP server (httpd) as well as PHP.
Step 4: Verify the Configuration
To ensure that your configuration is correct, you can run the following command to check for available updates:
sudo dnf check-update
You should see that the blocked packages are not listed for updates.
Step 5: Using a Virtual Server
When managing a Windows VPS or any virtual private server hosting Windows, it’s crucial to implement this method to prevent unexpected downtime caused by unwanted updates.
Step 6: Conclusion
You have successfully configured your CentOS or Rocky Linux server to block package and kernel updates. This setup helps maintain system stability, especially in production environments. By using this method on a Windows VPS, you can ensure a reliable hosting experience. For additional options, explore various VPS UK Windows solutions, including Windows Virtual Private Server Hosting and Windows VPS Hosting UK for optimal server performance.