GCC编译器重新安装+编译后,本地物理机X无法启动,报错
MESA-LOADER: failed to open mgag200: /usr/lib64/dri/mgag200_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri)
failed to load driver: mgag200
$ sudo startx
[sudo] password for *****:
xauth: file /root/.serverauth.107513 does not exist
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
Build Operating System: 4.19.34-300.el7.x86_64
Current Operating System: Linux rb_rpmbuild_243 4.18.0-305.3.1.el8.x86_64 #1 SMP Tue Jun 1 16:14:33 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-305.3.1.el8.x86_64 root=/dev/mapper/cl00-root ro crashkernel=auto resume=/dev/mapper/cl00-swap rd.lvm.lv=cl00/root rd.lvm.lv=cl00/swap rhgb quiet
Build Date: 11 December 2020 05:54:27PM
Build ID: xorg-x11-server 1.20.10-1.el8
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.2.log", Time: Mon Jul 28 17:06:32 2025
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
pci id for fd 14: 102b:0522, driver (null)
MESA-LOADER: failed to open mgag200: /usr/lib64/dri/mgag200_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri)
failed to load driver: mgag200
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
使用普通用户启动X,上述问题不存在了,但是出现新的问题 (EE) xf86OpenConsole: Cannot open virtual console 4 (No such file or directory)
$ startx
xauth: file /home/*****/.serverauth.128031 does not exist
xauth: (stdin):2: unknown command "3953ba8bb6a51b8fec57dbf5e9f2238a"
xauth: (stdin):3: unknown command "3953ba8bb6a51b8fec57dbf5e9f2238a"
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
Build Operating System: 4.19.34-300.el7.x86_64
Current Operating System: Linux rb_rpmbuild_243 4.18.0-305.3.1.el8.x86_64 #1 SMP Tue Jun 1 16:14:33 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-305.3.1.el8.x86_64 root=/dev/mapper/cl00-root ro crashkernel=auto resume=/dev/mapper/cl00-swap rd.lvm.lv=cl00/root rd.lvm.lv=cl00/swap rhgb quiet
Build Date: 11 December 2020 05:54:27PM
Build ID: xorg-x11-server 1.20.10-1.el8
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/osc/.local/share/xorg/Xorg.2.log", Time: Mon Jul 28 17:47:00 2025
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 4 (No such file or directory)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/*****/.local/share/xorg/Xorg.2.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
解决方法如下:
临时有效
sudo usermod -aG tty 用户名
长期有效 - 创建一个udev规则/etc/udev/rules.d/85-tty-permission.rules ,把普通用户的权限添加tty组里,并且permission设置为0660
KERNEL=="tty[0-9]*", GROUP="tty", MODE="0660"