Ful*_*k33 8 boot grub2 kernel networking
昨天我正在启动我的电脑,它给了我这个错误信息:
我正在寻找解决方案并遇到了这个论坛讨论:https : //ubuntuforums.org/showthread.php?t=2326216
然后我按照某人的建议从 grub 启动菜单启动到恢复模式,然后尝试运行$ sudo apt-get update
.
这是我开始挣扎的地方。我无法让我的电脑连接到互联网。
$ ping google.com
只是给我 ping: unknown host google.com
然后我尝试运行,$ sudo dhclient eth0
但它返回此错误消息:
run-parts: failed to stat component /etc/dhcp/dhclient-enter-hooks.d/debug: No such file or directory
run-parts: failed to stat component /etc/dhcp/dhclient-exit-hooks.d/debug: No such file or directory
run-parts: failed to stat component /etc/dhcp/dhclient-enter-hooks.d/debug: No such file or directory
RTNETLINK answers: File exists
run-parts: failed to stat component /etc/dhcp/dhclient-exit-hooks.d/debug: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
编辑:journalctl | grep modules
给我:
systemd-modules-load[214]: Inserted module 'lp'
systemd-modules-load[214]: Inserted module 'ppdev'
systemd-modules-load[214]: Inserted module 'parport_pc'
systemd-modules-load[214]: Failed to find module 'rtc'
systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status1/FAILURE
systemd[1]: systemd-modules-load.service: Unit entered failed state
systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'
Run Code Online (Sandbox Code Playgroud)
OP解决了他们的问题如下:
[FAILED] Failed to start Load Kernel Modules
是一个红鲱鱼。rtc
是一个过时的模块。通过切换到 tty1 (ctrl+alt+F1) 并注释掉rtc
(放在#
行首)/etc/modules
(使用 sudoedit)来删除错误消息。
现在计算机将启动到一个空白屏幕。
再次在 tty1 中,然后我尝试连接到互联网,但sudo dhclient eth0
给了我以下错误消息:
failed to stat component /etc/dhcp/dhclient-enter-hooks.d/debug: No such file or directory
failed to stat component /etc/dhcp/dhclient-exit-hooks.d/debug: No such file or directory
Run Code Online (Sandbox Code Playgroud)
事实证明,损坏的符号链接是造成这种情况的罪魁祸首,因此要修复它:
cd /etc/dhcp/dhclient-enter-hooks.d
sudo rm debug
sudo ln -s ../debug.dbkg-new debug`
Run Code Online (Sandbox Code Playgroud)
进而
cd /etc/dhcp/dhclient-exit-hooks.d
sudo rm debug
sudo ln -s ../debug.dbkg-new debug
Run Code Online (Sandbox Code Playgroud)
那么就有可能做到 sudo dhclient eth0
ping google.com
返回unknown host google.com
但ping 8.8.8.8
工作正常,因此echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf
按照 Steeldriver 在此评论中的建议进行修复
最后连接互联网后,所有问题都通过运行解决:
sudo apt-get update
dpkg --configure -a
sudo apt full-upgrade -f
sudo apt -f install
Run Code Online (Sandbox Code Playgroud)