我想知道如何安装 Python 2.7.5 的安全更新。
我收到通知,我的 CentOS 7 Python 版本有安全补丁更新。详细信息在这里:
https://lists.centos.org/pipermail/centos-announce/2018-July/022964.html
我在互联网上搜索试图寻找安装该特定补丁的方法,但我找不到。
我已经尝试过sudo yum update python-2.7.5-69.el7_5.x86_64.rpm
,但你可能会看出我不知道我在做什么。
答案1
为了以最少的工作量使其正常工作,您确实应该确保您的 YUM 存储库配置正确。您不需要使用任何非官方存储库,除非您寻求的软件包不包含在内。
Python 安全更新python-2.7.5-69.el7_5.x86_64.rpm
确实位于官方 CentOS 7 镜像上,因此如果您的 YUM 无法找到并安装该软件包,则说明您的存储库中存在某些配置错误。
请检查 中的文件内容/etc/yum.repos.d
,确保[updates]
存储库已启用并指向官方 CentOS 7 镜像。还要确保任何非官方存储库的优先级设置为低于官方存储库或完全禁用,除非您真的知道自己在做什么。
如果 YUM 存储库配置正确,您只需运行即可获取安全更新yum install python
。如果仍然不起作用,您应该将文件的内容/etc/yum.repos.d
和输出发布给yum info python
其他人,以更有效地提供帮助。
答案2
根据好吃
install
Is used to install the latest version of a package or group of packages while ensuring that all depen\u2010
dencies are satisfied. (See Specifying package names for more information) If no package matches the
given package name(s), they are assumed to be a shell glob and any matches are then installed. If the
name starts with @^ then it is treated as an environment group (group install @^foo), an @ character and
it's treated as a group (plain group install).
If the name starts with a "-" character, then a search is done within the transaction and any matches
are removed. Note that Yum options use the same syntax and it may be necessary to use "--" to resolve
any possible conflicts.
If the name is a file, then install works like localinstall. If the name doesn't match a package, then
package "provides" are searched (e.g. "_sqlitecache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum").
Also note that for filelists, wildcards will match multiple packages.
Because install does a lot of work to make it as easy as possible to use, there are also a few specific
install commands "install-n", "install-na" and "install-nevra". These only work on package names, and do
not process wildcards etc.
update If run without any packages, update will update every currently installed package. If one or more pack\u2010
ages or package globs are specified, Yum will only update the listed packages. While updating packages,
yum will ensure that all dependencies are satisfied. (See Specifying package names for more information)
If the packages or globs specified match to packages which are not currently installed then update will
not install them. update operates on groups, files, provides and filelists just like the "install" com\u2010
mand.
你的yum
命令应该是:
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
您也可以使用命令rpm
,使用`wget``下载包
wget https://centos.pkgs.org/7/centos-updates-x86_64/
然后,安装该包:
rpm -Uvh python-2.7.5-69.el7_5.x86_64.rpm
Flag -U will do the upgrade for you