【重装解决一切……】我的小鸡的 systemd 要废了……求救

像这样,我想下载 ufwvim 之类的东西都不行,求救……

只要用 apt 命令就会报这个错误。

# apt --fix-broken install

我当然试过了,如果有用也不会专门发一个帖。

执行之后报啥错?

在这:

~# apt --fix-broken install
Correcting dependencies... Done 
The following packages were automatically installed and are no longer required:
  libinih1  python3-dbus
Use 'apt autoremove' to remove them.

Upgrading:
  systemd  systemd-sysv  systemd-timesyncd  udev

Summary:
  Upgrading: 4, Installing: 0, Removing: 0, Not Upgrading: 38
  Download size: 4646 kB
  Space needed: 9216 B / 14.8 GB available

Continue? [Y/n] Y
Get:1 http://deb.debian.org/debian trixie/main amd64 systemd-sysv amd64 257.9-1~deb13u1 [64.5 kB]
Get:2 http://deb.debian.org/debian trixie/main amd64 systemd amd64 257.9-1~deb13u1 [3096 kB]
Get:3 http://deb.debian.org/debian trixie/main amd64 udev amd64 257.9-1~deb13u1 [1392 kB]
Get:4 http://deb.debian.org/debian trixie/main amd64 systemd-timesyncd amd64 257.9-1~deb13u1 [93.0 kB]
Fetched 4646 kB in 0s (14.4 MB/s)       
Reading changelogs... Done
(Reading database ... 66994 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_257.9-1~deb13u1_amd64.deb ...
Unpacking systemd-sysv (257.9-1~deb13u1) over (257.8-1~deb13u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd-sysv_257.9-1~deb13u1_amd64.deb (--unpack):
 error creating symbolic link './usr/sbin/halt': Operation not permitted
Preparing to unpack .../systemd_257.9-1~deb13u1_amd64.deb ...
Unpacking systemd (257.9-1~deb13u1) over (257.8-1~deb13u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd_257.9-1~deb13u1_amd64.deb (--unpack):
 unable to create '/etc/systemd/journald.conf.dpkg-new' (while processing './etc/systemd/journald.conf'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
/usr/lib/tmpfiles.d/legacy.conf:14: Duplicate line for path "/run/lock", ignoring.
dpkg: considering deconfiguration of systemd, which would be broken by installation of udev ...
dpkg: yes, will deconfigure systemd (broken by udev)
Preparing to unpack .../udev_257.9-1~deb13u1_amd64.deb ...
De-configuring systemd (257.8-1~deb13u2), to allow installation of udev (257.9-1~deb13u1) ...
Unpacking udev (257.9-1~deb13u1) over (257.8-1~deb13u2) ...
dpkg: error processing archive /var/cache/apt/archives/udev_257.9-1~deb13u1_amd64.deb (--unpack):
 unable to create '/usr/bin/systemd-hwdb.dpkg-new' (while processing './usr/bin/systemd-hwdb'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
dpkg: warning: version 'in-favour' has bad syntax: version number does not start with digit
/usr/lib/tmpfiles.d/legacy.conf:14: Duplicate line for path "/run/lock", ignoring.
Preparing to unpack .../systemd-timesyncd_257.9-1~deb13u1_amd64.deb ...
Unpacking systemd-timesyncd (257.9-1~deb13u1) over (257.8-1~deb13u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd-timesyncd_257.9-1~deb13u1_amd64.deb (--unpack):
 unable to create '/etc/systemd/timesyncd.conf.dpkg-new' (while processing './etc/systemd/timesyncd.conf'): Operation not permitted
systemd-time-wait-sync.service is a disabled or a static unit not running, not starting it.
Errors were encountered while processing:
 /var/cache/apt/archives/systemd-sysv_257.9-1~deb13u1_amd64.deb
 /var/cache/apt/archives/systemd_257.9-1~deb13u1_amd64.deb
 /var/cache/apt/archives/udev_257.9-1~deb13u1_amd64.deb
 /var/cache/apt/archives/systemd-timesyncd_257.9-1~deb13u1_amd64.deb
Error: Sub-process /usr/bin/dpkg returned an error code (1)

# apt full-upgrade
or

apt clean
apt update
dpkg --configure -a
apt --fix-broken install

试试w

进到root里了就不用sudo了呀www
(不是很推荐在root里跑apt呢,还是sudo比较好叭

这是真的字面意思上的没办法用 apt 命令。

~# apt full-upgrade
You might want to run 'apt --fix-broken install' to correct these.
Unsatisfied dependencies:
 libnss-systemd : Depends: systemd (= 257.9-1~deb13u1) but 257.8-1~deb13u2 is installed
 libpam-systemd : Depends: systemd (= 257.9-1~deb13u1) but 257.8-1~deb13u2 is installed
 systemd : PreDepends: libsystemd-shared (= 257.8-1~deb13u2) but 257.9-1~deb13u1 is installed
           Depends: libsystemd0 (= 257.8-1~deb13u2) but 257.9-1~deb13u1 is installed
           Recommends: systemd-cryptsetup but it is not installed
 systemd-timesyncd : Depends: libsystemd-shared (= 257.8-1~deb13u2) but 257.9-1~deb13u1 is installed
 udev : Depends: libsystemd-shared (= 257.8-1~deb13u2) but 257.9-1~deb13u1 is installed
        Depends: libudev1 (= 257.8-1~deb13u2) but 257.9-1~deb13u1 is installed
Error: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
apt-mark hold systemd systemd-sysv systemd-timesyncd udev libsystemd0 libsystemd-shared
apt --fix-broken install

试试w

lsattr /usr/sbin/halt /etc/systemd/journald.conf

里面有没有一个‘i’?

你这有几个报 Operation not permitted的,你 ls -la $file_path看下

Xshell 连不上,在宝塔面板里跑的……

2 个赞

什么系统,什么架构?有可能是镜像源配到其他版本和架构上面去了

Debian 12 (Bookworm)
直接重装也不是不行w

killed by signal
是不是内存不够被杀了

在这里:

root@racknerd-1b89596:~# ls -la $file_path
total 3988
dr-xr-x---  8 root root    4096 Dec 20 22:37 .
drwxr-xr-x 21 root root    4096 Oct 11 22:32 ..
-rw-------  1 root root      62 Oct 24 20:32 .Xauthority
-rw-r--r--  1 root root   15048 Dec 20 22:58 .bash_history
-rw-r--r--  1 root root     665 Oct 11 23:23 .bashrc
drwxr-xr-x  3 root root    4096 Oct 11 22:13 .cache
drwx------  4 root root    4096 Oct 11 22:17 .config
-rw-------  1 root root      20 Dec 20 22:31 .lesshst
drwxrwxr-x  3 root root    4096 Sep  7 06:36 .local
drwxr-xr-x  2 root root    4096 Oct 11 22:09 .pip
-rw-r--r--  1 root root     132 Aug 25 00:20 .profile
drwx------  2 root root    4096 Oct 11 21:58 .ssh
-rw-r--r--  1 root root     411 Dec 20 21:22 .wget-hsts
-rw-r--r--  1 root root 3986357 May 14  2020 curl-7.70.0.tar.gz.1
drwxr-xr-x  2 root root    4096 Oct 12 02:06 hysteria.json
-rw-r--r--  1 root root   10952 Dec 20 22:25 installed-packages.txt
-rw-r--r--  1 root root   10952 Dec 20 22:37 installed_packages.txt

系统:Debian GNU/Linux 13 (trixie) x86_64(Py3.7.16)

架构找不到了……

这不是写了x86_64

apt 是没指望了。

root@racknerd-1b89596:~# lsattr /usr/sbin/halt /etc/systemd/journald.conf
lsattr: Operation not supported While reading flags on /usr/sbin/halt
----i---------e------- /etc/systemd/journald.conf

这是 lsattr 的结果。

看看 aptitude :eyes:

依赖混乱,不让我装 aptitude