解决CentOS mysql_config not found错
2020-06-24 本文已影响0人
菠了个萝
- 安装 mysqlclient 时报 mysql_config not found 错误,原因是linux需要mysql相关的一些依赖包
yum install mysql-devel gcc gcc-devel python-devel
- 安装此依赖包时报错
Error: Package: freetds-0.91-1.el5.rf.i386 (rpmforge)
Requires: libodbcinst.so.1
Error: Package: python-psycopg-1.1.21-2.el5.rf.i386 (rpmforge)
Requires: libpq.so.4
Error: Package: python-daap-0.7.1-1.el5.rf.i386 (rpmforge)
Requires: python(abi) = 2.4
Removing: python-2.6.6-37.el6_4.i686 (@updates)
python(abi) = 2.6
Updated By: python-2.6.6-52.el6.i686 (updates)
python(abi) = 2.6
Available: python-2.6.6-51.el6.i686 (base)
python(abi) = 2.6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
这是因为默认centos自带的源少了很多好软件,所以需要添加第三方源,cd /etc/yum.repos.d/ #进入yum源目录,编辑源配置目录,参考:https://blog.csdn.net/zqtsx/article/details/39207069
以下给一份CentOS-Base.repo的配置内容,配置完之后重新安装即可:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6