How to install bash and neofetch in FreeBSD

Neofetch is a bash script. In FreeBSD, there is no bash by default. Instead, other types of shell are used, such as C shell (csh), tcsh. Therefore, to make neofetch working we need to install bash and make it the main shell in the system.

First, let’s install bash package:

sudo pkg install bash

Then we need to find out where its binary file is located:

whereis bash
...
/usr/local/bin/bash

Now we figured out the path to the bash. The following command will make bash a shell by default. If we execute the command with user rights, then bash will become a shell for the current user:

chsh -s /usr/local/bin/bash   ## This will change default shell for the current user

But if we execute the command with the superuser rights, bash will become a shell for root.

Now It is necessary to re-login or reboot, then the changes will take effect. Being at the command prompt press Ctrl+D and enter your username and password again:

$   Ctrl + D   ## Press it being at the commandline prompt

Now we can make sure that bash is the default shell, use the following command:

echo $SHELL
...
/usr/local/bin/bash

Bash is installed. Since neofetch is a bash script we can install it:

sudo pkg install neofetch

Let’s run neofetch:

neofetch
neofetch output in FreeBSD
Neofetch output in FreeBSD