我在 CentOS 7.4 机器上遇到了一个我不明白的问题。
有人安装了 wine 并且没有记录他们是如何安装它的(是使用yum、直接使用 arpm还是从源构建的?我不知道)。现在我需要卸载它,所以我做了以下事情:
sudo yum remove wine*which 卸载了大约 15 个不同的软件包rpm -qa | grep wine我检查了以前的软件包确实已卸载。问题是当which wine我得到/usr/local/bin/wine并ls -l /usr/local/bin/ | grep wine返回时我仍然有一个wine可执行文件
-rwxr-xr-x 1 root root 17616 wine
-rwxr-xr-x 1 root root 1973 wineboot
-rwxr-xr-x 1 root root 247924 winebuild
-rwxr-xr-x 1 root root 1973 winecfg
-rwxr-xr-x 1 root root 1973 wineconsole
lrwxrwxrwx 1 root root 7 winecpp -> winegcc
-rwxr-xr-x …Run Code Online (Sandbox Code Playgroud) 我想知道 pip、Python 包安装程序和 yum 之间有什么区别?
作为为我的问题提供一些背景的一种方式:
我假设第一个答案是因为 PIP 仅用于安装 Python 包,而 yum 安装来自不同类型供应商的包。但是让我们专注于使用这两种工具安装 Python 包作为识别两者之间差异的方法:
我在工作中遇到了一个问题(使用 CentOS6),其中 Django 缺少我尝试安装的 rpm 的依赖项。我认为正确的解决方法是“pip install Django”。但是,当我这样做并重新尝试 'rpm -i' 时,仍然报告 Django 依赖项丢失。
一位更有经验的同事告诉我我所做的事情是错误的,我需要卸载它并且只使用 yum 进行安装。从经验中我知道他不是一个详细说明事情的人,经过一番谷歌搜索后,我仍然一无所知。
我无法理解为什么存在差异,如果两者都安装相同的软件包,那么为什么一个可以作为满足所需依赖项的一种方式,而另一个(pip)则没有。
我有一个从客户那里借来的 Redhat 7 系统,用于安装 32 位应用程序。为了让应用程序工作,我需要安装 gtk2.i686 工具包。
通过执行此命令:
yum list --showduplicates gtk2
Run Code Online (Sandbox Code Playgroud)
我可以看到安装的 64 位包是:
gtk2.x86_64 2.24.31-1.el7 @rhel-7-server-rpms
Run Code Online (Sandbox Code Playgroud)
所以我尝试安装匹配的32位版本,如下:
yum install gtk2-2.24.31-1.el7.i686
Run Code Online (Sandbox Code Playgroud)
这会导致一个依赖项列表,并给出批准提示:
Install 1 Package (+79 Dependent packages)
Upgrade ( 5 Dependent packages)
Total size: 30 M
Total download size: 24 M
Is this ok [y/d/N]:
Run Code Online (Sandbox Code Playgroud)
但是,当我同意时,它会因一系列“无法解决主机错误”而失败,例如
zlib-1.2.7-18.el7.i686.rpm FAILED
https://rhs6.loc/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/os/Packages/z/zlib-1.2.7-18.el7.i686.rpm: [Errno 14] curl#6 - "Could not resolve host: rhs6.loc; Unknown error"
Trying other mirror.
Run Code Online (Sandbox Code Playgroud)
当我执行“yum repolist”时,我遇到了类似的错误。
# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
https://rhs6.loc/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/ansible/2.6/os/repodata/repomd.xml: [Errno 14] …Run Code Online (Sandbox Code Playgroud) 我无法在 Red Hat Enterprise Linux Server 7.4 (Maipo) 版上下载 pam-devel、zlib-devel 和 openssl-devel 软件包。
执行时
yum install pam-devel
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
error: No package pam-devel available.
error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
在跑步的时候
yum repolist all
Run Code Online (Sandbox Code Playgroud)
我无法启用正在运行的存储库
yum-config-manager --enable epel-source/x86_64.
Run Code Online (Sandbox Code Playgroud)
为什么这些包不可用,我可以做些什么来获取它们?
我们正在尝试安装 java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64.rpm
yum localinstall java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
Examining java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64.rpm: 1:java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64
Marking java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk-devel.x86_64 1:1.8.0.161-2.b14.el7 will be installed
--> Processing Dependency: java-1.8.0-openjdk(x86-64) = 1:1.8.0.161-2.b14.el7 for package: 1:java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64 (/java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.x86_64)
Requires: java-1.8.0-openjdk(x86-64) = 1:1.8.0.161-2.b14.el7
Installed: 1:java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 (installed)
java-1.8.0-openjdk(x86-64) = 1:1.8.0.171-8.b10.el7_5 …Run Code Online (Sandbox Code Playgroud) 我们使用的是rhel 7.6版本
我们很惊讶 yum-config-manager 默认没有安装在 rhel 7.6 上
所以我们下载rhel 7.6的ISO文件,将rhel 7.6的所有pkgs挂载到/mnt
并为 rhel 7.6 创建 repo
所以现在我们尝试安装 yum-config-manager
但:
yum install yum-config-manager
Loaded plugins: langpacks
configuration
No package yum-config-manager available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
所以我不明白为什么这个 pkg/rpm 不是 ISO 的一部分?
更新,我们也做了
yum provides */yum-config-manager
Loaded plugins: langpacks
configuration
InstallMedia/filelists_db | 3.4 MB 00:00:00
yum-utils-1.1.31-50.el7.noarch : Utilities based around the yum package manager
Repo : InstallMedia
Matched from:
Filename : /usr/bin/yum-config-manager
yum-utils-1.1.31-50.el7.noarch : Utilities based around the yum package manager
Repo : …Run Code Online (Sandbox Code Playgroud) 我需要检查我的 RHEL7.6 中是否安装了 bzip2 包。
第一个命令的结果
rpm -qa | grep bzip2
Run Code Online (Sandbox Code Playgroud)
曾是
bzip2-devel-1.0.6-13.el7.x86_64
bzip2-libs-1.0.6-13.el7.x86_64
Run Code Online (Sandbox Code Playgroud)
但是第二个命令的结果
yum list | grep bzip2
Run Code Online (Sandbox Code Playgroud)
曾是
bzip2-devel.x86_64 1.0.6-13.el7 installed
bzip2-libs.x86_64 1.0.6-13.el7 @rhel
bzip2.x86_64 1.0.6-13.el7 rhel
bzip2-devel.i686 1.0.6-13.el7 rhel
bzip2-libs.i686 1.0.6-13.el7 rhel
Run Code Online (Sandbox Code Playgroud)
当我尝试使用 bzip2 -k 命令压缩文件时,它确实有效。所以存在bzip2。那么为什么'rpm -qa'命令不显示bzip2?
我的 libevent 安装版本是 2.0.12
我通过以下命令安装了新版本的 libevent (v2.1.12),一切顺利,但之后 yum info 再次显示 libevent 版本 2.0.12。
yum 有什么问题?以及如何更新 yum 数据库?
$ wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
$ tar -zxf libevent-*.tar.gz
$ cd libevent-*/
$ ./configure --prefix=/usr/local --enable-shared
$ sudo make && make install
Run Code Online (Sandbox Code Playgroud) 所以我刚刚安装了 Fedora 34 并执行了以下操作:
sudo dnf install powertop
但是,它不是安装软件包,而是开始下载更新。因为我使用的是计量连接,所以我只想安装该软件包。同样的事情发生在yum.
使用 CentOS 8。
我想强制dnf只在某个位置附近使用镜子,而不必手动维护所需镜子的列表。所以我想修改/etc/yum.repo.d/.
举/etc/yum.repo.d/CentOS-Linux-BaseOS.repo个例子,这是它的默认状态:
[baseos]
name=CentOS Linux $releasever - BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Run Code Online (Sandbox Code Playgroud)
我想知道查询时是否有一个参数mirrorlist.centos.org可以指定按位置过滤,如下所示:
mirrorlist=http://mirrorlist.centos.org/?country=us&other-params-ommitted
Run Code Online (Sandbox Code Playgroud)
(country=我试过了,什么也没做)
我在该网站的 API 上找不到任何相关文档。
在 Kubuntu 中,我安装了 yum。
~$ sudo apt-get install yum
[sudo] password for jim:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
debugedit liblua5.2-0 librpm3 librpmbuild3 librpmio3 librpmsign1 libsqlite0 python-libxml2 python-rpm python-sqlite python-sqlitecachec python-urlgrabber rpm rpm-common rpm2cpio
Suggested packages:
rpm-i18n python-sqlite-dbg alien elfutils
The following NEW packages will be installed:
debugedit liblua5.2-0 librpm3 librpmbuild3 librpmio3 librpmsign1 libsqlite0 python-libxml2 python-rpm python-sqlite python-sqlitecachec python-urlgrabber rpm rpm-common rpm2cpio yum
0 upgraded, 16 newly installed, …Run Code Online (Sandbox Code Playgroud) 我需要安装以下软件包:
gcc: gcc-c++-4.4.7-3.el6.x86_64
Flex: flex-2.5.35-8.el6.x86_64
Bison: bison-2.4.1-5.el6.x86_64
Glib: glib2-devel-2.22.5-7.el6.x86_64 & glibc-devel-2.12-1.107.el6_4.2.x86_64
Pcre: pcre-7.8-6.el6.x86_64 & pcre-devel-7.8-6.el6.x86_64
logrotate: logrotate-3.7.8-16.el6.x86_64
sendmail: sendmail-8.14.4-8.el6.x86_64 & sendmail-cf-8.14.4-8.el6.noarch
Run Code Online (Sandbox Code Playgroud)
使用yum从下面的存储库。
# yum repolist
Loaded plugins: package_upload, product-id, search-disabled-repos, subscription-manager
repo id repo name status
!RBC_RBC-Tools-RHEL7_rbc-tools-rhel-7Server-x86_64-rpms rbc-tools-rhel-7Server-x86_64-rpms 9
!rhel-7-server-extras-rpms/x86_64 Red Hat Enterprise Linux 7 Server - Extras (RPMs) 747
!rhel-7-server-optional-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server - Optional (RPMs) 13,201
!rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 18,022
!rhel-7-server-satellite-tools-6.1-rpms/x86_64 Red Hat Satellite Tools 6.1 (for RHEL …Run Code Online (Sandbox Code Playgroud)