Upgrade Bash in Debian and Ubuntu – 3 Quick Steps

This guide intends to teach you to Upgrade Bash in Debian and Ubuntu. Bash Stands for the Bourne Again Shell. It is the default command-line interpreter or shell in Linux. Bash is a powerful shell that provides a command-line interface for interacting with the operating system and executing commands.

Now you can follow the steps below provided by the Orcacore website to upgrade Bash from CLI and get the latest version from source on Debian / Ubuntu.

Learn To Upgrade Bash in Debian and Ubuntu

To Upgrade Bash in Debian and Ubuntu, you must log in to your server as a root or non-root user with sudo privileges. In this guide, to show the guide steps, we use Ubuntu 20.04. You can use all Debian-based distros.

Step 1 – Check the Current Bash Verison on Debian / Ubuntu

First, you can find your current bash version. To do this, you can run:

bash --version

Example Output:

Check the Current Bash Verison on Debian / Ubuntu

Step 2 – Update Bash via APT Package Manager

At this point, you can simply use APT to update your Bash on Debian and Ubuntu. To do this, you can run the commands below:

sudo apt install --only-upgrade bash

Then, you can check your Bash version again:

bash --version

As you can see, it has been updated:

Update Bash via APT Package Manager
Upgrade Bash in Debian and Ubuntu

Step 3 – Install the Latest Bash Version from Source on Debian / Ubuntu

Also, you can simply download and install the latest version of Bash from the source. To do this, install the build-essential package:

sudo apt install build-essential  -y

Then, visit the Bash release page and use the following curl command to download the latest package of Bash:

sudo curl -O https://ftp.gnu.org/gnu/bash/bash-5.2.21.tar.gz

When your download is completed, extract your file and navigate to it with the following commands:

# sudo tar xvf bash-5.*.tar.gz 
# cd bash-5.*/

At this point, you need to run the configure command from your Bash directory. Then, build and install your Bash on Ubuntu / Debian:

# sudo ./configure
# sudo make 
# sudo make install

Finally, reboot your server and check your Bash version:

# sudo reboot
# bash --version
Install the Latest Bash Version from Source on Debian / Ubuntu
Upgrade Bash in Debian and Ubuntu

As you can see, the latest Bash version is installed on your Debian and Ubuntu servers.

Conclusion

Bash is an essential component of Debian and Ubuntu systems. It provides users with a powerful and flexible command-line interface for managing their systems, executing commands, and automating tasks through scripting. At this point, you have learned to Upgrade Bash in Debian and Ubuntu. Hope you enjoy it.

Also, you may like to read the following articles:

Install Zsh and Oh My Zsh on Linux from the Command Line

Install and Use Zsh Autosuggestions Plugin

Completely Remove a Package From Ubuntu / Debian

Install Bash 5 on Centos 7

Install build-essential on Ubuntu 22.04

Powerline For VIM and Bash on Ubuntu 22.04

Install Bash Linux on Windows 10

FAQs

Why should We upgrade Bash on the Debian or Ubuntu system?

Upgrading Bash ensures you have the latest features, security patches, and performance improvements.

How can I check my current Bash version?

You can check the installed version of Bash by running the following command: bash --version

What should We do if the Bash upgrade fails?

If the upgrade fails or causes problems, you can do the following tasks:
– Back to the previous version by reinstalling from the repository.
– Restore a backup if you made one before upgrading.
– Check logs in /var/log for troubleshooting details.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!