是否可以只安装 software-properties-common 而不在 buildpack-deps:jammy Docker 镜像中安装 systemd?

是否可以只安装 software-properties-common 而不在 buildpack-deps:jammy Docker 镜像中安装 systemd?

我在尝试手动安装 Docker 容器以调试构建问题时遇到了一些software-properties-common问题buildpack-deps:jammy

root@51e620a00bb6:/# apt install software-properties-common --no-install-recommends
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  dbus distro-info-data gir1.2-packagekitglib-1.0 iso-codes libapparmor1 libappstream4 libargon2-1 libcap2-bin libcryptsetup12 libdbus-1-3
  libdevmapper1.02.1 libdw1 libgstreamer1.0-0 libip4tc2 libjson-c5 libkmod2 libpackagekit-glib2-18 libpam-systemd libpolkit-agent-1-0
  libpolkit-gobject-1-0 libstemmer0d libunwind8 libxmlb2 lsb-release packagekit pkexec policykit-1 polkitd python-apt-common python3-apt
  python3-blinker python3-cffi-backend python3-cryptography python3-dbus python3-distro python3-gi python3-httplib2 python3-importlib-metadata
  python3-jeepney python3-jwt python3-keyring python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-more-itertools
  python3-oauthlib python3-pkg-resources python3-pyparsing python3-secretstorage python3-six python3-software-properties python3-wadllib
  python3-zipp systemd systemd-sysv
Suggested packages:
  default-dbus-session-bus | dbus-session-bus isoquery gstreamer1.0-tools appstream python3-apt-dbg python-apt-doc python-blinker-doc
  python-cryptography-doc python3-cryptography-vectors python-dbus-doc python3-crypto gir1.2-secret-1 gnome-keyring libkf5wallet-bin
  python3-keyrings.alt python3-testresources python3-setuptools python-pyparsing-doc python-secretstorage-doc systemd-container
Recommended packages:
  libpam-cap dmsetup packagekit-tools unattended-upgrades networkd-dispatcher systemd-timesyncd | time-daemon libnss-systemd
The following NEW packages will be installed:
  dbus distro-info-data gir1.2-packagekitglib-1.0 iso-codes libapparmor1 libappstream4 libargon2-1 libcap2-bin libcryptsetup12 libdbus-1-3
  libdevmapper1.02.1 libdw1 libgstreamer1.0-0 libip4tc2 libjson-c5 libkmod2 libpackagekit-glib2-18 libpam-systemd libpolkit-agent-1-0
  libpolkit-gobject-1-0 libstemmer0d libunwind8 libxmlb2 lsb-release packagekit pkexec policykit-1 polkitd python-apt-common python3-apt
  python3-blinker python3-cffi-backend python3-cryptography python3-dbus python3-distro python3-gi python3-httplib2 python3-importlib-metadata
  python3-jeepney python3-jwt python3-keyring python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-more-itertools
  python3-oauthlib python3-pkg-resources python3-pyparsing python3-secretstorage python3-six python3-software-properties python3-wadllib
  python3-zipp software-properties-common systemd systemd-sysv
