我在 RHEL 8 系统上,默认sed
安装了 4.5。
[root@192 ~]# rpm -qf `which sed`
sed-4.5-2.el8.x86_64
[root@192 ~]#
由于我想使用该--debug
选项来调试一些sed
命令,所以我必须升级sed
. 当我尝试卸载sed
时,我发现很多其他包都依赖它:
[root@192 ~]# rpm -e sed
error: Failed dependencies:
/bin/sed is needed by (installed) os-prober-1.74-6.el8.x86_64
sed is needed by (installed) krb5-libs-1.18.2-5.el8.x86_64
sed is needed by (installed) ca-certificates-2020.2.41-80.0.el8_2.noarch
sed is needed by (installed) dracut-049-95.git20200804.el8.x86_64
sed is needed by (installed) policycoreutils-2.9-9.el8.x86_64
sed is needed by (installed) sane-backends-1.0.27-19.el8_2.1.x86_64
sed is needed by (installed) authselect-libs-1.2.1-2.el8.x86_64
sed is needed by (installed) open-vm-tools-11.1.0-2.el8.x86_64
sed is needed by (installed) dhcp-client-12:4.3.6-41.el8.x86_64
sed is needed by (installed) cups-filters-1.20.0-20.el8.x86_64
sed is needed by (installed) nfs-utils-1:2.3.3-35.el8.x86_64
sed is needed by (installed) authselect-compat-1.2.1-2.el8.x86_64
sed is needed by (installed) autofs-1:5.1.4-43.el8.x86_64
/usr/bin/sed is needed by (installed) groff-base-1.22.3-18.el8.x86_64
[root@192 ~]#
在这种情况下,升级的正确方法是sed
什么?我也试过直接安装新版本:
[root@192 ~]# rpm -ivh https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/aarch64/os/Packages/s/sed-4.8-8.fc35.aarch64.rpm
Retrieving https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/aarch64/os/Packages/s/sed-4.8-8.fc35.aarch64.rpm
warning: /var/tmp/rpm-tmp.VumGnB: Header V4 RSA/SHA256 Signature, key ID 9867c58f: NOKEY
error: Failed dependencies:
glibc >= 2.33.9000-43.fc35 is needed by sed-4.8-8.fc35.aarch64
ld-linux-aarch64.so.1()(64bit) is needed by sed-4.8-8.fc35.aarch64
ld-linux-aarch64.so.1(GLIBC_2.17)(64bit) is needed by sed-4.8-8.fc35.aarch64
libc.so.6(GLIBC_2.33)(64bit) is needed by sed-4.8-8.fc35.aarch64
libc.so.6(GLIBC_2.34)(64bit) is needed by sed-4.8-8.fc35.aarch64
libselinux.so.1(LIBSELINUX_1.0)(64bit) is needed by sed-4.8-8.fc35.aarch64
[root@192 ~]#
但是,如您所见,它也有一些失败的依赖项。我应该安装这些缺少的依赖项并尝试再次安装吗?
更新
正如 jsbillings 在评论中指出的那样,我使用了错误的包架构。下面是安装 x86_64 包的输出。
[root@192 ~]# rpm -ivh https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/x86_64/os/Packages/s/sed-4.8-8.fc35.x86_64.rpm
Retrieving https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/x86_64/os/Packages/s/sed-4.8-8.fc35.x86_64.rpm
warning: /var/tmp/rpm-tmp.FT7OI2: Header V4 RSA/SHA256 Signature, key ID 9867c58f: NOKEY
error: Failed dependencies:
glibc >= 2.33.9000-43.fc35 is needed by sed-4.8-8.fc35.x86_64
libc.so.6(GLIBC_2.33)(64bit) is needed by sed-4.8-8.fc35.x86_64
libc.so.6(GLIBC_2.34)(64bit) is needed by sed-4.8-8.fc35.x86_64
libselinux.so.1(LIBSELINUX_1.0)(64bit) is needed by sed-4.8-8.fc35.x86_64
[root@192 ~]#
您不能在 RHEL 上安装 Fedora 软件包。
与其尝试升级你的
sed
,因为你只想要一个更新版本的调试功能,我建议运行一个容器:这将为您提供一个带有最新版本的 Fedora 容器
sed
。