Linux 进入不了图形化界面的终极解决办法

一. 情况大概介绍

1. 虚拟机相关内容

软件:VMware® Workstation

版本:16.2.1 build-18811642

镜像版本:CentOS-7-x86_64-DVD-2009、CentOS-7-x86_64-DVD-1810

安装系统选的server GUI

进入系统安装软件

2. 遇到相关问题

安装编译gccmakeglic重启图形化界面不显示命令行界面切换不过来

3. 目前(终极)解决办法
systemctl set-default multi-user.target

startx

二. Linux 进入不了图形化界面

Linux菜鸟,centos Linux安装了图形化界面,之前可以用的,今天用着用着突然跳转到完全命令行模式,重启也进入不了图形化界面,解决历程如下

一. 根据错误提示abrtautoreporting 157……

执行abrt-auto-reporting enabled”,然后重启,没有解决问题

1. 开机报错

Last login: Thu Nov  9 21:01:53 2023 from 192.168.72.1
ABRT has detected 1 problem(s). For more info run: abrt-cli list --since 169954913

2. 执行对应命令

[root@bogon ~]#  abrt-cli list --since 169954913
id 2ca68039642a06229c08abaff4ed8e9a92646cc2
reason:         gnome-shell killed by SIGSEGV
time:           Thu 09 Nov 2023 09:19:33 PM CST
cmdline:        /usr/bin/gnome-shell
package:        gnome-shell-3.28.3-30.el7
uid:            42 (gdm)
count:          1
Directory:      /var/spool/abrt/ccpp-2023-11-09-21:19:33-1987

The Autoreporting feature is disabled. Please consider enabling it by issuing
'abrt-auto-reporting enabled' as a user with root privileges

3. 继续执行相关命令

[root@bogon ~]# abrt-auto-reporting enabled

二. 百度Linux进入不了图形界面,参相关文章,执行如下步骤

1. linux不能进入图形界面解决方法

1. 直接进入图形化

输入 startx 回车

2. 如果希望每次都自动进入xwindos

修改inittab文件

vi /etc/inittab

找到id:3:initdefault:这行;

i进入编辑模式;

将3改为5;

esc退出编辑

输入 “:qw ”(包括“:”)。

2. Linux安装后无法进入图形界面(GNOME,KDE等)的解决方法

1. 问题:

发现没有id:3:initdefault:这行

2. 解决方法:

之前一直用level3的命令行学习Linux,今天觉得有必要把GUI的操作熟悉一下,因此试着切换到图形界面,试了很多方法都没成功。然后我突然意识到我安装的是自定义minimal版本,所以,没有给我安装什么XWINDOWS、GNOME这类东西的。所以只好自己下载然后调用咯。

过程如下
1. 在命令行输入下面的命令来安装 Gnome 包
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
2. 更新系统运行级别

如果你想在系统下次启动时候自动进入图形界面,那么我们需要更改系统运行级别输入下面的命令来启用图形界面

ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
还有一种方法将GNOME设为默认开机启动界面(不用ctrl+alt+F1
1. 进入cenos7的命令行模式
2. 终端输入init 3”回车进入命令行模式

在这里插入图片描述

3. 登录成功后systemctl getdefault 获取当前系统启动模式

在这里插入图片描述

查看配置文件

# cat /etc/inittab

在这里插入图片描述
通过以上显示,目前系统为命令行模式

更改模式命令:

systemctl set-default graphical.target命令行模式更改为图形界面模式

systemctl set-default multi-user.target图形界面模式更改为命令行模式

更改后验是否正确reboot;界面如下

在这里插入图片描述

三. SMbus Host Controller not enabled

执行“更改模式命令:systemctl set-default graphical.target由命令行模式更改为图形界面模式”,然后reboot重新启动,问题没有解决

重启过程发现计算机提示SMbus Host Controller not enabled

环境

客户机 ubuntu17.04

宿主机 win7

问题:

SMbus Host Controller not enabled

原因

ubuntu 装入i2c_piix4 模块导致

网上搜索时,一位网友的帖子说是x64的电脑装了x32的ubuntu。不过那位网友还是给出了问题的解决方法如下

#1# 进入root模式

#2# 输入 lsmod | grep i2c_piix4

(在第一条命令行后本来应该显示输出模块名字,这张截图解决问题之后截得,并没有显示

#3# 输入 vi /etc/modprobe.d/blacklist.conf,进入vim编辑器

在这里插入图片描述

#4# 点击 —— i —— 进行编辑

#5# 在这个配置文件最后一行加上:blacklist i2c-piix4

#6# 点击—— Esc ——退出编辑模式

#7# 键盘输入 —— :wq ——保存退出

在这里插入图片描述

#8# 最后输入—— reboot ——重启虚拟机解决问题

在这里插入图片描述

可能出现的问题

问题:

请问怎么保存文件。我在etc/modprobe.d/blacklist.conf最后一行加上blacklist i2c-piix4之后无法保存显示E212 ,can’t open file for writing,上层文件夹也建立了,vi 前面也加上sudo了,仍然无法保存文件

解决方法

你要用root用户或者sudo打开才能修改

四. yumlist 报错

“SMbus Host Controller not enabled”问题解决,重启时不再报错,图形化界面还是没有呈现

打算重新安装图形化界面,发现自己的yum不能正常使用。执行yum list报错如下:

在这里插入图片描述

参考yum -list报错完整执行全文的操作

问题:

当你通过 ftp 对另一台主机配置 yum 源的时候报错显示如下:

[root@client ~]# yum list               
Loaded plugins: fastestmirror
^C^Ccd ^H^H^Hcd ^H^H^CCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
 
 
 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:
     1. Contact the upstream for the repository and get them to fix the problem.
     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).
     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:
 
            yum-config-manager --disable <repoid>
 
     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:
 
            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
 
Cannot find a valid baseurl for repo: base/7/x86_64
解决办法
1. 那么首先检查防火墙是或否关闭 如果没有关闭使用如下命令进行关闭
systemctl stop firewalld.service
2. 其次检查 SELINUX=disabled 是非为 Disabled或者Permissive状态,如果不是请进行如下操作

关闭selinux

# vi /etc/sysconfig/selinux
SELINUX=disabled

# getenforce

Disabled
3. 如果还是不是就需要进去 /etc/yum.repos.d/ 目录查看文件

在这里插入图片描述

红框内的是需要联网操作的如果你的虚拟机是单网卡而且没有配置外网网卡的话,建议把这几个文件移动到其他目录

在这里插入图片描述

执行过程结果下图所示

在这里插入图片描述

在这里插入图片描述

yum问题解

五. 安装 Gnome 包

1. 如果是Ubuntu就不要继续安装yum了

There are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos

今晚踩了不少坑,必须总结一下。首先说说这个错的由来

我安装pcre时候报了这样的错:

configure: error: You need a C++ compiler for C++ support.

然后我百度了,发现有人提供了这样一种解决方案

在这里插入图片描述

我照做了,而我发现没有yum,于是又安装了半天yum,好不容易装好了。

这次却又报了这个

There are no enabled repos.  Run "yum repolist all" to see the repos you have.  You can enable repos

醉了,一查才发现,我就不该安装yum,因为我用的是Ubuntu

在这里插入图片描述

应该用下面这个语句解决You need a C++ compiler for C++ support.这个问题

sudo apt-get install build-essential

2. 安装Gnome包,又报错There are no enabled repos(办法总比困难多!!!) 解决方法

记-linux使用yum(error:There are no enabled repos)
报错:

centOS7使用yum安装运用,提示没有有效镜像

解决办法:
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

3. 解决问题之后开始安装,Complete!如下图

在这里插入图片描述

如果你想在系统下次启动时候自动进入图形界面,那么我们需要更改系统的运行级别输入下面的命令来启用图形界面。

ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

reboot还是没能成功,绝望!!!这一通折腾已经有点适应用命令行了。不知道哪里出了问题,解决方法有好多,遇到问题多尝试几次,希望你能成功。


hymanhe

linux不能进入图形界面解决方法

图灵的猫.

Linux安装后无法进入图形界面(GNOME,KDE等)的解决方法

搴华

SMbus Host Controller not enabled

dayaoK

yum -list 报错

周杰伦今天喝奶茶了吗

There are no enabled repos. Run “yum repolist all” to see the repos you have. You can enable repos

leon-chan

记-linux使用yum(error:There are no enabled repos)

ForestWorld

Linux 进入不了图形化界面

原文地址:https://blog.csdn.net/weixin_54626591/article/details/134310225

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_38290.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注