Zaz*_*Zaz 5 upgrade dbus systemd 18.04
好的,这是从 16.04.1 LTS 到 18.04.1 LTS 的升级,服务器是无头的。升级完成并重新启动后,会发生以下情况:
\n\n尝试升级软件包只会导致以下结果:
\n\n~$ sudo apt upgrade\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\nCalculating upgrade... Done\nThe following packages will be upgraded:\n policykit-1 screen smartmontools\n3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n1 not fully installed or removed.\nNeed to get 0 B/1,081 kB of archives.\nAfter this operation, 147 kB of additional disk space will be used.\nDo you want to continue? [Y/n] y\n\n(Reading database ... 159133 files and directories currently installed.)\nPreparing to unpack .../smartmontools_6.5+svn4324-1_amd64.deb ...\nFailed to connect to bus: No such file or directory\n[...]\nRun Code Online (Sandbox Code Playgroud)\n\n它所说的是 Dbus 吗?\n无论如何,恢复怎么样?
\n\n~$ sudo apt update\nErr:1 http://security.ubuntu.com/ubuntu bionic-security InRelease\n Temporary failure resolving \'security.ubuntu.com\'\nErr:2 http://se.archive.ubuntu.com/ubuntu bionic InRelease\n Temporary failure resolving \'se.archive.ubuntu.com\'\nErr:3 http://se.archive.ubuntu.com/ubuntu bionic-updates InRelease\n Temporary failure resolving \'se.archive.ubuntu.com\'\nErr:4 http://se.archive.ubuntu.com/ubuntu bionic-backports InRelease\n Temporary failure resolving \'se.archive.ubuntu.com\'\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\n1 package can be upgraded. Run \'apt list --upgradable\' to see it.\nW: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving \'se.archive.ubuntu.com\'\nW: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving \'se.archive.ubuntu.com\'\nW: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving \'se.archive.ubuntu.com\'\nW: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving \'security.ubuntu.com\'\nW: Some index files failed to download. They have been ignored, or old ones used instead.\nRun Code Online (Sandbox Code Playgroud)\n\n什么?是不是dns坏了?
\n\n~$ wget www.google.com\n--2018-11-10 01:55:16-- http://www.google.com/\nResolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.\nwget: unable to resolve host address \xe2\x80\x98www.google.com\xe2\x80\x99\nRun Code Online (Sandbox Code Playgroud)\n\n看起来是这样。嗯,ifconfig 不显示 dns。谷歌引导我回答这个问题,让我们尝试一下。
\n\n~$ systemd-resolve --status\nsd_bus_open_system: No such file or directory\nRun Code Online (Sandbox Code Playgroud)\n\n好吧,我现在越来越迷失了。Google现在发现这个问题,是关于docker的,这不是我的情况,但也提到了一个systemd不是pid 1的问题:
\n\n~$ ps aux\nUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\nroot 1 0.1 0.1 159752 9116 ? Ss 01:25 0:02 /sbin/init splash nomdmonddf nomdmonisw\nroot 2 0.0 0.0 0 0 ? S 01:25 0:00 [kthreadd]\nroot 3 0.0 0.0 0 0 ? S 01:25 0:00 [ksoftirqd/0]\nroot 5 0.0 0.0 0 0 ? S< 01:25 0:00 [kworker/0:0H]\nroot 7 0.0 0.0 0 0 ? S 01:25 0:00 [rcu_sched]\nroot 8 0.0 0.0 0 0 ? S 01:25 0:00 [rcu_bh]\nroot 9 0.0 0.0 0 0 ? S 01:25 0:00 [migration/0]\nroot 10 0.0 0.0 0 0 ? S 01:25 0:00 [watchdog/0]\nroot 11 0.0 0.0 0 0 ? S 01:25 0:00 [watchdog/1]\n[...]\nRun Code Online (Sandbox Code Playgroud)\n\n我猜?这是根本问题,还是表象?我怎样才能解决这个问题?
\n小智 2
升级到 18.04.01 后,我在一台 OVH VPS 服务器上遇到了同样的错误。我有其他非常相似的服务器在升级后工作正常,这帮助我解决了这个问题。
走进兔子洞并注意到:
sudo systemctl
...
systemd-logind.service loaded failed failed
...
Run Code Online (Sandbox Code Playgroud)
这引导我到这个网站: https://forum.proxmox.com/threads/systemd-logind-failures.44219/
我确认我的 /var/run 没有符号链接到 /run ,它位于其他服务器上。这个在两个地方都有文件。
我几乎按照建议进行符号链接,修复了每一行中的“目录不为空”错误:
mv -f /var/run/sudo/ts/* /run/sudo/ts/; rm -rf /var/run/sudo/ts;
mv -f /var/run/sudo/* /run/sudo/; rm -rf /var/run/sudo;
mv -f /var/run/* /run/; rm -rf /var/run;
ln -s /run /var/run;
reboot
Run Code Online (Sandbox Code Playgroud)
此步骤解决了部分问题,例如:
$ systemd-resolve --status
Run Code Online (Sandbox Code Playgroud)
但是 DNS 解析仍然失败,但使用解析工作正常:
$ ping google.com
ping: google.com: Temporary failure in name resolution
$ systemd-resolve google.com
google.com: 216.58.213.174
Run Code Online (Sandbox Code Playgroud)
根据https://superuser.com/questions/1317623/nslookup-failed-but-systemd-resolved-works中的建议
我将 /etc/resolv.conf 符号链接从 更改/run/resolvconf/resolv.conf为/run/systemd/resolve/resolv.conf
$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Feb 24 2017 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
$ sudo rm /etc/resolv.conf
$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
$ ping google.com
PING google.com (216.58.204.238) 56(84) bytes of data.
64 bytes from par21s06-in-f14.1e100.net (216.58.204.238): icmp_seq=1 ttl=53 time=9.11 ms
Run Code Online (Sandbox Code Playgroud)
现在一切正常。
| 归档时间: |
|
| 查看次数: |
10290 次 |
| 最近记录: |