欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > Centos8安装图形化界面

Centos8安装图形化界面

2025/6/3 6:40:24 来源:https://blog.csdn.net/JohnGene/article/details/144776559  浏览:    关键词:Centos8安装图形化界面

由于Centos8已经停止维护,所以在使用的时候会遇到yum元数据找不到的情况

1、更新yum数据源

进入目录:

cd /etc/yum.repos.d/

修改文件:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

#更新源为阿里云镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo 

#清理缓存

yum clean all

#建立缓存 

yum makecache

#检查是否成功

yum update -y

 2、安装图形化界面并远程连接

#更新yum

sudo yum -y upgrade

#安装界面

sudo yum groupinstall "Server with GUI" -y

#设置图形化界面启动

sudo systemctl set-default graphical.target

#:取消图形化界面登录

systemctl set-default multi-user.target

#重启服务器

sudo reboot

#重置vnc密码

vncpasswd

#启动vnc服务

vncserver

#查看VNC服务端口,默认端口5901

ps -aux | grep vnc

 注意:移除图形化界面需要使用下面命令

 # 移除图形界面组
sudo yum groupremove "Server with GUI" -y

# 设置默认运行级别为多用户模式
sudo systemctl set-default multi-user.target

# 切换到多用户模式(可选)
sudo systemctl isolate multi-user.target

# 重启系统
sudo reboot

#使用RealVNC Viewer工具远程(注意开放端口5901)

 3、安装浏览器Chrome(可选)

centos自带了firefox,但是看喜好,这里介绍安装Chrome

#下载

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

#安装

yum localinstall google-chrome-stable_current_x86_64.rpm

#默认情况下chrome不允许root用户使用,需要修改chrome配置

vi /usr/bin/google-chrome

exec -a "$0" "$HERE/chrome" "$@"

改为

exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox

然后可以点击Chrome图标启动了
 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词