jst*_*rdo 1 mysql mysql-python centos7
我有刚在托管公司中创建的CentOS 7。
我需要安装依赖于MySQL-python软件包的应用程序。
我试图安装该软件包,但它不可用:
root@vps [/var/frappe]# yum install MySQL-python
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 208.100.0.204
* base: ftpmirror.your.org
* epel: mirror.steadfastnet.com
* extras: ftpmirror.your.org
* ius: muug.ca
* updates: ftpmirror.your.org
No package MySQL-python available.
Error: Nothing to do
root@vps [/var/frappe]#
Run Code Online (Sandbox Code Playgroud)
为什么我不能安装它?一些解决方法?
编辑:
/etc/yum.conf
[main]
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* p0f php* proftpd* pure-ftpd* spamassassin* squirrelmail*
tolerant=1
errorlevel=1
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=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
Run Code Online (Sandbox Code Playgroud)
该软件包将在base存储库中可用:
$ yum whatprovides MySQL-python
MySQL-python-1.2.5-1.el7.x86_64 : An interface to MySQL
Repo : base
Run Code Online (Sandbox Code Playgroud)
以供参考:
$ cat /etc/yum.repos.d/centos.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/7/os/$basearch/
gpgcheck=1
enabled=1
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Run Code Online (Sandbox Code Playgroud)
所提供的看起来非常可疑的yum.conf是配置exclude=mysql*与所需的软件包名称完全匹配。您要么必须删除该一种exclude模式才能安装。或安装包的MySQL蟒蛇有pip install MySQL-python。
确认不需要其他软件包的RPM依赖项:MySQL-pythonMySQL
$ repoquery --requires --resolve MySQL-python
python-0:2.7.5-76.el7.x86_64
python-libs-0:2.7.5-76.el7.x86_64
MariaDB-compat-0:10.2.22-1.el7.centos.x86_64
glibc-0:2.17-260.el7.i686
mariadb-libs-1:5.5.60-1.el7_5.x86_64
zlib-0:1.2.7-18.el7.x86_64
glibc-0:2.17-260.el7.x86_64
openssl-libs-1:1.0.2k-16.el7.x86_64
Run Code Online (Sandbox Code Playgroud)
该文档还说明了我想告诉的内容:
exclude从所有存储库中排除的软件包列表,因此
yum就像该软件包从未在存储库中一样工作。这应该是一个用空格分隔的列表。这是常用的,因此不会意外升级或安装软件包,但可以以任何yum list显示软件包的方式删除软件包。允许使用通配符(例如*和?)的Shell glob 。
最佳解决方案是:编辑/etc/yum.conf然后用类似的方式替换exclude模式-这样仍将服务器,客户端和库排除在外,但允许安装软件包。mysql*mysql-server* mysql-client* mysql-libs*MySQLMySQL-python
解决这个问题的方法甚至很简单(请注意,以后将无法找到更新):
sudo yum install MySQL-python --disableexcludes=all
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
242 次 |
| 最近记录: |