How to Install and Use BusyBox on Linux?

The BusyBox is the software suite that contains different functions of the Unix operating system in a single executable file. This suite contains some command utilities of the Linux operating system, like the mv command and ls command. This suite file occupies less space on the hard disk than the default suite of Linux utilities.

The small size is because this can contain only the most used options of the Linux utilities, which the users need.

In this blog, we will explore the installation and usage of BusyBox on Linux with the following outline:

Let’s get into the installation of BusyBox.

How to Install the BusyBox on Linux?

For the installation of the BusyBox, users must follow the steps below.

Step 1: Update the Packages

First, update all the packages on Linux to make sure the package we are going to install is up-to-date:

$ sudo apt update

In other Linux distributions, users can update the packages using the command:

Fedora-based$ sudo dnf update
CentOS-based$ sudo yum update

Step 2: Install the BusyBox

To install the package of the BusyBox on Ubuntu, run the command:

$ sudo apt install busybox -y

Note: The BusyBox package installed by the above steps applies to Ubuntu-based distributions. To install it on other Linux distributions, use the command:

Fedora-based$ sudo dnf install busybox
CentOS-based$ sudo rpm install busybox

How to Use BusyBox on Linux?

The usage of the BusyBox in Linux is simple. You can run the BusyBox command utilities by following the general syntax:

$ busybox [command]

For a better understanding, we will use the ls command to list down the contents of the “Downloads” directory:

$ busybox ls Downloads

Similarly, we can use the BusyBox’s shell instead of the default shell of the Linux distribution by using the command:

$ busybox sh

Now, in the Busybox shell, we will navigate to the Downloads directory and list down the contents by using the simple Linux command structure:

$ cd Downloads && ls

What is the Importance of the BusyBox in Linux?

The commands in the default suite of Linux contain many opinions, among which many are not used. The disadvantage of many options with the command is that it occupies more space on the computer example, we display the options for the mv command utility:

$ mv --help

There are many options, among which you will not use many in your whole life. Now display the options of the mv command in BusyBox:

$ busybox mv --help

It contains only three options that the users mostly use.

How to Uninstall the BusyBox on Linux?

To uninstall the BusyBox on Linux with all its configuration and related files, we will use the purge option of the apt command:

$ sudo apt purge busybox -y

The above-mentioned is used for the Ubuntu-based Linux distributions and to uninstall it from other Linux distributions, use the command:

Fedora-based$ sudo dnf remove busybox
CentOS-based$ sudo rpm remove busybox

That’s how you can install and use BusyBox on Linux.

Conclusion

The BusyBox is the UNIX suite that contains different commands and other functions of the Linux distributions in a single executable file. In this blog, installation and removal methods for indifferent Linux distributions have been explained using BusyBox. The comparison of the BusyBox commands with the default Linux commands has also been explained.