环境:Centos8.5;
说明:进程在执行的过程中如果由于终端窗口关闭的话,那么该进程也会随着停止,这样就回很麻烦
下面引入我们今天的对象-screen(可以保证由于终端窗口关闭以后进程依然在执行)
但是Centos8.5通过yum直接安装screen会报错
[root@centos8 ~]#screen
-bash: screen: command not found
[root@centos8 ~]#yum -y install screen
CentOS Linux 8 - AppStream 3.9 kB/s | 4.3 kB 00:01
CentOS Linux 8 - BaseOS 6.9 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Extras 1.9 kB/s | 1.5 kB 00:00
No match for argument: screen
Error: Unable to find a match: screen
[root@centos8 ~]#yum -y install screen
Last metadata expiration check: 0:02:06 ago on Wed 11 May 2022 11:30:57 PM CST.
No match for argument: screen
Error: Unable to find a match: screen
为什么会报错呢?------这是由于Centos8yum源里没有epel,但是呢screen、iftop、nethogs是在epel里面的,所以解决办法就是:
1.安装epel
2.通过screen
[root@centos8 ~]#yum -y install epel-release
Last metadata expiration check: 0:23:55 ago on Wed 11 May 2022 11:30:57 PM CST.
Dependencies resolved.
============================================================================================
Package Architecture Version Repository Size
============================================================================================
Installing:
epel-release noarch 8-11.el8 extras 24 k
Transaction Summary
============================================================================================
Install 1 Package
Total download size: 24 k
Installed size: 35 k
Downloading Packages:
epel-release-8-11.el8.noarch.rpm 42 kB/s | 24 kB 00:00
--------------------------------------------------------------------------------------------
Total 42 kB/s | 24 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : epel-release-8-11.el8.noarch 1/1
Running scriptlet: epel-release-8-11.el8.noarch 1/1
Verifying : epel-release-8-11.el8.noarch 1/1
Installed:
epel-release-8-11.el8.noarch
Complete!
[root@centos8 ~]#yum -y install screen
Extra Packages for Enterprise Linux 8 - x86_64 1.7 MB/s | 11 MB 00:06
Extra Packages for Enterprise Linux Modular 8 - x86_64 386 kB/s | 1.0 MB 00:02
Last metadata expiration check: 0:00:02 ago on Wed 11 May 2022 11:56:11 PM CST.
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
Downloading Packages:
screen-4.6.2-12.el8.x86_64.rpm 715 kB/s | 581 kB 00:00
--------------------------------------------------------------------------------------------
Total 201 kB/s | 581 kB 00:02
Extra Packages for Enterprise Linux 8 - x86_64 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x2F86D6A1:
Userid : "Fedora EPEL (8) <epel@fedoraproject.org>"
Fingerprint: 94E2 79EB 8D8F 25B2 1810 ADF1 21EA 45AB 2F86 D6A1
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
Key imported successfully
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!
#执行screen(页面会清空,说明执行成功了)
[root@centos8 ~]#screen