linuxRHEL8安装screen
1、问题
[root@linuxprobe linuxprobe]# screen -S test ## RHEL8自身不带screen
bash: screen: command not found...
Failed to search for file: Cannot update read-only repo
[root@linuxprobe linuxprobe]# screen --version
bash: screen: command not found...
Failed to search for file: Cannot update read-only repo
2、yum安装
[root@linuxprobe linuxprobe]# yum install screen ## 没有配置yum仓库
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Error: There are no enabled repos.
3、配置yum仓库
[root@linuxprobe linuxprobe]# df -h ## 查看当前挂载情况
Filesystem Size Used Avail Use% Mounted on
devtmpfs 969M 0 969M 0% /dev
tmpfs 984M 0 984M 0% /dev/shm
tmpfs 984M 9.6M 974M 1% /run
tmpfs 984M 0 984M 0% /sys/fs/cgroup
/dev/mapper/rhel-root 17G 3.9G 14G 23% /
/dev/sda1 1014M 152M 863M 15% /boot
tmpfs 197M 20K 197M 1% /run/user/42
tmpfs 197M 2.3M 195M 2% /run/user/0
/dev/sr0 6.7G 6.7G 0 100% /run/media/root/RHEL-8-0-0-BaseOS-x86_64
[root@linuxprobe linuxprobe]# mkdir -p /media/cdrom ## 创建光盘挂载点
[root@linuxprobe linuxprobe]# mount /dev/cdrom /media/cdrom/ ## 挂载光盘
mount: /media/cdrom: WARNING: device write-protected, mounted read-only.
[root@linuxprobe linuxprobe]# df -h ## 查看挂载情况
Filesystem Size Used Avail Use% Mounted on
devtmpfs 969M 0 969M 0% /dev
tmpfs 984M 0 984M 0% /dev/shm
tmpfs 984M 9.6M 974M 1% /run
tmpfs 984M 0 984M 0% /sys/fs/cgroup
/dev/mapper/rhel-root 17G 3.9G 14G 23% /
/dev/sda1 1014M 152M 863M 15% /boot
tmpfs 197M 20K 197M 1% /run/user/42
tmpfs 197M 2.4M 195M 2% /run/user/0
/dev/sr0 6.7G 6.7G 0 100% /media/cdrom
4、设定光盘挂载为开机自动启动
[root@linuxprobe linuxprobe]# cat /etc/fstab ## 查看开机自动启动配置文件
#
# /etc/fstab
# Created by anaconda on Thu Oct 29 01:05:13 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=4d9618c5-4252-4910-8e97-d4d28755ed1a /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
[root@linuxprobe linuxprobe]# echo -e "/dev/cdrom\t/media/cdrom\tiso9660\tdefaults\t0\t0" >> /etc/fstab ## 修改开机自动启动配置文件
[root@linuxprobe linuxprobe]# cat /etc/fstab ## 查看开机自动启动配置文件
#
# /etc/fstab
# Created by anaconda on Thu Oct 29 01:05:13 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=4d9618c5-4252-4910-8e97-d4d28755ed1a /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
/dev/cdrom /media/cdrom iso9660 defaults 0 0
5、创建yum仓库的配置文件
[root@linuxprobe linuxprobe]# cd /etc/yum.repos.d/
vim rhel8.repo ##进行编辑,保存退出
[BaseOS]
name=BaseOS
baseurl=file:///media/cdrom/BaseOS
gpgcheck=0
enbaled=1
[AppStream]
name=AppStream
baseurl=file:///media/cdrom/AppStream
gpgcheck=0
enabled=1
6、测试yum仓库
yum install httpd -y
7、安装screen
[root@linuxprobe yum.repos.d]# yum install screen
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:01:06 ago on Thu 29 Oct 2020 01:21:54 PM CST.
No match for argument: screen
Error: Unable to find a match
8、执行如下命令
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
9、再次安装screen
yum install screen -y
10、测试screen
[root@linuxprobe yum.repos.d]# screen --version
Screen version 4.06.02 (GNU) 23-Oct-17