ubuntu系统损坏修复_修复损坏的ubuntu gui

ubuntu系统损坏修复

I switch between work and Personal Computer a lot. I recently noticed that I haven’t used my Personal Kubuntu PC in a while during which it gathered rust. I decided to bring it up to speed. Having had enough of Kubuntu, I switched to Ubuntu 20.04, which wasn’t all so much a pain to install, you know, the GUI support, and all...

我经常在工作和个人计算机之间切换。 我最近注意到,一段时间以来我一直没有使用我的Personal Kubuntu PC,因为它会生锈。 我决定加快速度。 有了足够的Kubuntu,我切换到Ubuntu 20.04 ,安装起来并没有那么麻烦,您知道,GUI支持,以及所有...

The trouble came afterward when the installation was slower than the economy during the pandemic. In the process of fixing these errors, I went through the all-too-familiar NVIDIA, light-dm issues that I had to go through a couple of times as a Ubuntu newbie. I decided to document it once and for all, for everybody suffering from new installations of Ubuntu like me.

大流行之后,当安装速度慢于经济运行时,麻烦就来了。 在更正这些错误的过程中,我遇到了非常熟悉的NVIDIA light-dm问题,作为Ubuntu新手我不得不经历几次。 我决定一劳永逸地记录下来,对于像我这样遭受Ubuntu新安装困扰的每个人。

SLOO…OOOWWWW Ubuntu? (SLOO…OOOWWWW Ubuntu?)

This is probably because Ubuntu defaults to the XOrg drivers with a new Installation. You can see that in your Software updates application under “Additional Drivers”. If Xorg is selected (Third option in the screenshot), it’s probably not the best. (Used up the majority of CPU in my case).

这可能是因为Ubuntu默认使用新安装来安装XOrg驱动程序。 您可以在“其他驱动程序”下的“软件更新”应用程序中看到它。 如果选择了Xorg(屏幕快照中的第三选项),则可能不是最佳选择。 (在我的情况下,已用尽了大部分CPU)。

Image for post
Screenshot by the author: Pardon my German, but you can hopefully still identify the options from their geography
作者的截图:请原谅我的德语,但希望您仍然可以从他们的地理位置中识别出选项

In order to fix this, you now either have to:

为了解决此问题,您现在要么必须执行以下操作:

  1. Install Proprietary drivers of your graphics card (Mine was NVIDIA GeForce GT)

    安装图形卡的专有驱动程序(我的是NVIDIA GeForce GT)
  2. Find the latest stable version of drivers for your graphics card and install them

    查找适合您的图形卡的驱动程序的最新稳定版本并安装它们

