1

I started linux from scratch for educational purpose. In preparing section it says:

Bash-3.2 (/bin/sh should be a symbolic or hard link to bash)

Bison-2.7 (/usr/bin/yacc should be a link to bison or small script that executes bison)

Gawk-4.0.1 (/usr/bin/awk should be a link to gawk)

At this moment links are like:

/bin/sh -> dash

/usr/bin/yacc -> /etc/alternatives/yacc

usr/bin/awk -> /etc/alternatives/awk

this in my ubuntu computer. Can it cause problems to change these links? And especially for /bin/sh. I couldn't understand what is dash.

hepl
  • 27
  • 4
    If this is for educational purposes, do yourself a favour and perform the activities in a virtual machine. This will allow you to worry less about consequences and focus more on the meaning of the task. – matigo Apr 02 '22 at 10:17
  • Hello. If you want to know about dash do a man dash – David Apr 02 '22 at 10:18

1 Answers1

1

is changing symlinks for "linux from scratch" harmful?

In general, an Ubuntu system has been set up and tested by the Ubuntu developers. Changing these symlinks means you are taking over system configuration. It depends how well the alternative tools you symlink to can replace the original tools. Anyhow, it is not recommended to change such configuration on a production system, but do not hesitate and have fun on a system intended for learning only.

See this answer for some explanation about the dash command interpreter, and the difference with bash. Linking sh to bash will probably work well because bash, when invoked as sh, tries to mimic the startup behavior of the traditional Bourne Shell.

bison is available in the main repository, and when installed, it links (via the "alternatives" system) to a small script /usr/bin/bison.yacc that runs bison (Thanks to user mchid for the comment).

One can install gawk on an Ubuntu system, and use this for the awk command, but by default mawk is used because is smaller and much faster than gawk.

Ubuntu uses the Debian-alternatives system, which is why you some symlinks pointing to items in /etc/alternatives. These, in turn, link back to the tool that is configured to be used. See here to learn about this system.

vanadium
  • 88,010
  • 1
    @mchid Thanks for letting this know. I do not on 21.10, but then this was a "minimal" install - maybe it comes with a full install as a dependency. Will update my answer. – vanadium Apr 02 '22 at 12:22