• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Disable/Lock Certain Package Updates Using Yum Command

{{postValue.id}}

To Disable/Lock Certain Package Updates Using Yum Command

In this article we will discuss how to Disable/Lock Certain Package Updates Using Yum Command.


Disable/lock package permanently

Open the configuration file /etc/yum.conf and enter the following entry into this file.
main_repository
In this configuration I have entered exclude option newly, this exclude option is used to block which package you want to block. You can enter single package or multiple packages into that exclude option for disabling installation and upgradation.
After done the setting in that configuration file save and close the file and try to install or update the package which was entered in that configuration file and see the result below

[root@linuxhelp Desktop]# yum update httpd
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                         | 5.0 kB     00:00     
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
.
.
.
remi-test                                                                                             | 2.9 kB     00:00     
updates                                                                                               | 3.4 kB     00:00     
No Packages marked for Update

Finally it shows " No packages marked for Update" now that particular package is successfully blocked.


Disable or lock the package temporarily

To disable or lock the package temporarily, use yum command with --exclude option or -x option. Now enter the package which you want to block after the --exclude option.

[root@linuxhelp Desktop]# yum --exclude vim update
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
-->  Package vim-enhanced-7.4.629-5.el6.x86_64 will be installed
-->  Finished Dependency Resolution
.
.
.
Installed:
vim-enhanced-7.4.629-5.el6.x86_64 is installed.
Complete!

After exclude the package now update that package to see the result.

[root@linuxhelp Desktop]# yum update vim
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
.
.
.
* updates: centos.excellmedia.net
No Packages marked for Update

Now the update for that particular package is blocked.


Disable package updates using repository

Generally there will be many packages installed from any external source. You can stop the packages from being installed via adding a repository. There is another way to stop its up-gradation in future by editing .repo which was created in /etc/yum/repos.d
epel_repository
I have chosen epel repo and add exclude option enter which package want to block for install and update in future.

Now update the package which was excluded in epel.repo file

[root@linuxhelp Desktop]# yum update ajenti
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                         | 5.0 kB     00:00     
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
.
.
.
* updates: centos.excellmedia.net
epel                                                                                                  | 4.3 kB     00:00     
No Packages marked for Update

Now the package ajenti was blocked successfully.


Disable package update using versionlock

Install the version lock package, before you block the updates of particular package.

[root@linuxhelp Desktop]# yum install yum-versionlock
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
.
.
.
Updated:
yum-plugin-versionlock.noarch 0:1.1.30-37.el6                                                                              

Complete!

Once you installed version lock you should add that particular package into version lock for disabling update in future.

[root@linuxhelp Desktop]# yum versionlock add samba
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Adding versionlock on: 0:samba-3.6.23-30.el6_7
versionlock added: 1

Now check that particular package will be add into version lock by using below command.
[root@linuxhelp Desktop]# yum versionlock list samba
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI

0:samba-3.6.23-30.el6_7.*
versionlock list done

Now try to update that locked package and see the result.

[root@linuxhelp Desktop]# yum update samba
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
.
.
.
* updates: centos.excellmedia.net
No Packages marked for Update

Again the result shows no packages for update

Tags:
jayce
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

I have daily cron job running with rpm --last command which helps me to trace the new packages installation. I want to stop this automatic updation of packages

A

add those packages to /etc/yum.conf

Q

I want to disable the auto update for all packages.

A

You can use exclude option in "/etc/yum.conf"

Q

How to check the repo name with yum?

A

Try "yum whatprovides packagename"

Q

Can list the available packages?

A

Run the following command:

# yum list tigervnc

Q

How can I search a Particular package?

A

Execute the following command to search the particular package:

# yum search vnc

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.