×


Install and Use Busybox on Ubuntu 20.04 LTS - Step by step guide ?

Busybox is a free and opn-source GNU software which is a single executable file with a number of UNIX tools. It is specially designed for the embedded operating system that has limited resources such as storage space and memory. It provides minimalist replacement of shell utilities that you can use on desktop systems such as ls, mv, cp, tar, etc. Execution of busybox can be done on many popular operating system environments such as Linux, Android and so on.

Here at Ibmi Media, we shall look into the installation process and the use cases of Busybox in Ubuntu 20.04 LTS server.


How to install Busybox on Ubuntu 20.04 LTS ?

To begin, run the apt update command before installing busybox:

$ sudo apt update

Next, run the command as shown below to install the Busybox:

$ sudo apt install busybox -y

You can also install the busybox with the apt-get command. The process is similar to the above steps.

First let's run the apt-get update command before installing busybox:

$ sudo apt-get update

Now, run the command below to install the Busybox:

$ sudo apt-get install busybox -y


How to use Busybox on Ubuntu 20.04 LTS ?

You are able to use busybox through its shell directly on Ubuntu 20.04 LTS. WIth the shell interface, executing the commands like ls, rm is available. Lets run the below command:

$ busybox sh

Note that we are trying to delete a file named "exec" with the command:

$ busybox sh

Then run the following commands:

$ ls
$ rm exec

This will remove the file exec with the busybox command.

Busybox provides httpd webserver as a program which is very popular and useful. You can check the availability and use httpd webserver with the command below. Be sure to switch to root user in such case:

# busybox sh

Then:

# ps -ef | grep httpd

Now , to check if the webserver is functioning, let's create a HTML file with a simple code:

# busybox sh

Then:

# vi index.html
<!DOCTYPE html>
<html>
<body>
<h1>Busybox HTTPD Testing</h1>
<p>Success.</p>
</body>
</html>

Then save it.

Now, check by browsing the site to check if it is working or not.

Another use case of busybox is to get the actual path of the file, you can use busybox with the readlink command below:

$ busybox sh
$ readlink -f list.sh

Here, we execute the readlink command for the actual path of list.sh by using busybox shell.


How To Uninstall busybox on Ubuntu 21.04 ?

To uninstall only the busybox package we can use the following command:

$ sudo apt-get remove busybox


How to Uninstall busybox And Its Dependencies ?

To uninstall busybox and its dependencies that are no longer needed by Ubuntu 21.04, we can use the command below:

$ sudo apt-get -y autoremove busybox


How to Remove busybox Configurations and Data ?

To remove busybox configuration and data from Ubuntu 21.04 we can use the following command:

$ sudo apt-get -y purge busybox


How to Remove busybox configuration, data, and all of its dependencies ?

We can use the following command to remove busybox configurations, data and all of its dependencies, we can use the following command:

$ sudo apt-get -y autoremove --purge busybox


[Need help in installing any Software on your Linux system ? We can help you. ]


Conclusion

This article covers how to install the busybox and use it on Ubuntu 20.04 LTS server. In fact, BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for the most common utilities you would usually find on your desktop system (i.e., ls, cp, mv, mount, tar, etc.).