如何在 RHEL 8 上升级 sed?

如何在 RHEL 8 上升级 sed?

我使用的是 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 ~]# 

答案1

您无法在 RHEL 上安装 Fedora 软件包。

我建议运行一个容器,而不是尝试升级您的sed,因为您只需要更新版本的调试功能:

sudo yum install podman
podman run -it --rm fedora:35

这将为您提供一个带有最新版本的sed.

相关内容