Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  How-Tos  >  How To Prevent YUM From Upgrading RPM’s On CentOS Server ?
Top Scroll

How To Prevent YUM From Upgrading RPM’s On CentOS Server ?

 2 min

If you wish to update all packages except few RPM’s using YUM, you can achieve it permanently/temporarily with steps below. Access your server via SSH as root user.

Permanently exclude the RPM

Use your favorite text editor to open the file /etc/yum.conf.

# vi /etc/yum.conf

Append/modify exclude directive line under [main] section, enter:

exclude=php*

Here we will exclude the PHP RPM’s. You can replace PHP with the RPM you want to exclude from being updated.

Save and close the file. Try, updating the system without updating the PHP.

# yum update -y

Temporarily exclude the RPM

Use the command below to skip update of RPM from command line.

# yum -x ‘php*’ update

Excluding the RPM’s using YUM can be done with our Linux VPS hosting packages.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.