Set required symlinks

Still on 2.2.2 Host System Software.

Now I need to set the default system shell (/bin/sh) to bash, changing it from dash. It took me a while to establish that this is the system shell, not user shells. And there are two other required symlinks.

/bin/sh should link to bash
/usr/bin/awk should link to gawk
/usr/bin/yacc should link to bison

There are two ways to find symlinks. One is “readlink” and the other “file -h.” I found that “file -h” is more explicit than “readlink” so I used that more often.

Replace system shell with bash

file -h /bin/sh
symbolic link to dash

Here’s where I really, really used Google AI Mode.

So in Ubuntu there used to be ways to set the system shell from dash to bash, but not in Ubuntu 24.04. The only way was to do it manually. This scared me!

AI Mode said that the preferred method is not to remove the link and then make a new link, but instead to make the link with -f.

Here I also worked out my confusion (“I hope /bin/bash is completely equivalent to bash”), learning in a deep way that /bin is a link to /usr/bin (where there is also a bash and a dash)–because the entire directory /bin is a symlink to /usr/bin, so they are the same directory.

file -h /bin/sh
symbolic link to /usr/bin

And I established with file -h that there is no /bin/sh.bash and no /bin/sh.dash in Ubuntu. I’m not sure where I got the idea, but the possibility of those files existing was confusing as well.

So here goes:

sudo ln -sf /bin/bash /bin/sh
file -h /bin/sh
symbolic link to bash
readlink /bin/sh
/bin/bash

Reboot to see if it still boots – yes.

Gawk and bison symlinks already in place

file -h /usr/bin/awk
symbolic link to /etc/alternatives/awk
file -h /etc/alternatives/awk
symbolic link to /usr/bin/gawk
file -h /usr/bin/yacc
symbolic link to /etc/alternatives/yacc
file -h /etc/alternatives/yacc
symbolic link to /usr/bin/bison.yacc
small script that runs bison

I hope that’s what’s intended by these (as I look at them a couple months later). Well, we’ll find out.

I wonder how many things can go wrong in LFS, I’m guessing a lot.