The officially official Devuan Forum!

You are not logged in.

#1 2023-06-19 16:14:56

kaiyel
Member
Registered: 2019-10-16
Posts: 20  

HOWTO : use bash instead of dash as the default shell in daedalus

The ability to specify bash as the default shell instead of dash by running :

dpkg-reconfigure dash

has been removed from daedalus / bookworm apparently without explanation sad

The change can still be accomplished issuing dpkg-divert commands directly, but not nearly as conveniently.  I found a post on the debian-users board to outline the steps (hat tip to Sven Joachim) :

https://lists.debian.org/debian-user/20 … 00382.html

# dpkg-divert --remove --no-rename /usr/share/man/man1/sh.1.gz
# dpkg-divert --remove --no-rename /bin/sh
# ln -sf bash.1.gz /usr/share/man/man1/sh.1.gz
# ln -sf bash /bin/sh
# dpkg-divert --add --local --no-rename /usr/share/man/man1/sh.1.gz
# dpkg-divert --add --local --no-rename /bin/sh

Cheers,
--K

Offline

#2 2023-06-20 00:13:25

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,007  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

It is worth to highlight that the ramification of changing the "meaning" of "/bin/sh" is much larger than merely saving the typing of  two characters more in new bash scripts.

The "/bin/sh" binary is the most fundamental pathname of a GNU/Linux system since that binary is the one used by the execve system call. It affects all system scripts from top to bottom, from the very boot up of the system. So one must be very sure that the "new meaning" (bash) of "/bin/sh" is fully equal to the "old meaning" (dash) in terms of script interpretation for all existing "/bin/sh" scripts.

Probably "bash" is still a language superset of "dash". But "bash" has significant ongoing development and it is much more intended for interactive use. My worry would be that "bash" suddenly one day has a deviation from "dash" that makes a difference, possibly breaking my system in some obscure way.

Online

#3 2023-06-20 09:05:13

Camtaf
Member
Registered: 2019-11-19
Posts: 346  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

Maybe using chsh in a script, run at start up of your session, would be a better alternative(?).

https://www.howtogeek.com/669835/how-to … with-chsh/

Offline

#4 2023-06-20 11:04:25

soren
Member
Registered: 2023-04-30
Posts: 59  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

Camtaf wrote:

Maybe using chsh in a script, run at start up of your session, would be a better alternative(?).

https://www.howtogeek.com/669835/how-to … with-chsh/

I believe OP is talking about changing the non-interactive shell, which as ralph mentioned is not a good idea to change.

Beginning with DebianSqueeze, Debian uses Dash as the target of the /bin/sh symlink. Dash lacks many of the features one would expect in an interactive shell, making it faster and more memory efficient than Bash.

From DebianSqueeze to DebianBullseye, it was possible to select bash as the target of the /bin/sh symlink (by running dpkg-reconfigure dash). As of DebianBookworm, this is no longer supported.

https://wiki.debian.org/Shell

Offline

#5 2023-06-20 14:40:48

kaiyel
Member
Registered: 2019-10-16
Posts: 20  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

As I recall, "dash = bash + posix_compliance - nonessential_libraries".

As the default system shell dash is superior, having fewer dependencies and application startup times improved by thousandths of seconds.  No argument there.  I can attest that as the superset, however, there is no fear in using bash as the default shell.  It "just works".

If your working environment relies heavily on external applications for which you don't have authority (or time or desire) to rewrite the scripting glue, then bash is your best mate.  And that is a reasonable scenario motivating a change in the default shell.

I absolutely do not mind Debian's move from bash to dash with Squeeze -- I think it was a good change and the gotchas have been worked out of the system.  What surprised me while reviewing Daedalus was that the convenient method of exercising alternatives from one default shell to another was gone.  Apparently it surprised a few people on the Debian forum too.  I like alternatives and believe choice should remain part of the ecosystem.  Removing ease-of-choice is detrimental ... which is kinda why we all meet up here for Devuan.

The purpose of my post was only to share the more verbose method of changing the default shell now that the shortcut has been removed.  Hopefully it helps someone having real world constraints.  Beyond that, there is little reason to switch back to bash.

Be well,
--K

Offline

#6 2023-06-21 08:50:12

soren
Member
Registered: 2023-04-30
Posts: 59  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

kaiyel wrote:

I absolutely do not mind Debian's move from bash to dash with Squeeze -- I think it was a good change and the gotchas have been worked out of the system.  What surprised me while reviewing Daedalus was that the convenient method of exercising alternatives from one default shell to another was gone.  Apparently it surprised a few people on the Debian forum too.  I like alternatives and believe choice should remain part of the ecosystem.  Removing ease-of-choice is detrimental ... which is kinda why we all meet up here for Devuan.

In my understanding devuan only exists due to choice of init system freedom, so devuan follows as closely as possibly the debian lifecycle while having a choice of 3 inits in the installer and in no way letting systemd as an init be part of the operating system. Choice in shell is of course your choice and as you have found it can be done, but devuan should not be responsible for the decision to make unavailable the method to easily change the default shell with dpkg, that is a debian decision. Just my own opinion here.
To add, devuan does one thing well and that is to make available a debian distribution free from systemd and that is all i want it to do, no more no less.

Last edited by soren (2023-06-21 08:52:51)

Offline

#7 2023-06-28 15:42:25

czeekaj
Member
Registered: 2019-06-12
Posts: 111  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

Deviating too far from debian would indeed make maintenance of Devuan a tricky feat. The magic of Amprolla is much appreciated.

Last edited by czeekaj (2023-07-02 01:30:28)

Offline

#8 2023-06-28 16:57:32

golinux
Administrator
Registered: 2016-11-25
Posts: 2,914  

Re: HOWTO : use bash instead of dash as the default shell in daedalus

czeekaj wrote:

The magic of Amporella is much appreciated.

Typo . . . that would be amprolla

Online

Board footer