RedHat install MySql: conflicts with file from package mysql-libs

本文详细记录了解决Red Hat系统中MySQL依赖冲突的过程,包括遇到的问题、解决方案和最终成功安装MySQL Server的步骤。通过删除相关依赖包,作者顺利解决了依赖问题并完成了MySQL的安装。

弄了一天终于 在redhat 上装上了 mysql-server。写此文主要是mark一下

主要问题:

装 mysql-server 出现下列依赖问题

file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.5.17-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64

之前还没太注意这个问题,又去用yum 结果repo的问题,没有mysql-server available~郁闷啊~结果又去找yum mysql 源,找到个不错的

http://www.ha97.com/4052.html  恩很兴奋~之后又出现错误 又是依赖关系 需要Perl-DBD-mysql 额~去找啊找。。。。sigh。。不管怎样,走了很多弯路,根本原因就是原来的系统中已经装了个老一点的包引起的冲突~

 mysql-libs-5.1.52-1.el6_0.1.x86_64
所以最后回来,发现这个问题(汗~os早就告诉你了,结果我也没太看清conflicts 这个词~关键自己linux没学过什么东西基本的语句还要去现查,唉~要多学点东西啊)

恩~之后看到了http://blog.youkuaiyun.com/monkey_d_meng/article/details/5573610 恩~照着删除依赖的包,结果发现又是一层依赖,很多层依赖,自己就虚了~结果接着查

看到了http://blog.youkuaiyun.com/huangbiao86/article/details/6650477 发现一条必杀技能啊!!依赖关系的克星(其实我真怕把这么多 东西删掉会不会出现什么问题,豁出去了!!!删!!!!!亮必杀计!!!!!!!!!!)


直接必杀技(管你有多少层多少个依赖关系):

yum -y remove mysql-libs-5.1.52*        -y 的意思就是remove 前,不用询问。 


真是一站式服务啊:

========================================================================
 Package        Arch   Version           Repository                Size
========================================================================
Removing:
 mysql-libs     x86_64 5.1.52-1.el6_0.1  @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                  4.0 M
Removing for dependencies:
 cronie         x86_64 1.4.4-7.el6       @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                  166 k
 cronie-anacron x86_64 1.4.4-7.el6       @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                   43 k
 crontabs       noarch 1.10-32.1.el6     @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                  2.4 k
 postfix        x86_64 2:2.6.6-2.1.el6_0 @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                  9.7 M
 redhat-lsb     x86_64 4.0-3.el6         @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                   22 k
 sysstat        x86_64 9.0.4-18.el6      @anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1
                                                                  806 k

Transaction Summary
========================================================================
Remove        7 Package(s)

Installed size: 15 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Erasing    : redhat-lsb-4.0-3.el6.x86_64                          1/7
  Erasing    : sysstat-9.0.4-18.el6.x86_64                          2/7
  Erasing    : cronie-anacron-1.4.4-7.el6.x86_64                    3/7
  Erasing    : crontabs-1.10-32.1.el6.noarch                        4/7
  Erasing    : cronie-1.4.4-7.el6.x86_64                            5/7
  Erasing    : 2:postfix-2.6.6-2.1.el6_0.x86_64                     6/7
  Erasing    : mysql-libs-5.1.52-1.el6_0.1.x86_64                   7/7
duration: 221(ms)
Installed products updated.

Removed:
  mysql-libs.x86_64 0:5.1.52-1.el6_0.1

Dependency Removed:
  cronie.x86_64 0:1.4.4-7.el6      cronie-anacron.x86_64 0:1.4.4-7.el6
  crontabs.noarch 0:1.10-32.1.el6  postfix.x86_64 2:2.6.6-2.1.el6_0
  redhat-lsb.x86_64 0:4.0-3.el6    sysstat.x86_64 0:9.0.4-18.el6

Complete!

好爽快啊!!之后rpm 安装已经下载好的mysql-server rpm包。

Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

真爽快啊!!

在此感谢 优快云 的 

MONKEY_D_MENG


http://blog.youkuaiyun.com/monkey_d_meng/article/details/5573610



huangbiao86


http://blog.youkuaiyun.com/huangbiao86/article/details/6650477 