(You will know you have to do 2 when you try 1 and it fails on your face(!)

(当您尝试1时,您将必须做2,但您的脸会失败(!)

So, if 1 worked for you, awesome, do a

因此,如果1为您工作,那太棒了,

sudo reboot

and you are good to go!

而且你很好走!

如果驱动程序安装失败并且GUI损坏 (If you driver Installation failed and GUI broke down)

If your GUI hung up for some reason, or the process didn’t finish successfully, you are better off switching back to Xorg and reinstalling stable drivers. If you don’t do this, your GUI gets all messed up on reboot. In my case, the reboot failed. It took me to a sad blinking cursor on a blank screen like so:

如果您的GUI由于某种原因挂起,或者该过程未成功完成,则最好切换回Xorg并重新安装稳定的驱动程序。 如果您不这样做,则GUI会在重新启动时陷入混乱。 就我而言,重启失败。 这样,我在空白屏幕上出现了一个悲伤的闪烁光标,如下所示:

Image for post
:( Image by author
:(图片作者

In order to get out of this abyss, press ctrl + F1 (Or F2,3,4,5,6,7) until one of those works.

为了摆脱深渊,请按ctrl + F1(或F2,3,4,5,6,7),直到其中一个起作用。

ctrl + F1

you will enter a regular command-line interface from there. Log in with your user name and password. Then, execute these:

您将从那里进入常规的命令行界面。 使用您的用户名和密码登录。 然后,执行以下命令:

sudo apt-get purge lightdm
sudo apt-get update
sudo apt-get install lightdm
dpkg-reconfigure lightdm
sudo reboot

This is because Ubuntu’s display is managed by lightdm package, which failed. You are purging it and reinstalling it to fix these issues. when you reconfigure lightdm, you will be asked if you want to stay with lightdm or change to GDM3. I stayed with lightdm because I was more familiar (And a lot of ppl on the internet complained about gdm as a manager with NVIDIA drivers)

这是因为Ubuntu的显示由lightdm软件包管理,但失败了。 您正在清除它并重新安装它以解决这些问题。 重新配置lightdm时,系统会询问您是否要保留lightdm或更改为GDM3。 我留在lightdm是因为我比较熟悉(互联网上的很多人都抱怨gdm是使用NVIDIA驱动程序的经理)

Image for post
Screenshot by author: lightdm reconfigure
作者截图:lightdm reconfigure

At this point, I was overjoyed because on rebooting, everything seemed to work and I came to my sign-in screen. While I typed my credentials with joy in my heart and spring in my step, My Computer decided to just keep asking me for my credentials again and again. I WAS STUCK IN A LOGIN LOOP!!

此时,我很高兴,因为重新启动后,一切似乎都正常了,我进入了登录屏幕。 当我步履蹒跚地敲击我的凭据时,我的电脑决定不停地问我一次又一次的凭据。 我被卡在登录环中!!

Note: If your dpkg reconfigure fails in this line,

注意:如果您的dpkg重新配置在此行中失败,

dpkg-reconfigure lightdm

run this and you should be fine:

运行这个,你应该没问题:

sudo dpkg --configure -a

登录循环和出路 (The login loop and the way out)

If you cannot login to your account but the GUI is back up, you have to fix your drivers from the command line (Ofcourse you have to! you broke them in step 1!!!)

如果您无法登录帐户但​​GUI已备份,则必须从命令行修复驱动程序(当然,您必须这样做!您在步骤1中将其破坏了!!!)

So now, Press Ctrl+F3 to get back control over your command line. (with Alt+arrow keys, you can switch between screens: Login, command line etc.). Login with your credentials.

因此,现在,按Ctrl + F3可以重新控制命令行。 (使用Alt +箭头键,您可以在以下屏幕之间切换:登录,命令行等)。 使用您的凭据登录。

Ctrl+F3

There are 2 possible sources of failure here, Failure of configuration of

这里有2种可能的故障源:

  1. .Xauthority permissons are messed up

    .Xauthority许可证被弄乱了
  2. NVIDIA drivers are messed up

    NVIDIA驱动程序搞砸了

In our case, we know it’s the drivers. If you want to check your Xauthority permissions, do this:

就我们而言,我们知道是驱动程序。 如果要检查Xauthority权限,请执行以下操作:

ls -lA

Now look for the line:

现在寻找这行:

-rw — — — — 1 user user 79 Sep 3 19:56 .Xauthority

If instead of where your username has to be, you see:

如果看到的不是您的用户名,则您将看到:

-rw — — — — 1 root root 79 Sep 3 19:56 .Xauthority

You have to:

你必须:

chown username:username .Xauthority

And you have your authority and you can log in!

您拥有自己的权限,就可以登录!

If that wasn’t the problem in the first place, get to reinstalling the drivers:

如果首先不是那个问题,请重新安装驱动程序:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Now look for what drivers are available:

现在寻找可用的驱动程序:

Image for post
Screenshot by author
作者截图

I used the third party free recommended driver. Install it (replace the last your-Nvidia-driver-here with the actual name of it from the above result):

我使用了第三方免费推荐的驱动程序。 安装它(将上面的结果中的最后一个your-Nvidia驱动程序替换为实际名称):

sudo apt install your-nvidia-driver-here

If this worked, not only is your GUI back but also you have better drivers for your graphics card hardware!

如果这样做有效,那么不仅可以返回GUI,还可以为显卡硬件提供更好的驱动程序!

do a:

做一个:

sudo reboot

This should do it!

这应该做到的!

My computer now works like a good regular computer should and doesn’t take forever to startup. If you have had a similar problem, hope this helps!

现在,我的计算机可以像一台好的常规计算机一样正常运行,并且不会永远启动。 如果您遇到类似的问题,希望对您有所帮助!

翻译自: https://towardsdatascience.com/fixing-a-broken-ubuntu-gui-5ce3656922f5

ubuntu系统损坏修复

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值