【oracle报错】/usr/bin/ksh conflicts between attempted installs of pdksh-5.2.14-30.x86_64

在Centos7.5上安装Oracle11.2.0.4时遇到PDKSH包冲突问题,尝试安装pdksh-5.2.14-30.x86_64.rpm出现文件冲突错误。通过对比不同版本的PDKSH包发现,问题在于特定版本之间的不兼容。

  /usr/bin/ksh conflicts between attempted installs of pdksh-5.2.14-30.x86_64

场景:
系统---        Centos7.5
数据库--    Oracle 11.2.0.4

描述:
在安装oracle的检查那一步骤发现缺少pdksh包,然后将pdksh-5.2.14-30.x86_64.rpm上传到服务器,并安装,
报下面的错:
file /usr/bin/ksh conflicts between attempted installs of pdksh-5.2.14-30.x86_64 and pdksh-5.2.14-30.x86_64

解决:
起初以为是ksh包和pdksh包冲突,检查ksh包是否存在
# rpm -qa ksh
然而并不存在这个包,更不用说卸载了,安装的pdksh包为:pdksh-5.2.14-30.x86_64.rpm;
然后无意中之前在centos7安装过的pdksh包为:pdksh-5.2.14-36.el5.x86_64.rpm;

尝试安装这个包再次检查,既然能通过,看来果然是这个pdksh包版本的问题。

 

