按照教程从 ubuntu 中删除 KDE 后,无法启用 gdm3

按照教程从 ubuntu 中删除 KDE 后,无法启用 gdm3

每次启动时,我都必须按 ctrl + alt + f3 并输入类似以下内容的内容

sudo systemctl start gdm3

如果我不这样做,那么我的电脑将只会停留在 BIOS 徽标上,而不会出现其他任何内容。

这是我遵循的教程https://trendoceans.com/how-to-remove-the-kde-plasma-environment-in-ubuntu/

当我尝试

sudo systemctl enable gdm3

我明白了

Synchronizing state of gdm3.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable gdm3
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

编辑:我找到了修复方法,感谢sudo dpkg-reconfigure gme3reddit 上的人

答案1

我遇到了类似的问题。这是因为缺少安装在你的gdm3.服务文件。要解决这个问题,首先你必须进入/lib/systemd/system/目录,然后打开gdm3.服务在任何编辑器中打开文件。例如:sudo nano gdm3.service

添加后:

[安装]
WantedBy=multi-user.target

在单元文件的底部gdm3.service,它修复了我运行的问题systemctl enable gdm3。您现在可以成功启用gdm3。

答案2

打开终端并输入,
sudo systemctl set-default graphical.target
然后重新启动,您应该会直接进入桌面。
如果您想返回,则
sudo systemctl set-default multi-user.target
在启动时直接带您进入控制台。
如果其他一切都失败了sudo apt-get install ubuntu-desktop

相关内容