How to Enable or Install Byobu for Terminal Management on Ubuntu 16.04

UbuntuserverSoftware & Coding

In this article, we will learn about Byobu on the Ubuntu 16.04, Byobu which is a terminal multiplexer and easy to use, Byobu is used to have multiple windows, consoles and split panes within the windows and will also show the status badges and notifications on the terminal.

To complete this tutorial we needed an Ubuntu 16.04 installed and a Linux user with sudo permissions.

Installing or Checking the Byobu

As a default feature of Ubuntu 16.04, Byobu is installed. However, as a practice, we will check the installation and version and if not we will install the Byobu.

To check the Byobu is installed and also to find out the version we will use the below command

$ byobu --version
byobu version 5.106
tmux 2.1

If we are unable to see the current version or the command not found error displayed –

$ byobu –version
-bash: /usr/bin/byobu: No such file or directory

As we don’t have the Byobu installed on our machine, to install the Byobu we needed to run the below command –

$ sudo apt-get install byobu.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'byobu-extras' for regex 'byobu.'
Note, selecting 'byobu' instead of 'byobu-extras'
Suggested packages:
ccze gnome-terminal po-debconf ttf-ubuntu-font-family wireless-tools
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 105 kB of archives.
After this operation, 654 kB of additional disk space will be used.
Get:1 xenial/main amd64 byobu all 5.106-0ubuntu1 [105 kB]
Fetched 105 kB in 1s (83.6 kB/s)
Preconfiguring packages ...
Selecting previously unselected package byobu.
(Reading database ... 89994 files and directories currently installed.)
Preparing to unpack .../byobu_5.106-0ubuntu1_all.deb ...
Unpacking byobu (5.106-0ubuntu1) ...
Setting up byobu (5.106-0ubuntu1) ...
Now the Byobu is installed on the Ubuntu

Starting and Enabling the Byobu at the Login Time

Byobu is disabled by default after the installation, we needed to enable the Byobu, and we have two ways to enable the Byobu. One is we can start the Byobu every time we needed or we can start the Byobu at the time of login or boot.

To Start the Bybou, we can just use the below command automatically and the environment will be changed.

$ byobu

If we want to start the byobu to our login profile, we needed to enable by using the below command

$ byobu–enable

The Byobu window manager will be launched automatically at each text login.

To disable this behavior later, just run:

$ byobu-disable

And if we want to stop using the byobu, just we can use the byobu-disable command to stop using the Byobu.

Enabling or Setting the Backend Multiplexer

By default, the Byobu will use the tmux as the backend multiplexer, if we want to change the multiplexer to screen we can use the below command –

$ byobu-select-backend
Select the byobu backend:
  • tmux
  • screen

By default the tmux is enabled and if we want to change the multiplexer we can choose the screen

Enabling the Colorful Prompt

Byobu has a good feature included with colorful prompt, which also includes the return code of the last executed command. We can use the below command to enable this feature –

$ byobu-enable-prompt
. ~/.bashrc
root@ubuntu-16:~# . ~/.bashrc

See the below image for the changes in the shell

As we have configured the Byobu to get ready for use.

Using the Byobu for Sessions

As Byobu uses the default keybindis from F1 through F12 the default keyboard function keys.

Byobu has many features like sessions, panes and windows.

We start the sessions so that we can have our own window size with connections to the multiple devices with different screen sizes. We can start a new session using Ctrl+Shift+F2 and we can use Alt+UP ad Alt+Down to move forward and backward of the opened sessions.

Ctrl+ D -> to exit from Byobu and close all the session we connected.
F6 - > Will logout the current session and log you out of the SSH connection.
Shift+F6 - > This will be used to detach the session, but the SSH connection will remain connected.

Using the Windows on Byobu

Byobu has the ability of switching between the windows within in a single session, which will allow us to do the multi-tasks easily with a single connection.

  • F2 → Will be used to open a new window with a new command prompt and can be used to do the multiple tasks.
  • F3 & F4 is used to scroll the windows up and down respectively.
  • F8 → To add names to the current windows. Ctrl+Shift+
  • F3 or F4 → To move the current windows left or right through the list for respectively.
  • F7 → Scrollback the history.

Using the Panes on Byobu

Byobu also provides the ability to split the windows into a multiple panes in both directions vertical and horizontal splits.

Shift+F2 -> To split the current windows into horizontal splits.
Ctrl+F2 - > To split the panes into vertical.
Shift+F11 - > To Zoom the windows and back again.
Alt+F11 -> To split a pane in a new window.

Using Byobu Status Notifications

We have to press the F9 key to enable the status notifications. When we press F9 key, then the Byobu configuration menu will be displayed and we needed to select the Toggle status notification press Enter key, we can see a list of available options on the screen we can enable them by selecting the options.

After we select the options which are available, then select the Apply and exit from the menu, press F5 to refresh the status bar as the notifications are useful to see the information about the system.

Here are the some of the options available with the status notification in the Byobu

arch -> shows notification in the system architecture.
battery -> shows notification for the current battery level for laptops.
date -> shows notification of the current system date.
disk -> shows the notification for current disk space usage.
hostname -> shows the notification for a current system hostname.
ip_address -> notification for shows the current system IP address.
load_average -> shows the notification for current system load average.
memory -> shows the notification for current memory usage.
network -> shows the notification for current network usage, sending and receiving.
reboot_required -> shows notification for an indicator when a system reboot is required.
release -> shows the notification for current distribution version (e.g. 14.04).
time -> shows the notification for current system time.
updates_available -> shows notification for an indicator when there are updates available.
uptime -> shows the notification for current system uptime.
whoami -> shows the notification for currently logged in user.

In the above article we can see a wide range of functions and we have covered some of the functions available with the Byobu, we can use these functions which fit into your environment and get the things done easily and quickly.

Published on 21-Jan-2020 15:29:56