我需要阻止mysql
更新yum update
。我添加exclude=mysql*
如下/etc/yum.conf
:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
exclude=mysql*
当我yum update
再次发出时,yum 仍在尝试更新mysql
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.5.46-1.el6.remi will be obsoleted
--> Processing Dependency: real-mysql-libs(x86-64) = 5.5.46-1.el6.remi for package: mysql-5.5.46-1.el6.remi.x86_64
--> Processing Dependency: real-mysql-libs(x86-64) = 5.5.46-1.el6.remi for package: mysql-server-5.5.46-1.el6.remi.x86_64
--> Finished Dependency Resolution
Error: Package: mysql-5.5.46-1.el6.remi.x86_64 (@remi)
Requires: real-mysql-libs(x86-64) = 5.5.46-1.el6.remi
Removing: mysql-libs-5.5.46-1.el6.remi.x86_64 (@remi)
real-mysql-libs(x86-64) = 5.5.46-1.el6.remi
Obsoleted By: Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64 (percona-release-x86_64)
Not found
Error: Package: mysql-server-5.5.46-1.el6.remi.x86_64 (@remi)
Requires: real-mysql-libs(x86-64) = 5.5.46-1.el6.remi
Removing: mysql-libs-5.5.46-1.el6.remi.x86_64 (@remi)
real-mysql-libs(x86-64) = 5.5.46-1.el6.remi
Obsoleted By: Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64 (percona-release-x86_64)
Not found
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
为什么 yum 忽略排除指令?
答案1
如果您排除,最好始终使用*name*
.您mysql*
只排除了名称以 mysql 开头的所有包。在您的示例中,它还显示real-mysql-libs
哪些不会被排除,因此它将尝试解决其依赖项,但排除了那些mysql*
依赖项。
更好地使用*mysql*
。
就其价值而言,这同样适用于存储库。例如,许多人不知道的是,yum clean all
只会清理当前启用的存储库的元数据。
使用yum clean all --enablerepo="*"
它还将清除禁用存储库的所有元数据和缓存的包等。
答案2
排除仅适用于可用包的通配符名称匹配,例如。未安装的。因此,除其他外,它不会过时。该错误表明 mysql 已被 Percona-Server-shared 淘汰。
您可以排除 Percona-Server-shared,或者您可以安装版本锁插件;告诉它遵循过时的内容;和版本锁mysql。
答案3
yum clean all
之前尝试过yum update