Categories: TutorialsUbuntu

How to Install and Use Busybox in Ubuntu

Busybox is free to install under the terms of GNU with a free softwares release. It 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.

In this article, we are going to explain the installation process and the use cases of Busybox in Ubuntu 20.04 LTS server.

Installation
Sponsored
of Busybox on Ubuntu 20.04 LTS

Installing the Busybox on Ubuntu 20.04 LTS desktop/server is quite easy. You can directly install it with the use of apt command. Check the below command for further details.

First let’s run the apt update command before installing busybox.

$ sudo apt update

Now, 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 as shown below to install the Busybox.

$ sudo apt-get install busybox -y

Uses of 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 command as shown below for further details.

$ busybox sh

After executing this command, you will see the output as shown below.

Here, we are trying to delete a file named “exec” with the command as shown below.

$ busybox sh

Then,

$ ls
$ rm exec

Here, we have successfully removed 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 as shown below. Be sure to switch to root user in such case.

Sponsored
# 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





Busybox HTTPD Testing

Success.

Then save it. Check picture below for further details.

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

Here, we have successfully tested the webserver. It seems to be running well as shown on the above picture.

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

$ busybox sh
$ readlink -f list.sh

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

Conclusion

In this tutorial, you have learnt how to install the busybox and use it on Ubuntu 20.04 LTS server. It is very useful and comes in handy in many cases. Thank you!

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

22 hours ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago

How To Install DNS Server (Bind9) On Ubuntu 20.04

Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…

3 days ago