为什么不使用最新版本的 Bash?

apa*_*rno 3 bash opensuse

我在 WSL 上使用 openSUSE 42.3。在我完成的最后一次更新(使用sudo zypper refresh && sudo zypper update)期间,Bash 从版本 4.3.42(1) 更新到版本 4.3-83.3.1。

我关闭了 Bash 窗口(仅使用exit)并重新启动了 Windows。当 Windows 重新启动时,我重新打开 Bash 窗口,然后按Control+ X+ V。Bash 输出什么,仍然是旧版本号。

GNU bash,版本 4.3.42(1)-release (x86_64-suse-linux-gnu)

我检查了 的输出zypper info bash,但它说安装了 4.3-83.3.1 版。

Loading repository data...
Reading installed packages...


Information for package bash:
-----------------------------
Repository     : oss_update
Name           : bash
Version        : 4.3-83.3.1
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 742.5 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : bash-4.3-83.3.1.src
Summary        : The GNU Bourne-Again Shell
Description    :
    Bash is an sh-compatible command interpreter that executes commands
    read from standard input or from a file.  Bash incorporates useful
    features from the Korn and C shells (ksh and csh).  Bash is intended to
    be a conformant implementation of the IEEE Posix Shell and Tools
    specification (IEEE Working Group 1003.2).
Run Code Online (Sandbox Code Playgroud)

我还检查了 的输出zypper lr -d,但我没有看到任何可以解释正在发生的事情的内容。

# 别名 启用 类型
1 devel_languages_go 是的 rpm-md
2 devel_languages_php 是的 rpm-md
3 开源软件 是的 rpm-md
4 oss_update 是的 rpm-md
5 server_php_extensions_php7 是的 rpm-md

为什么不使用更新版本的 Bash?

我搜索了名称与bash匹配的任何文件(使用sudo find /[^m]* -name "bash" -type f, where/[^m]*用于避免 /mount 目录,这是唯一匹配该模式的目录)。它找到的唯一文件是 /bin/bash,其输出/bin/bash --version如下。

GNU bash,版本 4.3.42(1)-release (x86_64-suse-linux-gnu) 版权所有 (C) 2013 Free Software Foundation, Inc. 许可证 GPLv3+:GNU GPL 版本 3 或更高版本http://gnu.org/licenses /gpl.html

这是免费软件;您可以自由更改和重新分发它。在法律允许的范围内,不提供任何保证。

Zypper 怎么会认为它安装了我没有找到已安装文件的更新?

作为旁注,我没有更改 Windows 用于启动 openSUSE 的符号链接,这意味着从 WSL 使用的 Bash 是用于 openSUSE 的 /bin/bash。

Ste*_*n M 6

它正在使用正确和最新的版本。

将原始 rpm 包下载到工作文件夹中:

wget http://download.opensuse.org/update/leap/42.3/oss/x86_64/bash-4.3-83.3.1.x86_64.rpm
Run Code Online (Sandbox Code Playgroud)

打开包装:

rpm2cpio bash-4.3-83.3.1.x86_64.rpm | cpio -idmv
Run Code Online (Sandbox Code Playgroud)

包含的 bash 是:

./bin/bash --version    # The leading . is important
GNU bash, Version 4.3.42(1)-release (x86_64-suse-linux-gnu)
Run Code Online (Sandbox Code Playgroud)

包的版本号与安装的软件版本没有完全关联(这里仅是 4.3-Part)。想象一个场景,包维护者犯了一个错误并想要发送更新。打包的软件版本保持不变,但他必须更新包,因此增加了包版本。