[root@lumingdong tool]# rpm -ivh mysql-community-common-*.rpm warning: mysql-community-common-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-common-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-libs-*.rpm warning: mysql-community-libs-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-libs-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-client-*.rpm warning: mysql-community-client-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] package mysql-community-client-5.7.22-1.el7.x86_64 is already installed [root@lumingdong tool]# rpm -ivh mysql-community-server-*.rpm warning: mysql-community-server-5.7.22-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] file /usr/bin/mysql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqladmin from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqldump from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /usr/bin/mysqlpump from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-client-5.7.22-1.el7.x86_64 file /etc/my.cnf from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/my_print_defaults from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /var/lib/mysql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_install_db from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_ssl_rsa_setup from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_tzinfo_to_sql from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/bin/mysql_upgrade from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/adt_null.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/auth_socket.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/authentication_ldap_sasl_client.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/connection_control.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/group_replication.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/innodb_engine.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_file.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_udf.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/libmemcached.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/locking_service.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mypluglib.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysql_no_login.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysqlx.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewrite_example.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewriter.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_master.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_slave.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/validate_password.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/version_token.so from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 file /usr/sbin/mysqld from install of mysql-community-server-minimal-5.7.22-1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.22-1.el7.x86_64 package mysql-community-server-5.7.22-1.el7.x86_64 is already installed file /etc/my.cnf conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/my_print_defaults conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_install_db conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_ssl_rsa_setup conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_tzinfo_to_sql conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/bin/mysql_upgrade conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/adt_null.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/auth_socket.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/authentication_ldap_sasl_client.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/connection_control.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/group_replication.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/innodb_engine.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_file.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/keyring_udf.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/libmemcached.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/locking_service.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mypluglib.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysql_no_login.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/mysqlx.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewrite_example.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/rewriter.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_master.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/semisync_slave.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/validate_password.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/lib64/mysql/plugin/version_token.so conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /usr/sbin/mysqld conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 file /var/lib/mysql conflicts between attempted installs of mysql-community-server-5.7.22-1.el7.x86_64 and mysql-community-server-minimal-5.7.22-1.el7.x86_64 [root@lumingdong tool]# chown -R mysql:mysql /var/log/mysqld.logchown -R mysql:mysql /var/log/mysqld.log chown: cannot access ‘/var/log/mysqld.logchown’: No such file or directory chown: cannot access ‘mysql:mysql’: No such file or directory [root@lumingdong tool]# chmod 755 /var/log/mysqld.log [root@lumingdong tool]# systemctl start mysqld Failed to get D-Bus connection: No such file or directory [root@lumingdong tool]#
最新发布
08-15
<think>我们正在处理在Linux子系统(如WSL)中安装MySQL 5.7.22 RPM包时出现的冲突和签名警告,以及安装后无法启动mysqld服务的问题。根据用户提供的上下文,我们已知以下信息: - 用户有一个包含多个RPM包的目录,包括`mysql-community-common`、`mysql-community-libs`等。 - 安装过程中可能遇到依赖冲突(如与mariadb-libs的冲突)和签名警告(GPG签名验证失败)。 - 安装后无法启动mysqld服务,可能是由于权限问题或初始化失败。 我们将按照以下步骤解决: 1. 解决依赖冲突(特别是mariadb-libs)。 2. 处理GPG签名警告。 3. 按正确顺序安装RPM包。 4. 初始化MySQL并启动服务,处理可能出现的权限问题。 注意:在Linux子系统中,尤其是WSL1,systemd可能不被支持,因此我们使用传统的service命令。 具体步骤: ### 步骤1: 解决依赖冲突(mariadb-libs) 在安装MySQL之前,需要移除系统上可能存在的冲突包(如mariadb-libs)。使用以下命令: ```bash yum remove mariadb-libs --nodeps ``` `--nodeps`选项表示忽略依赖关系强制卸载,但需谨慎使用,因为可能破坏其他软件依赖。但在纯净的Linux子系统中,通常不会影响其他关键软件。 ### 步骤2: 处理GPG签名警告 在安装RPM包时,可能会遇到GPG签名验证失败。可以通过导入MySQL的GPG密钥来解决: ```bash rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql ``` 或者在安装时跳过签名检查(不推荐,但在测试环境中可以使用): ```bash rpm -ivh --nodeps --force mysql-community-*.rpm ``` 但更安全的方式是导入密钥后正常安装。 ### 步骤3: 按顺序安装RPM包 必须按照依赖顺序安装,否则会失败。参考[^1][^2]中的顺序: ```bash rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm ``` 如果出现依赖错误,可以尝试使用`--nodeps`选项(但后续可能还需要安装其他依赖,如`libaio`、`numactl`等): ```bash yum install libaio numactl ``` ### 步骤4: 初始化MySQL并启动服务 安装完成后,需要初始化MySQL数据目录并启动服务: ```bash # 初始化数据库(生成初始root密码) mysqld --initialize --user=mysql # 确保数据目录权限正确 chown -R mysql:mysql /var/lib/mysql # 启动mysqld服务 service mysqld start # 或者使用 systemctl start mysqld(如果支持) # 查看服务状态 service mysqld status ``` ### 步骤5: 获取临时密码并登录 初始化后,MySQL会生成一个临时密码,位于日志文件中: ```bash grep 'temporary password' /var/log/mysqld.log ``` 使用该密码登录并修改root密码: ```bash mysql -u root -p ``` 在MySQL中执行: ```sql ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码'; ``` 注意:新密码必须符合密码策略(至少8位,包含大小写字母、数字和特殊字符)。如果希望使用简单密码,可以先修改策略: ```sql SET GLOBAL validate_password_policy=LOW; SET GLOBAL validate_password_length=4; ALTER USER 'root'@'localhost' IDENTIFIED BY '简单密码'; ``` ### 步骤6: 设置开机启动(可选) ```bash chkconfig mysqld on # 对于SysV系统 # 或者 systemctl enable mysqld # 对于systemd系统 ``` ### 常见问题及解决 1. **启动失败**:检查`/var/log/mysqld.log`中的错误信息。常见错误包括: - 数据目录权限问题:确保`/var/lib/mysql`的所有者是mysql用户(`chown -R mysql:mysql /var/lib/mysql`)。 - 端口冲突:确保3306端口没有被其他程序占用。 - 内存不足:MySQL初始化需要一定内存,如果子系统内存不足,尝试增加内存或使用交换空间。 2. **SELinux问题**:如果系统启用了SELinux,可能导致权限问题。可以临时禁用SELinux: ```bash setenforce 0 ``` 或者永久禁用:修改`/etc/selinux/config`,设置`SELINUX=permissive`。 3. **WSL中systemd支持问题**:WSL默认不使用systemd,因此`systemctl`命令可能无效。可以使用以下方法启动服务: ```bash /etc/init.d/mysqld start # 使用SysV脚本启动 ``` 或者安装systemd替代方案(如genie)[^4]。 ### 总结 通过以上步骤,应该能够解决在Linux子系统中安装MySQL 5.7.22时遇到的依赖冲突、签名验证和启动失败问题。关键点包括: - 移除冲突的mariadb-libs包。 - 导入GPG密钥或跳过签名检查。 - 按顺序安装RPM包并安装必要依赖。 - 初始化数据库并正确设置权限。 - 根据日志排查启动失败原因。 §§相关问题§§ 1. 如何在WSL中启用systemd支持以使用systemctl命令? 2. 如何调整MySQL的密码策略以允许简单密码? 3. 如何解决MySQL启动时的“无法绑定端口”错误? 4. 如何配置MySQL的远程访问权限? [^1]: mysql-linux安装教程。 [^2]: 解包mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar得到多个RPM包。 [^3]: MySQL 5.7 RPM包的下载地址。 [^4]: mysql5.7.22安装步骤。</think>### 解决Linux子系统下MySQL 5.7.22安装问题 #### 步骤1: 解决依赖冲突和签名警告 ```bash # 1. 强制移除冲突的mariadb-libs yum remove mariadb-libs.x86_64 --nodeps # 2. 导入MySQL GPG密钥解决签名警告 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 # 3. 按顺序安装核心组件 rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm ``` > **关键点**:必须按此顺序安装,否则会出现依赖错误[^1][^2] #### 步骤2: 修复mysqld服务启动失败 ```bash # 1. 修复数据目录权限 mkdir -p /var/lib/mysql chown -R mysql:mysql /var/lib/mysql # 2. 初始化数据库(生成临时root密码) mysqld --initialize --user=mysql # 3. 修复日志文件权限 chown mysql:mysql /var/log/mysqld.log chmod 660 /var/log/mysqld.log # 4. 启动服务 systemctl start mysqld ``` #### 步骤3: 获取初始密码并重置 ```bash # 1. 查看生成的临时密码 grep 'temporary password' /var/log/mysqld.log # 2. 使用临时密码登录 mysql -u root -p # 3. 在MySQL中重置密码 ALTER USER 'root'@'localhost' IDENTIFIED BY '您的新密码'; # 4. 降低密码策略强度(可选) SET GLOBAL validate_password_policy=LOW; ``` #### 步骤4: 验证安装 ```bash # 检查服务状态 systemctl status mysqld # 测试连接 mysql -u root -p -e "SELECT VERSION();" ``` ### 常见问题解决方案 1. **文件权限错误**: ```bash chown -R mysql:mysql /var/lib/mysql chmod 750 /var/lib/mysql ``` 2. **端口冲突**: ```bash netstat -tuln | grep 3306 # 若端口被占用,修改/etc/my.cnf中的端口号 ``` 3. **SELinux阻止**: ```bash setenforce 0 # 临时关闭 # 或修改/etc/selinux/config永久关闭 ``` 4. **WSL特殊问题**: ```bash # 手动启动服务(适用于WSL1) /usr/sbin/mysqld --user=mysql & ``` > **重要提示**:安装完成后立即从日志中获取临时密码,否则重启后可能丢失访问权限[^1]
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值