[root@MiWiFi-R1CM-srv ~]# preupg --riskcheck --verbose INPLACERISK: EXTREME: You have GNOME Desktop Environment session as an option in your X11 session manager. GNOME Desktop Environment as a part of the yum group 'Desktop' underwent serious redesign in its user interface as well as underlying technologies in CentOS 7. INPLACERISK: HIGH: You have some of the KDE Desktop yum group packages installed in your system. KDE Desktop Environment that was provided by this group of packages underwent a redesign in its user interface as well as underlying technologies in CentOS 7. INPLACERISK: HIGH: We detected some non-CentOS signed packages, you can find the list in /root/preupgrade/./kickstart/noncentospkgs. You need to handle them yourself! INPLACERISK: HIGH: After upgrading to CentOS 7 there are still some el6 packages left. Add --cleanup-post option to redhat-upgrade-tool if you want to remove them automatically. INPLACERISK: HIGH: There were changes in SELinux policies between CentOS 6 and CentOS 7. Please, check solution in order to resolve this issue. INPLACERISK: HIGH: File /etc/rc.d/rc.local was changed INPLACERISK: MEDIUM: Your last X11 session loaded module 'mga' that was deprecated in CentOS 7. INPLACERISK: MEDIUM: We detected some packages installed on the system were removed (obsoleted) between CentOS 6 and CentOS 7. This may break the functionality of the packages depending on them. INPLACERISK: MEDIUM: We detected some packages installed on the system were removed between CentOS 6 and CentOS 7. This may break the functionality of the packages depending on them. INPLACERISK: MEDIUM: Package xorg-x11-drv-cirrus not provided by its replacement xorg-x11-drv-modesetting. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ql2100-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package rt61pci-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package xorg-x11-drv-mga not provided by its replacement xorg-x11-drv-modesetting. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package coreutils-libs not provided by its replacement coreutils. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package rt73usb-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ql2400-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ql2200-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package redhat-lsb-graphics not provided by its replacement redhat-lsb-desktop. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package NetworkManager-gnome not provided by its replacement nm-connection-editor,network-manager-applet. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package bfa-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ibus-pinyin not provided by its replacement ibus-libpinyin. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package libudev not provided by its replacement systemd-libs. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ql23xx-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package ql2500-firmware not provided by its replacement linux-firmware. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: Package xorg-x11-drv-ast not provided by its replacement xorg-x11-drv-modesetting. In-place upgrade might not work properly, will be finished by postupgrade script! INPLACERISK: MEDIUM: having one of [glx-utils redhat-menus kpartx tzdata mesa-libGLU openscap] package installed breaks upgrade INPLACERISK: MEDIUM: We detected some soname bumps in the libraries installed on the system. This may break the functionality of some of your 3rd party applications. They may need rebuild. Please check their requirements. INPLACERISK: MEDIUM: We detected some .so libraries installed on the system were removed between CentOS 6 and CentOS 7. This may break the functionality of some of your 3rd party applications. INPLACERISK: SLIGHT: We detected some files where modifications are not tracked in the rpms. You may need to check their functionality after successful upgrade. INPLACERISK: SLIGHT: We detected some files untracked by rpms. Some of these may need manual check/migration after redhat-upgrade-tool and/or can cause conflicts or troubles during the installation. Try to reduce unnecessary untracked files before running redhat-upgrade-tool. INPLACERISK: SLIGHT: We detected some packages installed on the system changed their name between CentOS 6 and CentOS 7. Although they should be compatible, monitoring after the update is recommended. INPLACERISK: SLIGHT: Some binaries untracked by RPM were discovered on the system and may need rebuild after upgrade. INPLACERISK: SLIGHT: Some scripts untracked by RPM were discovered on the system and may not work properly after upgrade. INPLACERISK: SLIGHT: /usr/lib64/python2.6/site-packages/gtk-2.0 is owned by an RPM package that was not signed by CentOS. INPLACERISK: SLIGHT: /usr/lib64/python2.6/site-packages/report is not owned by any RPM package. INPLACERISK: SLIGHT: /usr/lib64/python2.6/site-packages/reportclient is not owned by any RPM package.
最新发布
10-15
<think>我们面对的问题:在使用yum安装软件包时出现文件冲突错误,具体为`file conflicts between centos-linux-release and opencloudos-release`。 引用[3]中提到了类似的冲突(firefox和nss的冲突),但我们的冲突是centos-linux-release和opencloudos-release之间的冲突。 分析: 这个冲突通常是因为系统中同时存在CentOS和OpenCloudOS的release包,这两个包都提供了相同的文件(比如一些系统标识文件),导致冲突。 解决方法: 我们需要移除其中一个release包。由于OpenCloudOS可能是我们想要升级到的系统,而CentOS是原有系统,因此我们需要根据实际情况决定保留哪一个。 步骤: 1. 确认当前系统情况: 查看当前系统版本,确认我们是想保留CentOS还是升级到OpenCloudOS。 使用命令: cat /etc/redhat-release 或者 cat /etc/os-release 2. 根据目标决定操作: 情况1:如果希望保留CentOS,则移除OpenCloudOS的release包。 情况2:如果希望升级到OpenCloudOS,则移除CentOS的release包。 3. 移除冲突的包: 假设我们想保留CentOS,则移除opencloudos-release: sudo yum remove opencloudos-release 假设我们想保留OpenCloudOS,则移除centos-linux-release: sudo yum remove centos-linux-release 4. 再次尝试安装: 移除冲突的包之后,再执行原来的安装命令。 注意:在移除release包时要谨慎,因为release包通常包含软件源信息,移除后可能会影响后续的软件安装(特别是如果移除了当前系统对应的release包,那么软件源配置可能需要重新调整)。因此,建议在操作前备份相关文件(如/etc/yum.repos.d/下的文件)。 5. 如果冲突仍然存在,可能需要检查是否有其他包依赖了这两个release包,或者尝试强制移除(使用rpm命令): sudo rpm -e --nodeps centos-linux-release # 强制移除centos-linux-release,忽略依赖 sudo rpm -e --nodeps opencloudos-release # 强制移除opencloudos-release,忽略依赖 但是强制移除可能会影响系统的稳定性,请谨慎使用。 6. 重新生成缓存: sudo yum clean all sudo yum makecache 引用[1]中提到了更新yum源,引用[2]中提到了升级系统版本,引用[3]中提到了解决冲突的方法(卸载冲突的包)。我们可以参考这些方法。 根据引用[3]的提示,我们可以通过卸载冲突的包来解决。因此,我们采用上述步骤3的方法。 具体操作步骤: 步骤一:查看当前系统信息 cat /etc/os-release 步骤二:确定要保留的系统 例如,如果输出中包含CentOS,则保留CentOS;如果已经迁移到OpenCloudOS,则保留OpenCloudOS。 步骤三:移除不需要的release包 以保留CentOS为例: sudo yum remove opencloudos-release 步骤四:再次执行安装命令 如果问题仍然存在,可能是由于其他原因,需要进一步检查。 注意:在操作前,建议备份重要数据。 相关问题: 1. 如何查看Linux系统版本信息? 2. 如何安全地移除冲突的RPM包? 3. 如何解决多个软件源冲突的问题? 4. 升级操作系统版本时需要注意什么? 5. 如何备份和恢复yum软件源配置?</think>### 解决 yum install 文件冲突错误:centos-linux-release vs opencloudos-release 当出现 `file conflicts between centos-linux-release and opencloudos-release` 错误时,表明系统同时存在 CentOS 和 OpenCloudOS 的发行包,导致关键文件冲突。以下是完整解决方案: #### 1. **确认冲突文件位置** ```bash rpm -ql centos-linux-release opencloudos-release | grep -i release # 输出示例: # /etc/centos-release # /etc/opencloudos-release ``` 通常冲突文件是 `/etc/*-release` 系列系统标识文件[^2]。 #### 2. **强制移除冲突包(二选一)** ▸ **保留 CentOS 系统**: ```bash sudo rpm -e --nodeps opencloudos-release sudo yum reinstall centos-linux-release ``` ▸ **保留 OpenCloudOS 系统**: ```bash sudo rpm -e --nodeps centos-linux-release sudo yum reinstall opencloudos-release ``` `--nodeps` 参数忽略依赖检查强制移除[^3]。 #### 3. **清理并重建 yum 缓存** ```bash sudo yum clean all sudo rm -rf /var/cache/yum sudo yum makecache ``` #### 4. **验证系统一致性** ```bash # 检查当前生效的系统 cat /etc/*-release # 验证包完整性 rpm -Va | grep -E 'centos|opencloudos' ``` #### 5. **修复残留配置文件** 如果仍报错,手动清理残留文件: ```bash # 查找冲突文件 sudo rpm --verify -a | grep -E 'centos|opencloudos' # 示例清理(根据实际输出调整) sudo rm -f /etc/centos-release /etc/opencloudos-release sudo yum reinstall $(rpm -qf /etc/os-release) ``` ### 冲突原因分析 | 原因 | 说明 | 解决方案 | |------|------|----------| | **双系统标识** | 同时存在 CentOS 和 OpenCloudOS 的发行文件 | 移除其中一个发行包 | | **升级残留** | 系统迁移未完全清理旧包 | 手动清理残留文件 | | **仓库混合** | 同时启用 CentOS 和 OpenCloudOS 仓库 | 禁用不使用的仓库 | | **强制安装** | 使用 `--force` 参数覆盖安装导致 | 重建 RPM 数据库 | ### 预防措施 1. **系统迁移时彻底清理旧包**: ```bash sudo yum remove \*centos\* --setopt=clean_requirements_on_remove=1 ``` 2. **避免混合仓库**: ```bash # 禁用冲突仓库 sudo yum-config-manager --disable opencloudos* ``` 3. **重要操作前备份**: ```bash sudo tar -czvf rpm_backup.tar.gz /var/lib/rpm /etc/yum.repos.d ``` > ⚠️ 注意:此操作涉及系统核心组件,建议先在测试环境验证。操作后使用 `yum check` 验证完整性。
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值