ubuntu 安装ssh 出现 Unsafe symlinks encountered in /var/log/journal, refusing. 错误

现象描述:

使用ubuntu 安装ssh 出现 Unsafe symlinks encountered in /var/log/journal, refusing.错误。

错误信息如下:

Installing new version of config file /etc/pam.d/systemd-user ...
Installing new version of config file /etc/systemd/journald.conf ...
Installing new version of config file /etc/systemd/logind.conf ...
Installing new version of config file /etc/systemd/resolved.conf ...
Installing new version of config file /etc/systemd/system.conf ...
Installing new version of config file /etc/systemd/timesyncd.conf ...
Installing new version of config file /etc/systemd/user.conf ...
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
Synchronizing state of ondemand.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ondemand
Unsafe symlinks encountered in /var/log/journal, refusing.
Unsafe symlinks encountered in /var/log/journal, refusing.
Unsafe symlinks encountered in /var/log/journal, refusing.
Unsafe symlinks encountered in /var/log/journal, refusing.
dpkg: error processing package systemd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决方案:

#查看/目录所有者
$ stat -c "%U %G" /

root@localhost:/# stat -c "%U %G" /
UNKNOWN UNKNOWN

#改变/目录权限
$ chown root:root /
root@localhost:/# stat -c "%U %G" /
root root

继续安装ssh:
 

$ apt install openssh-server -y

....
Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:Lwkx5O26s6rXOAVz/muLMM9QMJXJaxPPiQV7teIfcJs root@localhost.localdomain (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:s/7+ZEyJOn6hhWglX3pVy1uogdv7C3VLxd8WsEJGZps root@localhost.localdomain (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:6A5iI0rxAKxsb3U8DGvzxKJ0g8U5oCFZijJPM4D+2hg root@localhost.localdomain (ED25519)
Setting up python3-certifi (2018.1.18-2) ...
Setting up python3-pkg-resources (39.0.1-2) ...
Setting up python3-chardet (3.0.4-1) ...
Setting up python3-idna (2.6-1) ...
Setting up python3-six (1.11.0-2) ...
Setting up python3-urllib3 (1.22-1ubuntu0.18.04.2) ...
Setting up python3-requests (2.18.4-2ubuntu0.1) ...
Setting up ssh-import-id (5.7-0ubuntu1.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for systemd (237-3ubuntu10.49) ...
Processing triggers for ureadahead (0.100.0-19) ...

通过上面修改,可以正常安装 软件。

参考链接:https://ubuntuforums.org/showthread.php?t=2406453

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值