$ sudo apt install nodejs npm Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: libssl-dev : Depends: libssl3 (= 3.0.13-1~deb12u1) libuv1t64 : Breaks: libuv1 (< 1.48.0-1.1) E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
很奇怪,为什么会装不上?所以理所应当的敲下了
1 2
$ sudo apt install aptitude $ aptitude nodejs npm
这下子很顺利,终端输出了一长串的待安装的包,但是出现了两个无法解决的依赖问题,aptitude给出了解决方案,很自然的输入 Y 一路往下走(注意这里的neovim,这里是伏笔)
$ aptitude install nodejs npm The following NEW packages will be installed: cpp{a} cpp-12{a} eslint{a} gyp{a} handlebars{a} javascript-common{a} libauthen-sasl-perl{a} libc-ares2{a} libclone-perl{a} libdata-dump-perl{a} libdrm-amdgpu1{a} libdrm-common{a} libdrm-intel1{a} libdrm-nouveau2{a} libdrm-radeon1{a} libdrm2{a} ..... ..... perl-openssl-defaults{a} terser{a} webpack{a} x11-utils{a} x11-xserver-utils{a} xdg-utils{a} zutty{a} 0 packages upgraded, 493 newly installed, 0 to remove and 0 not upgraded. Need to get 84.1 MB of archives. After unpacking 401 MB will be used. The following packages have unmet dependencies: libuv1-dev : Depends: libuv1 (= 1.44.2-1+deb12u1) but it is not going to be installed libssl-dev : Depends: libssl3 (= 3.0.13-1~deb12u1) but it is not going to be installed The following actions will resolve these dependencies:
Remove the following packages: 1) libuv1t64 [1.48.0-5 (now)] 2) lua-luv [1.48.0-2-2 (now)] 3) neovim [0.9.5-7+b1 (now)]
Install the following packages: 4) libuv1 [1.44.2-1+deb12u1 (stable, stable-security)]
Keep the following packages at their current version: 5) libnode-dev [Not Installed] 6) libssl-dev [Not Installed] 7) node-gyp [Not Installed] 8) npm [Not Installed]
Leave the following dependencies unresolved: 9) python3-pynvim recommends neovim
Accept this solution? [Y/n/q/?] Y The following NEW packages will be installed: cpp{a} cpp-12{a} libauthen-sasl-perl{a} libc-ares2{a} libclone-perl{a} libdata-dump-perl{a} libdrm-amdgpu1{a} libdrm-common{a} libdrm-intel1{a} libdrm-nouveau2{a} libdrm-radeon1{a} libdrm2{a} libegl-mesa0{a} libegl1{a} libencode-locale-perl{a} ..... ..... x11-utils{a} x11-xserver-utils{a} xdg-utils{a} zutty{a} The following packages will be REMOVED: libmsgpack-c2{u} libtermkey1{u} libtree-sitter0{u} libunibilium4{u} libuv1t64{a} libvterm0{u} lua-luv{a} neovim{a} neovim-runtime{u} python3-greenlet{u} python3-msgpack{u} python3-pynvim{u} xclip{u} 0 packages upgraded, 107 newly installed, 13 to remove and 0 not upgraded. Need to get 69.7 MB of archives. After unpacking 260 MB will be used. Do you want to continue? [Y/n/?] Y Get: 1 http://deb.debian.org/debian bookworm/main amd64 libuv1 amd64 1.44.2-1+deb12u1 [136 kB] Get: 2 http://deb.debian.org/debian bookworm/main amd64 libisl23 amd64 0.25-1.1 [683 kB] ...... ...... Get: 106 http://deb.debian.org/debian bookworm/main amd64 libegl1 amd64 1.6.0-1 [33.7 kB] Get: 107 http://deb.debian.org/debian bookworm/main amd64 zutty amd64 0.14.0.20230218+dfsg1-1 [177 kB] Fetched 69.7 MB in 12s (5,764 kB/s) Extracting templates from packages: 100% (Reading database ... 46085 files and directories currently installed.) Removing neovim (0.9.5-7+b1) ... update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/ex (ex) in auto mode update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/rview (rview) in auto mode update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/vi (vi) in auto mode update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/view (view) in auto mode Removing libmsgpack-c2:amd64 (6.0.1-3) ... Removing libtermkey1:amd64 (0.22-1) ... Removing libtree-sitter0:amd64 (0.20.8-2+b1) ... Removing libunibilium4:amd64 (2.1.0-1) ... Removing lua-luv:amd64 (1.48.0-2-2) ... dpkg: libuv1t64:amd64: dependency problems, but removing anyway as you requested: bind9-libs:amd64 depends on libuv1 (>= 1.40.0); however: Package libuv1 is not installed. Package libuv1t64:amd64 which provides libuv1 is to be removed.
Removing libuv1t64:amd64 (1.48.0-5) ... Selecting previously unselected package libuv1:amd64. (Reading database ... 46018 files and directories currently installed.) Preparing to unpack .../libuv1_1.44.2-1+deb12u1_amd64.deb ... Unpacking libuv1:amd64 (1.44.2-1+deb12u1) ... (Reading database ... 46022 files and directories currently installed.) Removing libvterm0:amd64 (0.3.3-3) ... Removing neovim-runtime (0.9.5-7) ... Removing python3-pynvim (0.4.2-2) ... Removing python3-greenlet (2.0.2-1) ... Removing python3-msgpack (1.0.3-2+b1) ... Removing xclip (0.13-2) ... Selecting previously unselected package libisl23:amd64. (Reading database ... 44066 files and directories currently installed.) ..... ..... Selecting previously unselected package zutty. Preparing to unpack .../105-zutty_0.14.0.20230218+dfsg1-1_amd64.deb ... Unpacking zutty (0.14.0.20230218+dfsg1-1) ... Setting up libxcb-dri3-0:amd64 (1.15-1) ... Setting up libwayland-server0:amd64 (1.21.0-1) ... ..... ..... Setting up libglx0:amd64 (1.6.0-1) ... Setting up libgl1:amd64 (1.6.0-1) ... Setting up zutty (0.14.0.20230218+dfsg1-1) ... update-alternatives: using /usr/bin/zutty to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode Setting up x11-utils (7.7+5) ... Setting up node-acorn (8.8.1+ds+~cs25.17.7-2) ... Setting up liblwp-protocol-https-perl (6.10-1) ... Setting up libwww-perl (6.68-1) ... Setting up libnode108:amd64 (18.19.0+dfsg-6~deb12u2) ... Setting up nodejs (18.19.0+dfsg-6~deb12u2) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Setting up libxml-parser-perl (2.46-4) ... Setting up libxml-twig-perl (1:3.52-2) ... Setting up libnet-dbus-perl (1.2.0-2) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for mailcap (3.70+nmu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for libc-bin (2.39-6) ...
$ sudo apt-get install ninja-build gettext cmake unzip curl build-essential Reading package lists... Done Building dependency tree... Done Reading state information... Done cmake is already the newest version (3.25.1-1). unzip is already the newest version (6.0-28). curl is already the newest version (7.88.1-10+deb12u6). Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: libc6-dev : Depends: libc6 (= 2.36-9+deb12u7) but 2.39-6 is to be installed Depends: libc-dev-bin (= 2.36-9+deb12u7) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
$ aptitude install ninja-build gettext cmake unzip curl build-essential ninja-build is already installed at the requested version (1.11.1-1) gettext is already installed at the requested version (0.21-12) cmake is already installed at the requested version (3.25.1-1) unzip is already installed at the requested version (6.0-28) curl is already installed at the requested version (7.88.1-10+deb12u6) ninja-build is already installed at the requested version (1.11.1-1) gettext is already installed at the requested version (0.21-12) cmake is already installed at the requested version (3.25.1-1) unzip is already installed at the requested version (6.0-28) curl is already installed at the requested version (7.88.1-10+deb12u6) The following NEW packages will be installed: build-essential{b} 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 7,704 B of archives. After unpacking 20.5 kB will be used. The following packages have unmet dependencies: build-essential : Depends: libc6-dev but it is not installable or libc-dev which is a virtual package, provided by: - libc6-dev (2.36-9+deb12u7), but it is not installable
Depends: g++ (>= 4:10.2) but it is not installable The following actions will resolve these dependencies:
Keep the following packages at their current version: 1) build-essential [Not Installed]
终端输出中可以看到
Depends: g++ (>= 4:10.2) but it is not installable
g++ 无法安装? 用 apt 单独安装尝试一下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$ apt install gcc g++ Reading package lists... Done Building dependency tree... Done Reading state information... Done gcc is already the newest version (4:12.2.0-3). gcc set to manually installed. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: libc6-dev : Depends: libc6 (= 2.36-9+deb12u7) but 2.39-6 is to be installed Depends: libc-dev-bin (= 2.36-9+deb12u7) but it is not going to be installed
$ apt remove libc6 Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: apt : Depends: adduser but it is not going to be installed Depends: gpgv but it is not going to be installed or gpgv2 but it is not going to be installed or gpgv1 but it is not going to be installed Depends: libapt-pkg6.0 (>= 2.6.1) but it is not going to be installed Depends: libc6 (>= 2.34) but it is not going to be installed Depends: libgnutls30 (>= 3.7.5) but it is not going to be installed Depends: libseccomp2 (>= 2.4.2) but it is not going to be installed Depends: libstdc++6 (>= 11) but it is not going to be installed Depends: libsystemd0 Recommends: ca-certificates but it is not going to be installed ..... ..... util-linux : PreDepends: libblkid1 (>= 2.37.2) but it is not going to be installed PreDepends: libc6 (>= 2.34) but it is not going to be installed PreDepends: libcap-ng0 (>= 0.7.9) but it is not going to be installed PreDepends: libmount1 (>= 2.38) but it is not going to be installed PreDepends: libpam0g (>= 0.99.7.1) but it is not going to be installed PreDepends: libselinux1 (>= 3.1~) but it is not going to be installed PreDepends: libsmartcols1 (>= 2.38) but it is not going to be installed PreDepends: libsystemd0 PreDepends: libtinfo6 (>= 6) but it is not going to be installed PreDepends: libudev1 (>= 183) but it is not going to be installed PreDepends: libuuid1 (>= 2.16) but it is not going to be installed PreDepends: zlib1g (>= 1:1.1.4) but it is not going to be installed Depends: util-linux-extra but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. $ apt install libc6 Reading package lists... Done Building dependency tree... Done Reading state information... Done libc6 is already the newest version (2.39-6). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
重启机器, 问题依旧。
漫漫降级路
这个时候,万般思绪中看到
libc6 (= 2.36-9+deb12u7) but 2.39-6 is to be installed
$ aptitude install base-files=12.4+deb12u6 bind9-dnsutils=1:9.18.24-1 bind9-host=1:9.18.24-1 bind9-libs:amd64=1:9.18.24-1 curl=7.88.1-10+deb12u5 dnsutils=1:9.18.24-1 intel-microcode=3.20231114.1~deb12u1 krb5-locales=1.20.1-2+deb12u1 libc-l10n=2.36-9+deb12u7 libcurl3-gnutls:amd64=7.88.1-10+deb12u5 libcurl4:amd64=7.88.1-10+deb12u5 libglib2.0-0:amd64=2.74.6-2+deb12u2 libglib2.0-data=2.74.6-2+deb12u2 libgssapi-krb5-2:amd64=1.20.1-2+deb12u1 libk5crypto3:amd64=1.20.1-2+deb12u1 libkrb5-3:amd64=1.20.1-2+deb12u1 libkrb5support0:amd64=1.20.1-2+deb12u1 libnode108:amd64=18.19.0+dfsg-6~deb12u1 libpq5:amd64=15.6-0+deb12u1 libssl3:amd64=3.0.11-1~deb12u2 libsystemd-shared:amd64=252.26-1~deb12u2 libsystemd0:amd64=252.26-1~deb12u2 libudev1:amd64=252.26-1~deb12u2 libzstd1:amd64=1.5.4+dfsg2-5 linux-base=4.9 linux-libc-dev:amd64=6.1.94-1 node-undici=5.15.0+dfsg1+~cs20.10.9.3-1+deb12u3 nodejs=18.19.0+dfsg-6~deb12u1 nodejs-doc=18.19.0+dfsg-6~deb12u1 openssh-client=1:9.2p1-2+deb12u2 openssh-server=1:9.2p1-2+deb12u2 openssh-sftp-server=1:9.2p1-2+deb12u2 openssl=3.0.11-1~deb12u2 python3-cryptography=38.0.4-3~deb12u1 systemd-sysv=254.16-1~bpo12+1 zstd=1.5.4+dfsg2-5 The following packages will be DOWNGRADED: base-files bind9-dnsutils bind9-host bind9-libs curl dnsutils intel-microcode krb5-locales libc-l10n libcurl3-gnutls libcurl4 libglib2.0-0 libglib2.0-data libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libnode108 libpq5 libssl3 libsystemd-shared libsystemd0 libudev1 libzstd1 linux-base linux-libc-dev node-undici nodejs nodejs-doc openssh-client openssh-server openssh-sftp-server openssl python3-cryptography systemd-sysv zstd The following partially installed packages will be configured: systemd{b} udev{b} The following packages are RECOMMENDED but will NOT be installed: libnss-systemd libpam-elogind libpam-systemd 0 packages upgraded, 0 newly installed, 36 downgraded, 0 to remove and 0 not upgraded. Need to get 37.9 MB/39.3 MB of archives. After unpacking 2,714 kB will be freed. The following packages have unmet dependencies: udev : Depends: libudev1 (= 254.16-1~bpo12+1) but 252.26-1~deb12u2 is to be installed systemd : Depends: libsystemd-shared (= 254.16-1~bpo12+1) but 252.26-1~deb12u2 is to be installed Depends: libsystemd0 (= 254.16-1~bpo12+1) but 252.26-1~deb12u2 is to be installed The following actions will resolve these dependencies:
Keep the following packages at their current version: 11) libudev1 [254.16-1~bpo12+1 (now, stable-backports)]
Accept this solution? [Y/n/q/?] Y The following packages will be DOWNGRADED: base-files bind9-dnsutils bind9-host bind9-libs curl dnsutils intel-microcode krb5-locales libc-l10n libcurl3-gnutls libcurl4 libglib2.0-0 libglib2.0-data libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libnode108 libpq5 libssl3 libsystemd-shared libsystemd0 libzstd1 linux-base linux-libc-dev node-undici nodejs nodejs-doc openssh-client openssh-server openssh-sftp-server openssl python3-cryptography zstd The following NEW packages will be installed: initscripts{a} insserv{a} opensysusers{a} orphan-sysvinit-scripts{a} psmisc{a} startpar{a} sysv-rc{a} sysvinit-core{a} The following packages will be REMOVED: systemd{a} systemd-sysv{a} The following partially installed packages will be configured: udev The following packages are RECOMMENDED but will NOT be installed: libpam-elogind libpam-systemd 0 packages upgraded, 8 newly installed, 34 downgraded, 2 to remove and 1 not upgraded. Need to get 37.7 MB/39.8 MB of archives. After unpacking 11.5 MB will be freed. Do you want to continue? [Y/n/?] Y Get: 1 http://deb.debian.org/debian bookworm/main amd64 base-files amd64 12.4+deb12u6 [70.8 kB] Get: 2 http://security.debian.org/debian-security bookworm-security/main amd64 libssl3 amd64 3.0.11-1~deb12u2 [2,019 kB] Get: 3 http://deb.debian.org/debian bookworm/main amd64 opensysusers all 0.7.3-2 [14.3 kB] ..... ..... Get: 34 http://security.debian.org/debian-security bookworm-security/main amd64 python3-cryptography amd64 38.0.4-3~deb12u1 [666 kB] Fetched 37.7 MB in 7s (5,574 kB/s) Extracting templates from packages: 100% Preconfiguring packages ... dpkg: warning: downgrading base-files from 13.3 to 12.4+deb12u6 (Reading database ... 56853 files and directories currently installed.) Preparing to unpack .../base-files_12.4+deb12u6_amd64.deb ... Unpacking base-files (12.4+deb12u6) over (13.3) ... dpkg: warning: unable to delete old directory '/usr/lib64': Directory not empty Setting up base-files (12.4+deb12u6) ... Installing new version of config file /etc/debian_version ... Installing new version of config file /etc/issue ... Installing new version of config file /etc/issue.net ... dpkg: systemd-sysv: dependency problems, but removing anyway as you requested: init depends on systemd-sysv | sysvinit-core; however: Package systemd-sysv is to be removed. Package sysvinit-core is not installed.
(Reading database ... 56846 files and directories currently installed.) Removing systemd-sysv (256.4-2) ... Selecting previously unselected package sysvinit-core. (Reading database ... 56830 files and directories currently installed.) Preparing to unpack .../0-sysvinit-core_3.06-4_amd64.deb ... Adding 'diversion of /usr/share/man/de/man8/init.8.gz to /usr/share/man/de/man8/init.8.dist by sysvinit-core' ..... ..... /sbin/modprobe: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory depmod: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory Errors were encountered while processing: systemd
$ apt-get reinstall openssl Reading package lists... Done Building dependency tree... Done Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded. 1 not fully installed or removed. Need to get 0 B/1,418 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 56653 files and directories currently installed.) Preparing to unpack .../openssl_3.0.13-1~deb12u1_amd64.deb ... Unpacking openssl (3.0.13-1~deb12u1) over (3.0.13-1~deb12u1) ... Setting up systemd (254.16-1~bpo12+1) ... systemd-machine-id-setup: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory dpkg: error processing package systemd (--configure): installed systemd package post-installation script subprocess returned error exit status 127 Setting up openssl (3.0.13-1~deb12u1) ... Processing triggers for man-db (2.11.2-2) ... Errors were encountered while processing: systemd E: Sub-process /usr/bin/dpkg returned an error code (1)
Reading package lists... Done Building dependency tree... Done Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 0 B/2,022 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 56657 files and directories currently installed.) Preparing to unpack .../libssl3_3.0.13-1~deb12u1_amd64.deb ... Unpacking libssl3:amd64 (3.0.13-1~deb12u1) over (3.0.13-1~deb12u1) ... Setting up libssl3:amd64 (3.0.13-1~deb12u1) ... Setting up systemd (254.16-1~bpo12+1) ... groupadd: invalid group ID '4:65534' groupadd: invalid group ID '42:65534' groupadd: invalid group ID '65534:65534' Processing triggers for libc-bin (2.36-9+deb12u7) ...