在 Ubuntu 中,当我的网络连接失败时,它只会显示“网络未连接/断开连接”,而不会提供任何有用的错误消息。相反,Windows 会给出一个错误代码以及一条一两行的错误消息,指出连接尝试期间发生了什么错误。有没有办法在 Ubuntu 上获得如此详细的错误报告,无论是通过 GUI 还是通过终端?谢谢。
答案1
在所有 Linux 发行版中,您都可以访问所需的信息。
您可以执行以下操作,阅读系统日志文件,以获取所需的信息:
sudo tail -f /var/log/syslog
结果将会是这样的:
Sep 27 13:36:50 Pluto NetworkManager[841]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Sep 27 13:36:50 Pluto avahi-daemon[845]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.51.
Sep 27 13:36:50 Pluto avahi-daemon[845]: New relevant interface eth0.IPv4 for mDNS.
Sep 27 13:36:50 Pluto avahi-daemon[845]: Registering new address record for 192.168.0.51 on eth0.IPv4.
Sep 27 13:36:51 Pluto NetworkManager[841]: <info> (eth0): device state change: ip-config -> activated (reason 'none') [70 100 0]
Sep 27 13:36:52 Pluto NetworkManager[841]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
Sep 27 13:36:52 Pluto NetworkManager[841]: <info> Activation (eth0) successful, device activated.
Sep 27 13:36:52 Pluto NetworkManager[841]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
Sep 27 13:36:52 Pluto NetworkManager[841]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.
Sep 27 13:37:00 Pluto ntpdate[2445]: adjust time server 91.189.94.4 offset -0.108144
要在 GUI 中查看日志文件:
Click on System -> Administration -> Log File Viewer, to launch the GUI log viewer tool.
笔记:如果找不到系统日志查看器,请打开 Synaptic 包管理器并安装“gnome-system-log”。