4

I just upgraded to Ubuntu 18.10 from Ubuntu 17.10.

I have my box configured to use bash as the default shell rather than the default dash. I've made this change with sudo update-alternatives --config sh which reports:

  Selection    Path            Priority   Status
------------------------------------------------------------
  0            /bin/dash        200       auto mode
* 1            /bin/bash        100       manual mode
  2            /bin/dash        200       manual mode

However, /bin/sh still points to dash rather than pointing to bash.

Actually, on previous versions of Ubuntu, I believe that used to point /bin/sh -> /etc/alternatives/sh.

It looks like the latest Ubuntu no longer allows the alternatives mechanism for sh or at least broke the alternatives during the upgrade. I see from How Can I Make /bin/sh point to /bin/bash? that it is now recommended to reconfigure dash instead.

Why doesn't alternatives work anymore? Where is this change documented? I've been using alternatives with sh for at least three years in Ubuntu and I've never had it broken during an upgrade before. There are many guides that suggest that such as: https://jwaghetti.blogspot.com/2015/09/changing-dash-to-bash.html

1 Answers1

4

The update-alternatives system could have been used to manage /bin/sh, but it would have had to be implemented that way in the Debian packages for bash and dash.

The packagers decided against it, instead using the current scheme involving dpkg-configure to manage /bin/sh. See this excellent answer for details and rationale of that choice.

The article you linked to is recommending using update-alternatives on /bin/sh, setting that up manually. That is terrible advice. Because, in effect, you'll have two separate systems trying to manage the same symlink in different ways, and probably stepping on each other's toes. (Which is probably what caused your issue during an Ubuntu upgrade.)

filbranden
  • 2,861