我尝试在 centos 7 上安装 mysql 5.7,但出现以下错误,
我能够在不同的机器上多次成功安装 centos 7,但这是我第一次遇到这个问题。
知道为什么会发生以及如何解决吗?
# cat /etc/*-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
*
# yum install cpio -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.heanet.ie
* extras: ftp.heanet.ie
* updates: ftp.heanet.ie
Package cpio-2.11-24.el7.x86_64 already installed and latest version
Nothing to do
*
# rpm -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm
error: unpacking of archive failed on file /usr/bin/mysqladmin;585801cb: cpio: read failed - No such file or directory
error: mysql-community-client-5.7.16-1.el7.x86_64: install failed
*
* remote_file[/tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm] action create (up to date)
* rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm] action install
================================================================================
Error executing action `install` on resource 'rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm]'
================================================================================
Chef::Exceptions::Exec
----------------------
rpm -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm returned 1, expected 0
Resource Declaration:
---------------------
24: rpm_package pkg do
25: source "/tmp/#{pkg}"
26: action :install
27: end
28:
Compiled Resource:
------------------
rpm_package("mysql-community-client-5.7.16-1.el7.x86_64.rpm") do
provider Chef::Provider::Package::Rpm
action [:install]
retries 0
retry_delay 2
package_name "mysql-community-client-5.7.16-1.el7.x86_64.rpm"
source "/tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm"
version "5.7.16-1.el7"
recipe_name "mysql57_centos7"
end
ERROR: rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm] had an error: Chef::Exceptions::Exec: rpm -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm returned 1, expected 0
FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
从机器中删除 RPM 文件并再次运行 chef-client 后,我能够解决此问题并成功完成 chef-client。不知何故,文件从 chef-client 第一次在机器上运行时就损坏了。