0 upgraded, 56 newly installed, 0 to remove and 7 not upgraded.
Need to get 13.2 MB of archives.
After this operation, 58.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libapparmor1 amd64 3.0.4-2ubuntu2 [38.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libargon2-1 amd64 0~20171227-0.3 [19.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdevmapper1.02.1 amd64 2:1.02.175-2.1ubuntu4 [139 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libjson-c5 amd64 0.15-3~ubuntu1.22.04.1 [33.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcryptsetup12 amd64 2:2.4.3-1ubuntu1 [211 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libip4tc2 amd64 1.8.7-1ubuntu5 [19.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 libkmod2 amd64 29-1ubuntu1 [48.0 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 systemd amd64 249.11-0ubuntu3.1 [4554 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 systemd-sysv amd64 249.11-0ubuntu3.1 [10.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbus-1-3 amd64 1.12.20-2ubuntu4 [188 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 dbus amd64 1.12.20-2ubuntu4 [158 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 distro-info-data all 0.52ubuntu0.1 [5124 B]
Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 iso-codes all 4.9.0-1 [3459 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcap2-bin amd64 1:2.44-1build3 [26.0 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpam-systemd amd64 249.11-0ubuntu3.1 [203 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy/main amd64 lsb-release all 11.1.0ubuntu4 [10.8 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 python-apt-common all 2.3.0ubuntu2 [15.2 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-apt amd64 2.3.0ubuntu2 [165 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-dbus amd64 1.2.18-3build1 [99.5 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-gi amd64 3.42.0-3build1 [229 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-pkg-resources all 59.6.0-1.2 [132 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/main amd64 libpackagekit-glib2-18 amd64 1.2.5-2ubuntu2 [123 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy/main amd64 gir1.2-packagekitglib-1.0 amd64 1.2.5-2ubuntu2 [25.3 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy/main amd64 libstemmer0d amd64 2.2.0-1build1 [165 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxmlb2 amd64 0.3.6-2build1 [67.8 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy/main amd64 libappstream4 amd64 0.15.2-2 [192 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdw1 amd64 0.186-1build1 [250 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy/main amd64 libunwind8 amd64 1.3.2-2build2 [54.5 kB]
Get:29 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgstreamer1.0-0 amd64 1.20.1-1 [983 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy/main amd64 libpolkit-gobject-1-0 amd64 0.105-33 [43.2 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy/main amd64 libpolkit-agent-1-0 amd64 0.105-33 [16.8 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy/main amd64 polkitd amd64 0.105-33 [80.0 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy/main amd64 pkexec amd64 0.105-33 [15.2 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy/main amd64 policykit-1 amd64 0.105-33 [2426 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-blinker all 1.4+dfsg1-0.4 [14.0 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-cffi-backend amd64 1.15.0-1build2 [77.4 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-cryptography amd64 3.4.8-1ubuntu2 [236 kB]
Get:38 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-pyparsing all 2.4.7-1 [61.4 kB]
Get:39 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-httplib2 all 0.20.2-2 [30.4 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-more-itertools all 8.10.0-2 [47.9 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-zipp all 1.0.0-3 [5440 B]
Get:42 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-importlib-metadata all 4.6.4-1 [16.2 kB]
Get:43 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-jeepney all 0.7.1-3 [36.8 kB]
Get:44 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-jwt all 2.3.0-1 [16.3 kB]
Get:45 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-secretstorage all 3.3.1-1 [13.2 kB]
Get:46 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-keyring all 23.5.0-1 [35.7 kB]
Get:47 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-lazr.uri all 1.0.6-2 [14.4 kB]
Get:48 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-wadllib all 1.3.6-1 [36.4 kB]
Get:49 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-distro all 1.7.0-1 [17.0 kB]
Get:50 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-oauthlib all 3.2.0-1 [89.7 kB]
Get:51 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-six all 1.16.0-3ubuntu1 [12.6 kB]
Get:52 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-lazr.restfulclient all 0.14.4-1 [51.2 kB]
Get:53 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-launchpadlib all 1.10.16-1 [125 kB]
Get:54 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-software-properties all 0.99.22.1 [28.8 kB]
Get:55 http://archive.ubuntu.com/ubuntu jammy/main amd64 packagekit amd64 1.2.5-2ubuntu2 [442 kB]
Get:56 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 software-properties-common all 0.99.22.1 [14.1 kB]
Fetched 13.2 MB in 3s (4583 kB/s)                      
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libapparmor1:amd64.
(Reading database ... 21683 files and directories currently installed.)
Preparing to unpack .../0-libapparmor1_3.0.4-2ubuntu2_amd64.deb ...
Unpacking libapparmor1:amd64 (3.0.4-2ubuntu2) ...
Selecting previously unselected package libargon2-1:amd64.
Preparing to unpack .../1-libargon2-1_0~20171227-0.3_amd64.deb ...
Unpacking libargon2-1:amd64 (0~20171227-0.3) ...
Selecting previously unselected package libdevmapper1.02.1:amd64.
Preparing to unpack .../2-libdevmapper1.02.1_2%3a1.02.175-2.1ubuntu4_amd64.deb ...
Unpacking libdevmapper1.02.1:amd64 (2:1.02.175-2.1ubuntu4) ...
Selecting previously unselected package libjson-c5:amd64.
Preparing to unpack .../3-libjson-c5_0.15-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking libjson-c5:amd64 (0.15-3~ubuntu1.22.04.1) ...
Selecting previously unselected package libcryptsetup12:amd64.
Preparing to unpack .../4-libcryptsetup12_2%3a2.4.3-1ubuntu1_amd64.deb ...
Unpacking libcryptsetup12:amd64 (2:2.4.3-1ubuntu1) ...
Selecting previously unselected package libip4tc2:amd64.
Preparing to unpack .../5-libip4tc2_1.8.7-1ubuntu5_amd64.deb ...
Unpacking libip4tc2:amd64 (1.8.7-1ubuntu5) ...
Selecting previously unselected package libkmod2:amd64.
Preparing to unpack .../6-libkmod2_29-1ubuntu1_amd64.deb ...
Unpacking libkmod2:amd64 (29-1ubuntu1) ...
Selecting previously unselected package systemd.
Preparing to unpack .../7-systemd_249.11-0ubuntu3.1_amd64.deb ...
Unpacking systemd (249.11-0ubuntu3.1) ...
dpkg: error: error executing hook 'if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi', exit code 32512
E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Problem executing scripts DPkg::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code

是否可以只安装software-properties-common而不安装其他内容systemd?我该如何解决Problem executing scripts DPkg::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'错误?谢谢!

相关内容