When running yum update
on CentOS/RHEL systems, you might encounter this output:
118 packages excluded due to repository priority protections
Setting up Update Process
No Packages marked for Update
This occurs when YUM's priorities
plugin is enabled and configured to protect certain repositories from being overridden by others.
The priorities plugin assigns numeric values to repositories (lower numbers = higher priority). When multiple repositories offer the same package:
# Example /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1
check_obsoletes = 1
To view repository priorities:
yum repolist -v | grep -E 'Repo-id|Priority'
# or for a specific package:
repoquery --queryformat="%{name} | %{version} | %{repoid}" package_name
1. Temporarily Disable Priorities
For a single transaction:
yum --disableplugin=priorities update
2. Adjust Repository Priorities
Edit repository files in /etc/yum.repos.d/
:
[updates]
name=CentOS Updates
priority=1 # Highest priority
enabled=1
3. Force Installation from Specific Repo
yum install --enablerepo=epel package_name
- Always test priority changes in staging first
- Document your repository hierarchy
- Consider using
yum-versionlock
for critical packages
If PHP packages are being excluded:
# Check available versions
yum --showduplicates list php
# Install specific version from desired repo
yum install php-7.4.33 --enablerepo=remi-safe
When you see the message "packages excluded due to repository priority protections" during a yum update
or dnf update
, it means your system's package manager is preventing certain packages from being updated or installed due to configured repository priorities.
The priorities plugin for YUM/DNF allows you to assign priority values to repositories, with lower numbers indicating higher priority. When multiple repositories contain the same package:
[main]
enabled=1
gpgcheck=1
priority=1 # Highest priority
Packages are excluded when:
- A higher priority repository contains an older version of the package
- You're trying to install from a lower priority repository when a higher one has the package
- Version conflicts exist between repositories
To view your current repository priorities:
yum repolist -v | grep -E 'Repo-id|Priority'
# Or for DNF:
dnf repolist -v | grep -E 'Repo-id|Priority'
Option 1: Temporarily Disable Priorities
For a one-time update:
yum --disableplugin=priorities update
# Or for DNF:
dnf --disableplugin=priorities update
Option 2: Adjust Repository Priorities
Edit the repository configuration file (usually in /etc/yum.repos.d/
):
[myrepo]
name=My Custom Repo
baseurl=http://example.com/repo
enabled=1
priority=10 # Lower number = higher priority
Option 3: Force Installation from Specific Repo
To install a package from a specific repository regardless of priorities:
yum --disablerepo=* --enablerepo=myrepo install package-name
# Or for DNF:
dnf --disablerepo=* --enablerepo=myrepo install package-name
- Use meaningful priority values (1-99)
- Give higher priorities to more trusted repositories
- Document your priority scheme for future maintenance
- Consider using
protect=1
for critical system repositories