How to Install/Uninstall Screen Command on Linux

ERROR : -bash: screen: command not found.

How to Install/Uninstall Screen Command on Linux

 

Screen package allows using separate terminal on a linux server and you can detach/attach a long running session. Example : It might take lot of days to scan 2 TB of data on a server. If you start this server scan in screen it will not get stopped when your session gets disconnected. You can check the status of the scan anytime by attaching the screen. You might see the below error if screen command is not installed on your server.

[root@server home]# screen -S scan
-bash: screen: command not found

Error shows that screen package is not installed on your linux server.

1. Log into your linux server as ‘root’

2. Run the below command on linux server to check whether screen package is installed or not.

Command : rpm -qa | grep screen

[root@server home]# rpm -qa | grep screen
[root@server home]#

screen command is not installed on the above server and that is the reason why you are getting the error. You can install screen package on linux server using yum command.

3. Run the command ‘yum install screen’ to install screen package

Command : yum install screen

[root@server]# yum install screen
—> Package screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2 will be installed
Total download size: 552 k
Installed size: 914 k
Is this ok [y/d/N]:

Enter ‘y’ and press enter.

Downloading packages:
screen-4.1.0-0.23.20120314git3c2946.el7_2.x86_64.rpm

Installed:
screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2

Now screen package is installed on the above server.
 


 

How to Uninstall/Remove Screen package on Linux

 
1. Log into linux server via SSH as ‘root’ user

2. Run the command ‘yum remove screen’ to uninstall screen package

[root@master home]# yum remove screen

—> Package screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2 will be erased

Is this ok [y/N]: y (Enter y and press enter to confirm)

Running transaction
Erasing : screen-4.1.0-0.23.20120314git3c2946.el7_2.x86_64 1/1
Verifying : screen-4.1.0-0.23.20120314git3c2946.el7_2.x86_64 1/1

Removed:
screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2

Screen command is removed from the above linux Server.