RHEL/Centos7 最小安装图形化桌面教程
<p>Linux是一个多任务的多用户的操作系统,好多linux爱好者在安装完linux后经常遇到一个问题——没有图形化桌面。今天小编在安装RHEL7的时候,一步留神没有安装图形化桌面,下面分享一下安装图形化桌面的过程。</p><h2>一、RHEL7 系统安装——发现默认没有桌面</h2>
<p>在安装的时候没有注意选择的是默认的“Minimal Install”,安装完后是这个样子的:</p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="600" src="https://img.jbzj.com/file_images/article/202306/202306290009504.png" width="800" /></p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="391" src="https://img.jbzj.com/file_images/article/202306/202306290009505.png" width="692" /></p>
<p>命令行的界面的,好不爽。登录进去,启动图形化试试:</p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="386" src="https://img.jbzj.com/file_images/article/202306/202306290009506.png" width="626" /></p>
<p>果然没有安装图形化。下面来进行图形化组件的安装。</p>
<h2>二、安装图形化组件</h2>
<p><strong>先挂载</strong></p>
<div class="jb51code"><pre class="brush:bash;">#mount /dev/sr0 /mnt \\把光盘挂载到“/mnt”上面
#df \\查看是否已经挂载</pre></div>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="596" src="https://img.jbzj.com/file_images/article/202306/202306290009507.png" width="778" /></p>
<p><strong>创建本地yum仓库</strong></p>
<p>验证本地yum仓库,找出要需要安装组件组的包名称</p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="146" src="https://img.jbzj.com/file_images/article/202306/202306290009508.png" width="801" /></p>
<div class="jb51code"><pre class="brush:bash;"> #yum clean all \\清楚yum仓库缓存
#yum makecache \\ 创建yum仓库缓存
#yum repolist \\ 列出可用yum仓库
#yum grouplist \\ 列出程序组</pre></div>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="716" src="https://img.jbzj.com/file_images/article/202306/202306290009509.png" width="1280" /><strong>安</strong></p>
<p><strong>装桌面组件包</strong> #yum -y groupinstall "Server with GUI" \\ 安装图形化程序组</p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="545" src="https://img.jbzj.com/file_images/article/202306/2023062900095010.png" width="1280" /></p>
<h2>三、设置图形化默认启动</h2>
<p><strong>启动桌面——startx</strong></p>
<div class="jb51code"><pre class="brush:bash;">#startx
\\ 启动xwindow 进入图形化桌面</pre></div>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="257" src="https://img.jbzj.com/file_images/article/202306/2023062900095011.png" width="702" /></p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="768" src="https://img.jbzj.com/file_images/article/202306/2023062900095012.png" width="1280" /><strong>进</strong></p>
<p>入图形化,进行图形化的设置</p>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="584" src="https://img.jbzj.com/file_images/article/202306/2023062900095113.png" width="1280" /></p>
<p><strong>设置默认运行级别为图形化</strong></p>
<div class="jb51code"><pre class="brush:bash;"># systemctl get-default \\查看默认运行级别
multi-user.target
# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3 \\运行级别3:多用户界面
# graphical.target: analogous to runlevel 5 \\运行级别5:图形化界面
# # To set a default target, run: # # ln -sf /lib/systemd/system/.target
/etc/systemd/system/default.target #
# systemctl set-default graphical.target \\设置默认图形化运行级别
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'
# systemctl get-default \\查看默认运行级别
graphical.target \\图形化设置OK
#</pre></div>
<p><img alt="RHEL/Centos7 安装图形化桌面" height="565" src="https://img.jbzj.com/file_images/article/202306/2023062900095114.png" width="740" /></p>
<p>OK,图形化桌面已经安装好了!!!</p>
<p><span style="color:#e74c3c">ps:linux系统启动后没有进入图形化有以下原因:</span></p>
<p>1.系统在安装的时候没有安装图形化 2.系统的默认运行级别不是图形化 3.系统在安装后,有降低过内存的操作,内存过低无法启动桌面。</p>
<p>解决方案:</p>
<p>a.增加内存</p>
<p>b.查看swap的大小,尝试扩大swap分区</p>
<p>4.系统在重启后,软件出现了问题,导致桌面没有启动 RHEL 7 在系统上与6 有了不同的改变,没有了init运行级别,只有3级别和5级别。</p>
頁:
[1]