Ubuntu 22.04 桌面无显示突然“无法打开显示”

Ubuntu 22.04 桌面无显示突然“无法打开显示”

总结一下问题:

我有一个无头家庭服务器,使用 HDMI 假插头运行 ubuntu-desktop 22.04,几个月来一直运行良好。但最近当使用“rustdesk”进行远程控制时,我一直收到“无法打开显示”的错误。

在抛出此错误时它尚未重新启动,重新启动它根本没有帮助。我的家人已确认将它连接到一个显示器,它在启动时(在 uefi 中)和 ubuntu 恢复模式下显示。但在进入正常的 ubuntu 操作系统后,屏幕保持黑屏,但我可以 ssh 到服务器(因此它可以启动)。

运行命令“xrandr --query”会抛出相同的错误“无法打开显示”,我尝试更新 Nvidia 驱动程序。它之前运行的是 nvidia-smi 535,现在是 545。我尝试运行“apt update and upgrade”并重新安装 ubuntu-desktop,但没有成功。我很确定这是一些软件问题。

我试图运行“sudo get-edid | parse-edid”,它返回:

This is read-edid version 3.0.2. Prepare for some fun.
Attempting to use i2c interface
Problem requesting slave address: Device or resource busy
No EDID on bus 1
No EDID on bus 3
No EDID on bus 4
No EDID on bus 5
No EDID on bus 6
1 potential busses found: 2
256-byte EDID successfully retrieved from i2c bus 2
Looks like i2c was successful. Have a good day.
Checksum Correct

Section "Monitor"
        Identifier "28E850"
        ModelName "28E850"
        VendorName "AOC"
        # Monitor Manufactured week 3 of 2017
        # EDID version 1.3
        # Digital Display
        DisplaySize 620 340
        Gamma 2.20
        Option "DPMS" "true"
        #Not giving standard mode: 1920x1080, 75Hz
        #Not giving standard mode: 1680x1050, 60Hz
        #Not giving standard mode: 1600x900, 60Hz
        #Not giving standard mode: 1440x900, 60Hz
        #Not giving standard mode: 1280x1024, 61Hz
        #Not giving standard mode: 1280x800, 60Hz
        #Not giving standard mode: 1280x720, 60Hz
        #Not giving standard mode: 1920x1200, 60Hz

        #Extension block found. Parsing...
#WARNING: I may have missed a mode (CEA mode 97)
#DOUBLE WARNING: It's your first mode, too, so this may actually be important.
#WARNING: I may have missed a mode (CEA mode 63)
#DOUBLE WARNING: It's your first mode, too, so this may actually be important.
#WARNING: I may have missed a mode (CEA mode 96)
#WARNING: I may have missed a mode (CEA mode 101)
#WARNING: I may have missed a mode (CEA mode 102)
#WARNING: I may have missed a mode (CEA mode 93)
#WARNING: I may have missed a mode (CEA mode 94)
#WARNING: I may have missed a mode (CEA mode 95)
#WARNING: I may have missed a mode (CEA mode 98)
        Modeline        "Mode 3" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
        Modeline        "Mode 0" 148.50 1920 2008 2052 2200 1080 1083 1088 1125 +hsync -vsync
        Modeline        "Mode 1" 268.50 2560 2608 2640 2720 1600 1603 1609 1646 +hsync -vsync
        Modeline        "Mode 2" 241.50 2560 2608 2640 2720 1440 1443 1449 1481 +hsync -vsync
        Modeline        "Mode 4" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
        Modeline        "Mode 5" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
        Modeline        "Mode 6" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
        Modeline        "Mode 7" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
        Modeline        "Mode 8" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
        Modeline        "Mode 9" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
        Modeline        "Mode 10" 74.250 1920 2448 2492 2640 1080 1082 1089 1125 +hsync +vsync interlace
        Modeline        "Mode 11" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
        Modeline        "Mode 12" 336.72 2880 2928 2960 3040 1800 1803 1809 1846 +hsync -vsync
        Modeline        "Mode 13" 297.00 3840 3888 3920 4400 2160 2164 2170 2250 +hsync -vsync
        Modeline        "Mode 14" 594.00 3840 4016 4104 4400 2160 2162 2172 2250 +hsync +vsync
        Option "PreferredMode" "Mode 3"
EndSection

阅读完本文后:https://goughlui.com/2019/06/02/review-teardown-generic-hdmi-cheater-dummy-plug-4k-uhd/ 它似乎被 read-edid 检测到,但 ubuntu 却没有。

答案1

检查损坏的软件包并修复它们。然后执行完整的 Ubuntu 更新。

  • 要通过 GUI 修复软件包,请使用Synaptic 软件包管理器
  • 修复它们通过命令行,更复杂一点,但更彻底一点,连续输入以下内容,等待每个操作完成:
    • 按下CtrlCtrlCtrl打开终端
    • sudo apt update --fix-missing
    • sudo apt install -f
    • sudo dpkg --configure -a
    • sudo dpkg -l | grep ^..R [这列出了必须重新安装的软件包。]
    • 申請sudo dpkg --purge --force-all <package-name>刪除每个上一个查询中列出的是错误的包。
    • 强制删除坏包后,sudo apt clean
    • 再次,sudo apt update删除坏的软件包后重新安装软件包。

顺便说一句,这里有一个小型 shell 脚本,我定期运行它以使 Ubuntu 保持最新状态:

sudo apt -y update && sudo apt -y full-upgrade
sudo apt -y autoremove --purge

请注意才不是更新 SNAP 组件,因为我已经完全删除了 SNAP。

相关内容