Knowledge Base
MilesWeb / How-Tos

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

Approx. read time : 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:


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.

Need help? We’re always here for you.