背景
今天在 Ubuntu 中使用 apt-get
卸载软件时, 系统提示我有多余的没用依赖库, 可以使用 autoremove
删除. 于是听信了, 删除后当时系统使用没有什么问题. 悲慛的是晚上重新电脑后, 默认进入的是 tty1
, 并不是 tty7
显示管理器.
即便我使用 ctrl+alt+F7
切换, 也没有任何反应, 我猜想可能是由于 autoremove 删除了显示管理器的相关依赖库了, 必须得想办法填坑了.
解决过程
由于 autoremove 删除了很多的库, 当时也没有注意有哪些库, 所以只能从根本原因查找了.
首先使用 tty1 登录系统, 准备重新启动我的显示管理器 ( lightdm ), 但是重新启动失败.
➜ service lightdm restart
# output
[sudo] password for guoxiangxun:
Job for lightdm.service failed because the control process exited with error code.
See "systemctl status lightdm.service" and "journalctl -xe" for details.
根据上面的提示, 通过 systemctl 查看 lightdm 的状态. 是启动失败的状态, 但是具体原因还是不知道.
➜ ~ systemctl status lightdm.service
# output
● lightdm.service - Light Display Manager
Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-12-14 20:12:45 CST; 19s ago
Docs: man:lightdm(1)
Process: 4524 ExecStart=/usr/sbin/lightdm (code=exited, status=1/FAILURE)
Process: 4518 ExecStartPre=/bin/sh -c [ "$(