
To exclude mongodb repository, open the mongodb repository file, and set change the value of enabled to 0 as shown below. rw-r-r- 1 root root 142 mongodb-org-3.0.repo The repository configuration files are located under /etc/ directory as shown below. Instead of excluding a specific repository from yum update command line, you can permanently exclude a package from yum update by setting the enabled parameter to 0 in the repository configuration file. Exclude a Repository from Yum Update using Enabled Parameter (Method 2) You can get the exact repository name that you want to exclude by looking at the 1st column of the “yum repolist” command output. The following will exclude packages that belongs to Docker repository during yum update. You can also specify the –disablerepo option at the end after yum update. In the following example, yum update will upgrade all installed packages except any installed packages that belongs to MongoDB repository. This will not upgrade the packages that belongs to the given repository name. You can use the option –disablerepo=repository-name along with yum update. Exclude a Repository from Yum Update (Method 1) If you are new to yum command: 15 Linux Yum Command Examples – Install, Uninstall, Update Packages 2. If you don’t want to upgrade mongodb when you do “yum update”, you should exclude that during yum update as explained in the following section.Īlso, if you want to know which repository a particular package belongs to, so that you can exclude that repository from getting upgraded, use yum info command as shown below. If you already have mongodb installed on your system, and when you execute the above “yum update”, it will also upgrade mongodb packages to the latest version. When you do yum update as shown below, it will upgrade all the packages that are already installed on your system to the latest version available from all of the above repositories. mongodb-org-3.0 is a 3rd party repository that contains MongoDB related packages.dockerrepo is a 3rd party repository that contains Docker container related packages.The first three repositories listed above are the main CentOS repositories: base, extras and updates.In the above example, we have the following: To view all the available repositories on your system, execute yum repolist as shown below.


How can I exclude a specific repository during yum update?Ī: During yum update, to exclude packages that belongs to a specific repository, use any one of the two methods explained in this tutorial.Īlso, keep in mind that instead of excluding a whole repository, you can also exclude a specific package: 10 Yum Exclude Examples to Skip Packages for Linux Yum Update (How to Yum Exclude Kernel Updates) 1. When I execute yum update command, installed packages from all the repositories are updated.

For example, centos, epel, docker, mongo, etc. Q: I have multiple yum repositories on my system.
