各种linux小问题

发布于 / 主要文章 / 0 条评论

1.yum 相关命令出现这个提示:There are unfinished transactions remaining. Please run yum-complete-transaction as root.

执行以下命令:

yum install yum-utils
yum-complete-transaction

如果依然提示,再执行一遍yum-complete-transaction

2.使用centos7的软件包管理程序yum安装python-pip的时候会报以下错误:No package python-pip available

这是因为像centos这类衍生出来的发行版,他们的源有时候内容更新的比较滞后,或者说有时候一些扩展的源根本就没有。
所以在使用yum来search python-pip的时候,会说没有找到该软件包。因此为了能够安装这些包,需要先安装扩展源EPEL。
EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。

#首先安装epel扩展源:
sudo yum -y install epel-release
#然后安装python-pip
sudo yum -y install python-pip
#安装完之后别忘了清除一下cache
sudo yum clean all

3.yum grouplist时提示:

Warning: Group ...... does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

首先尝试update,无果:

则:yum clean all
再:yum group info"....."是否能看到信息

有反馈再执行yum grouplist

如果还失败,做一个缓存:

yum clean all; yum makecache; 
yum groups mark install "...."
yum groups mark convert "...."
yum groupinstall "..."

4.yum相关报:Warning: RPMDB altered outside of yum

问题不大,执行:rm -rf /var/lib/yum/history/*.sqlite

5.无法easys_install pip

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

6.用pip安装软件包时,出现如下警告

SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. 
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. 

执行:

yum install python-devel libffi-devel openssl-devel

pip install pyopenssl ndg-httpsclient pyasn1

7.pip install xxx无反应或者Could not fetch URL Links for beautifulsoup   或者  certificate verify failed

使用如下命令解决 pip --trusted-host pypi.python.org install XXXX

转载原创文章请注明,转载自: 爱追梦 » 各种linux小问题

Not Comment Found