如何在CentOS 9上安装screen命令

我在IBM Cloud的CentOS9上尝试安装了screen命令。

[root@syasuda-centos9 ~]# dnf update -y
[root@syasuda-centos9 ~]# cat /etc/redhat-release
CentOS Stream release 9
[root@syasuda-centos9 ~]# uname -a
Linux syasuda-centos9 5.14.0-361.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 24 13:40:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@syasuda-centos9 ~]# dnf config-manager --set-enabled crb
[root@syasuda-centos9 ~]# dnf install -y  https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
(途中省略)
Downloading Packages:
Public key for epel-release-latest-9.noarch.rpm is not installed
Public key for epel-next-release-latest-9.noarch.rpm is not installed
Error: GPG check FAILED
[root@syasuda-centos9 ~]# dnf config-manager --set-enabled crb
[root@syasuda-centos9 ~]# dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
(途中省略)
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                        1/1
  Installing       : epel-next-release-9-7.el9.noarch                                                                                                                       1/2
  Installing       : epel-release-9-7.el9.noarch                                                                                                                            2/2
  Running scriptlet: epel-release-9-7.el9.noarch                                                                                                                            2/2
Many EPEL packages require the CodeReady Builder (CRB) repository.
It is recommended that you run /usr/bin/crb enable to enable the CRB repository.

  Verifying        : epel-release-9-7.el9.noarch                                                                                                                            1/2
  Verifying        : epel-next-release-9-7.el9.noarch                                                                                                                       2/2

Installed:
  epel-next-release-9-7.el9.noarch                                                          epel-release-9-7.el9.noarch

Complete!
[root@syasuda-centos9 ~]# dnf install screen

以下是屏幕自定义的一个例子。将逃逸键设置为Ctrl+T。

defutf8 on
defencoding utf8
encoding utf8 utf8

escape ^Tt
defscrollback 1000000
termcapinfo xterm* ti@:te@
autodetach on
allpartial off
startup_message off
hardstatus alwayslastline "%{= rw} %H %{= wk}%-Lw%{= bw}%n%f* %t%{= wk}%+Lw %{= wk}%=%{= gk} %y/%m/%d %c "
广告
将在 10 秒后关闭
bannerAds