AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1091561
Accepted
Zaz
Zaz
Asked: 2018-11-10 17:15:23 +0800 CST2018-11-10 17:15:23 +0800 CST 2018-11-10 17:15:23 +0800 CST

将 16.04 服务器更新到 18.04.1,现在我看到有关丢失文件、无法解析 dns、无法连接到总线的奇怪错误

  • 772

好的,所以这是从 16.04.1 LTS 升级到 18.04.1 LTS,服务器是无头的。升级完成并重新启动完成后,会发生以下情况:

尝试升级软件包只会导致以下结果:

~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  policykit-1 screen smartmontools
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,081 kB of archives.
After this operation, 147 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

(Reading database ... 159133 files and directories currently installed.)
Preparing to unpack .../smartmontools_6.5+svn4324-1_amd64.deb ...
Failed to connect to bus: No such file or directory
[...]

它正在谈论的是Dbus吗?无论如何,恢复怎么样?

~$ sudo apt update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://se.archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Err:3 http://se.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Err:4 http://se.archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

什么?dns坏了吗?

~$ wget www.google.com
--2018-11-10 01:55:16--  http://www.google.com/
Resolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.google.com’

看起来像。嗯,ifconfig 不显示 dns。谷歌引导我回答这个问题,让我们试试。

~$ systemd-resolve --status
sd_bus_open_system: No such file or directory

好吧,我现在越来越迷茫了。谷歌现在发现这个问题,是关于docker的,这不是我的情况,但也提到了systemd isnt pid 1的问题:

~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.1 159752  9116 ?        Ss   01:25   0:02 /sbin/init splash nomdmonddf nomdmonisw
root         2  0.0  0.0      0     0 ?        S    01:25   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    01:25   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   01:25   0:00 [kworker/0:0H]
root         7  0.0  0.0      0     0 ?        S    01:25   0:00 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    01:25   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    01:25   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S    01:25   0:00 [watchdog/0]
root        11  0.0  0.0      0     0 ?        S    01:25   0:00 [watchdog/1]
[...]

我猜?这是根本问题,还是症状?我怎样才能解决这个问题?

upgrade systemd dbus 18.04
  • 1 1 个回答
  • 6966 Views

1 个回答

  • Voted
  1. Best Answer
    NiJo
    2018-12-13T07:26:40+08:002018-12-13T07:26:40+08:00

    升级到 18.04.01 后,我在一台 OVH VPS 服务器上遇到了同样的错误。升级后我有其他非常相似的服务器工作正常,这帮助我解决了这个问题。

    走进一个兔子洞,注意到:

    sudo systemctl
    ...
    systemd-logind.service     loaded failed failed
    ...
    

    这导致我到这个网站: 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
    

    此步骤解决了部分问题,例如:

    $ systemd-resolve --status
    

    但是 DNS 解析仍然失败,但使用解析可以正常工作:

    $ ping google.com
    ping: google.com: Temporary failure in name resolution
    
    $ systemd-resolve google.com
    google.com: 216.58.213.174
    

    根据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
    

    现在一切正常。

    • 2

相关问题

  • 使用 apt-get upgrade 时如何强制安装内核更新?

  • 命令列出启动时启动的服务?

  • 从 8.04 LTS 升级到 10.04 LTS 的体验?

  • 分销升级的合理途径

  • 在不使用标准升级系统的情况下升级有哪些替代方案?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve