centos 服务器命令下安装GUI
第一步:配置YUM源。
无论是使用网络YUM源还是使用CentOS的ISO光盘映像构建本地YUM源。
挂载命令
//创建挂载目录 mkdir /media/cdrom //挂载镜像 mount -t iso9660 /dev/cdrom /media/cdrom 提示:mount:block device /dev/cdrom is write-protected, mounting read-only 就表示成功挂载到/media/cdrom下了。 //卸载镜像 umount /dev/hdc 或直接eject //强制卸载命令: 1).fuser -mk /dev/hdc 2). eject
配置本地yum源
vi /etc/yum.repos.d/local.repo #Base OS [LocalRepo_BaseOS] name=LocalRepo_BaseOS baseurl=file:///media/cdrom/BaseOS gpgcheck=0 gpgkey=file:///media/cdrom/BaseOS/RPM-GPG-KEY-redhat-release enabled=1 #App Stream [LocalRepo_AppStream] name=LocalRepository_AppStream baseurl=file:///media/cdrom/AppStream enabled=1 gpgcheck=0 gpgkey=file:///media/cdrom/AppStream/RPM-GPG-KEY-redhat-beta
参数说明:
[LocalRepo] # 该部分的名称
name # 存储库的名称
baseurl # 包裹的位置
enabled # 启用存储库
gpgcheck # 启用安全安装(gpgcheck是可选的(如果设置gpgcheck = 0,则无需提及gpgkey)
gpgkey # 密钥的位置
yum clean all yum makecache
第二步:在命令行下使用yum命令安装图形化桌面组。
yum -y groupinstall "Server with GUI" reboot
以文字界面进入系统,使用以下命令切换界面
startx || init 5
设置默认界面
命令行界面
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
图形界面
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
卸载图形界面组件
执行下面代码
yum -y groupinstall "Server with GUI"
等待下面出现如下内容
Installing Environment Groups: Server with GUI Installing Groups: Container Management Core Fonts GNOME Guest Desktop Agents Hardware Monitoring Utilities Hardware Support Headless Management Internet Browser Multimedia Common NetworkManager submodules Printing Client Server product core Standard
一次次的卸载安装包即可,其他会有一些安装包提示不可删除跳过即可
yum remove -y "Container Management" Core "Fonts" "GNOME" "Guest Desktop Agents" "Hardware Monitoring Utilities" "Hardware Support" "Headless Management" "Internet Browser" "Multimedia" "Common NetworkManager submodules" "Printing Client" "Server product core" "Standard"
相关推荐
changecan 2020-11-19
ECSHOP专属建设 2020-11-13
88427810 2020-11-02
步知道 2020-10-27
Junzizhiai 2020-10-10
jackalwb 2020-10-05
小网管 2020-09-03
shiwenqiang 2020-09-14
85251846 2020-09-14
summerinsist 2020-08-21
87901735 2020-08-19
PinkBean 2020-08-11
85407718 2020-08-09
MichelinMessi 2020-07-30
suosuo 2020-07-28
CARBON 2020-07-28
lizhengfa 2020-07-27
88427810 2020-07-26