操作系统:带有 lightdm 的 ubuntu 20.04
硬件:Raspberry Pi 4B 8GB
历史:该系统已运行一年多,没有出现问题。
音响系统随机崩溃(以前发生过这种情况),我通常的解决方法是重新启动。通常这样做有效。
这次,重启后我无法登录。lightdm 问候屏幕似乎想要自动登录(我很久以前就禁用了自动登录)并显示错误消息failed to authenticate
。
我该如何调查并解决这个问题?
我尝试过的一些方法:
reboot
- 没有影响,可能是导致最初问题的原因apt reinstall lightdm; reboot
- 没有影响- 在 lightdm 的 pam 配置中注释掉 kwallet - 除了日志中少了一些错误消息外,没有其他影响
ssh
- 远程登录有效,这是我的方法(tty 也有效)
编辑:
删除并重新安装 lightdm - 除了更改登录启动画面外没有其他影响
apt purge lightdm apt update apt install lightdm dpkg-reconfigure lightdm reboot
创建了如下所示的 /etc/lightdm/lightdm.conf - 它确实在登录屏幕上添加了一个“登录”按钮,但仍然没有任何框可以输入用户名或密码,所以我无法登录。
[SeatDefaults] greeter-show-manual-login = true greeter-hide-users = false allow-guest = false
注意:我的系统没有 gdm。
日志和文件:
/etc/lightdm/lightdm.conf
不存在:
> ls -alR /etc/lightdm
/etc/lightdm:
total 24
drwxr-xr-x 3 root root 4096 Sep 13 23:38 .
drwxr-xr-x 151 root root 12288 Sep 13 22:26 ..
drwxr-xr-x 2 root root 4096 Feb 7 2020 lightdm.conf.d
-rw-r--r-- 1 root root 466 Feb 7 2020 users.conf
/etc/lightdm/lightdm.conf.d:
total 8
drwxr-xr-x 2 root root 4096 Feb 7 2020 .
drwxr-xr-x 3 root root 4096 Sep 13 23:38 ..
/var/log/apport.log
显示以下行的多次重复,每次重试或重新启动均显示一行:
ERROR: apport (pid 2458) <date/time>: executable: /usr/sbin/lightdm (command line "lightdm --session-child 13 20")
ERROR: apport (pid 2458) <date/time>: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 2458) <date/time>: this executable already crashed 2 times, ignoring
崩溃报告(大约在第一次重启时,不确定它是在我第一次重启之前还是之后发生的,以尝试解决我的声音系统问题):
> ls -al /var/crash/
total 228
drwxrwsrwt 2 root whoopsie 4096 Sep 13 17:14 .
drwxr-xr-x 14 root root 4096 Dec 15 2020 ..
-rw-r----- 1 root whoopsie 219359 Sep 13 17:14 _usr_sbin_lightdm.0.crash
-rw-r--r-- 1 root whoopsie 0 Sep 13 17:14 _usr_sbin_lightdm.0.upload
-rw------- 1 whoopsie whoopsie 37 Sep 13 17:14 _usr_sbin_lightdm.0.uploaded
/var/log/lightdm/lightdm.log
(最后几行相关内容):
[+6.37s] DEBUG: Greeter connected version=1.30.0 api=1 resettable=false
[+7.24s] DEBUG: Greeter start authentication for ubuntu
[+7.24s] DEBUG: Session pid=2455: Started with service 'lightdm', username 'ubuntu'
[+8.71s] DEBUG: Session pid=2455: Terminated with signal 11
[+8.71s] DEBUG: Session: Failed during authentication
[+8.71s] DEBUG: Authenticate result for user ubuntu: Authentication stopped before completion
[+8.71s] DEBUG: Seat seat0: Session stopped
答案1
我昨天遇到了一个问题,lightdm 不再记录我,但那是在 18.04。我解决这个问题的方法是:
# apt purge lightdm
# apt update
# apt install lightdm
# dpkg-reconfigure lightdm
# reboot
这帮我解决了这个问题,祝你好运!
答案2
我认为问题在于更新未能完全完成并且破坏了snap
用户主目录中的某些链接。
下面我展示了一个更正后的目录结构,更正之前,链接current
指向不存在的数字/目录名。
> tree -L 2 snap
snap
├── chromium
│ ├── 1383
│ ├── 1417
│ ├── 1740
│ ├── 1816
│ ├── common
│ └── current -> 1816
├── rpi-imager
│ ├── 171
│ ├── 185
│ ├── common
│ └── current -> 185
└── ubuntu-mate-welcome
├── 574
├── 627
├── 648
├── common
└── current -> 648