Install Screen

What is Screen?

Screen is a very useful utility that allows a user or administrator to create multiple screens (interactive shells) from within one window and then manage these sessions easily. Each screen that is created has its own history. A copy and paste mechanism is also available allowing text to be copied from one terminal window to another.

When the screen utility is called, it creates a single window with a shell in it or the specified command. At any time, you can create new full screen windows with other programs in them, kill existing windows, view a list of running windows, toggle output logging on and off, copy and paste text between windows, view the scroll back history and switch between windows. All windows run their programs independently of each other. Programs will continue to run even when their window is not currently visible and even when the whole screen session is detached from the user's terminal. When a program terminates, screen kills the window that contained it. If this window was in the foreground, the display is then switched to the previous window. Shells usually distinguish between running as a login shell or a sub shell. Screen runs these as sub-shells, unless told otherwise. Everything that you type is sent to the program running in the current window session. The only exception to this is the one keystroke that is used to initiate a command to the window manager. By default, each command begins with a Ctrl + A, and is followed by one other keystroke. The command character and all the key bindings can be fully customized.

Screen is available for most Linux distributions and should be available within your repositories if it is not already installed. To install screen to your Linux system, follow the instructions below. (Note all commands are issued as root or prefixed with sudo).

Instructions for Installing Screen on a Debian Based system (Debian, Ubuntu, Mint..)

To install the screen utility on a Debian based system using the "apt" installation tool, simply follow the instructions below.

Issue the following commands:

sudo apt update
sudo apt install screen

The first command "sudo apt update" will update your repositories so that the latest software will be available. The second command initiates the actual installation. Below is output taken from an Ubuntu system:


$ sudo apt install screen
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libutempter0
Suggested packages:
  byobu | screenie | iselect
The following NEW packages will be installed
  libutempter0 screen
0 to upgrade, 2 to newly install, 0 to remove and 5 not to upgrade.
Need to get 586 kB of archives.
After this operation, 1,073 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 libutempter0 amd64 1.1.6-4 [8,256 B]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 screen amd64 4.8.0-1ubuntu0.1 [577 kB]
Fetched 586 kB in 1s (713 kB/s) 
Selecting previously unselected package libutempter0:amd64.
(Reading database ... 191519 files and directories currently installed.)
Preparing to unpack .../libutempter0_1.1.6-4_amd64.deb ...
Unpacking libutempter0:amd64 (1.1.6-4) ...
Selecting previously unselected package screen.
Preparing to unpack .../screen_4.8.0-1ubuntu0.1_amd64.deb ...
Unpacking screen (4.8.0-1ubuntu0.1) ...
Setting up libutempter0:amd64 (1.1.6-4) ...
Setting up screen (4.8.0-1ubuntu0.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for systemd (245.4-4ubuntu3.6) ...

Instructions for Installing Screen on Red Hat, CentOS and Fedora Systems

To install the Screen utility on a Red Hat based system we can issue the following command:

dnf install epel-release
dnf install screen.x86_64


dnf install screen
Last metadata expiration check: 0:00:36 ago on Wed 09 Jun 2021 22:27:03 BST.
Dependencies resolved.
=====================================================================================================================================
 Package                       Architecture                  Version                               Repository                   Size
=====================================================================================================================================
Installing:
 screen                        x86_64                        4.6.2-12.el8                          epel                        581 k

Transaction Summary
=====================================================================================================================================
Install  1 Package

Total download size: 581 k
Installed size: 955 k
Is this ok [y/N]: y
Downloading Packages:
screen-4.6.2-12.el8.x86_64.rpm                                                                       1.3 MB/s | 581 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                551 kB/s | 581 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                             1/1 
  Running scriptlet: screen-4.6.2-12.el8.x86_64                                                                                  1/1 
  Installing       : screen-4.6.2-12.el8.x86_64                                                                                  1/1 
  Running scriptlet: screen-4.6.2-12.el8.x86_64                                                                                  1/1 
  Verifying        : screen-4.6.2-12.el8.x86_64                                                                                  1/1 

Installed:
  screen-4.6.2-12.el8.x86_64                                                                                                         

Complete!

Instructions for installing Screen on openSUSE - SLES (SUSE Linux Enterprise Server)

Although screen is installed by default on openSUSE 15.2 and SLES I have included the commands for installing. To install screen on an openSUSE system or SLES you can use either the YAST interface or the zypper utility. In the example below I am using zypper.

Commands to issue: zypper install screen


# zypper install screen
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  screen

1 new package to install.
Overall download size: 541.2 KiB. Already cached: 0 B. After the operation, additional 872.9 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package screen-4.6.2-lp152.6.3.1.x86_64                                              (1/1), 541.2 KiB (872.9 KiB unpacked)
Retrieving: screen-4.6.2-lp152.6.3.1.x86_64.rpm ...................................................................[done (2.5 KiB/s)]

Checking for file conflicts: ..................................................................................................[done]
(1/1) Installing: screen-4.6.2-lp152.6.3.1.x86_64 .............................................................................[done]