You need to use the pkg_add command to install BASH package which is available in a binary packages format over the Internet. You can also install bash package using OpenBSD CD.
First, Login as a root user, either use su - or sudo command.
Next setup PKG_PATH using export command. You can make things really easy by using the PKG_PATH environment variable. Just point it to your favorite location, and pkg_add(1) will automatically look there for any package you specify, and also fetch and install the necessary dependencies of this package automatically.
$ export PKG_PATH=ftp://mirror.planetunix.net/pub/OpenBSD/`uname -r`/packages/`machine -a`/
Caution: The PKG_PATH variable MUST end in a slash (/).
OpenBSD Install bash shell binary package
Use pkg_add command as follows:
$ sudo pkg_add -i -v bash
OR
# pkg_add -i -v bash
Output:
parsing bash-3.2 Dependencies for bash-3.2 resolve to: gettext-0.14.6, libiconv-1.9.2p3 (todo: libiconv-1.9.2p3,gettext-0.14.6) bash-3.2:parsing libiconv-1.9.2p3 bash-3.2:libiconv-1.9.2p3: complete bash-3.2:parsing gettext-0.14.6 Dependencies for gettext-0.14.6 resolve to: expat-2.0.0, libiconv-1.9.2p3 (todo: expat-2.0.0) bash-3.2:parsing expat-2.0.0 bash-3.2:expat-2.0.0: complete bash-3.2:gettext-0.14.6: complete Shell /usr/local/bin/bash appended to /etc/shells bash-3.2: complete
To use bash shell, just enter bash command:
$ bash
How do I setup bash as a login and default shell for my account?
Type the following command to change the user's shell to new shell called /usr/local/bin/bash (the following will change root shell to bash):
# chsh -s /usr/local/bin/bash
Set bash shell as a default login shell for user nixcraft:
# chsh -s /usr/local/bin/bash nixcraft
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 3 comments… read them below or add one }
Nice guide. Uh, how do you do this permanently?
ok, chsh did it for me:
chsh -s bash
Got:
chsh: warning, unknown root shell
I had to logout and login again for it to take effect.
To make known a bashrc, I added to ~/.profile
source ~/.bashrc
Good tutorials Vivec, always enjoy reading your posts.
Perfect installation, but any follow-up for setting bash color profiles? I’ve noticed 4.5 *doesn’t* like using .bashrc (GNU/Linux) opting for .bash_profile, nor do the numerous online Linux how-tos/guides (ie: http://wiki.archlinux.org/index.php/Color_Bash_Prompt) adapt themselves to OpenBSD.
OpenBSD 4.5 w/ bash 3.2.48