docker compose 无法安装!
现在的关键问题是:你的系统,导致无法被安装。这通常是由于:网络问题(GFW/防火墙/代理)Docker 源被墙或不通。
(base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ sudo apt-get install ca-certificates curl gnupg lsb-release Reading package lists... Done Building dependency tree Reading state information... Done lsb-release is already the newest version (11.1.0ubuntu2). ca-certificates is already the newest version (20240203~20.04.1). curl is already the newest version (7.68.0-1ubuntu2.25). gnupg is already the newest version (2.2.19-3ubuntu2.5). The following packages were automatically installed and are no longer required: apt-clone archdetect-deb cryptsetup-bin dctrl-tools dmeventd dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 gyp javascript-common libaio1 libdebian-installer4 libdevmapper-event1.02.1 libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer liblvm2cmd2.03 libreadline5 libreadline6 libtimezonemap-data libtimezonemap1 libuv1-dev lvm2 node-abbrev node-ajv node-ansi node-ansi-align node-ansi-regex node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet node-asap node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4 node-balanced-match node-bcrypt-pbkdf node-bl node-bluebird node-boxen node-brace-expansion node-builtin-modules node-builtins node-cacache node-call-limit node-camelcase node-caseless node-chalk node-chownr node-ci-info node-cli-boxes node-cliui node-clone node-co node-color-convert node-color-name node-colors node-columnify node-combined-stream node-concat-map node-concat-stream node-config-chain node-configstore node-console-control-strings node-copy-concurrently node-core-util-is node-cross-spawn node-crypto-random-string node-cyclist node-dashdash node-debug node-decamelize node-decompress-response node-deep-extend node-defaults node-define-properties node-delayed-stream node-delegates node-detect-indent node-detect-newline node-dot-prop node-duplexer3 node-duplexify node-ecc-jsbn node-editor node-encoding node-end-of-stream node-err-code node-errno node-es6-promise node-escape-string-regexp node-execa node-extend node-extsprintf node-fast-deep-equal node-find-up node-flush-write-stream node-forever-agent node-form-data node-from2 node-fs-vacuum node-fs-write-stream-atomic node-fs.realpath node-function-bind node-gauge node-genfun node-get-caller-file node-get-stream node-getpass node-glob node-got node-graceful-fs node-har-schema node-har-validator node-has-flag node-has-symbol-support-x node-has-to-string-tag-x node-has-unicode node-hosted-git-info node-http-signature node-iconv-lite node-iferr node-import-lazy node-imurmurhash node-inflight node-inherits node-ini node-invert-kv node-ip node-ip-regex node-is-npm node-is-obj node-is-object node-is-path-inside node-is-plain-obj node-is-retry-allowed node-is-stream node-is-typedarray node-isarray node-isexe node-isstream node-isurl node-jsbn node-json-parse-better-errors node-json-schema node-json-schema-traverse node-json-stable-stringify node-json-stringify-safe node-jsonify node-jsonparse node-jsonstream node-jsprim node-latest-version node-lazy-property node-lcid node-libnpx node-locate-path node-lockfile node-lodash node-lodash-packages node-lowercase-keys node-lru-cache node-make-dir node-mem node-mime node-mime-types node-mimic-fn node-mimic-response node-minimatch node-minimist node-mississippi node-mkdirp node-move-concurrently node-ms node-mute-stream node-nopt node-normalize-package-data node-npm-bundled node-npm-package-arg node-npm-run-path node-npmlog node-number-is-nan node-oauth-sign node-object-assign node-once node-opener node-os-locale node-os-tmpdir node-osenv node-p-cancelable node-p-finally node-p-is-promise node-p-limit node-p-locate node-p-timeout node-package-json node-parallel-transform node-path-exists node-path-is-absolute node-path-is-inside node-performance-now node-pify node-prepend-http node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-proto-list node-prr node-pseudomap node-psl node-pump node-pumpify node-punycode node-qs node-qw node-rc node-read node-read-package-json node-readable-stream node-registry-auth-token node-registry-url node-request node-require-directory node-require-main-filename node-resolve node-resolve-from node-retry node-rimraf node-run-queue node-safe-buffer node-semver node-semver-diff node-set-blocking node-sha node-shebang-command node-shebang-regex node-signal-exit node-slash node-slide node-sorted-object node-spdx-correct node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-stream-each node-stream-iterate node-stream-shift node-strict-uri-encode node-string-decoder node-string-width node-strip-ansi node-strip-eof node-strip-json-comments node-supports-color node-tar node-term-size node-text-table node-through node-through2 node-timed-out node-tough-cookie node-tunnel-agent node-tweetnacl node-typedarray node-typedarray-to-buffer node-uid-number node-unique-filename node-unique-string node-unpipe node-uri-js node-url-parse-lax node-url-to-options node-util-deprecate node-uuid node-validate-npm-package-license node-validate-npm-package-name node-verror node-wcwidth.js node-which node-which-module node-wide-align node-widest-line node-wrap-ansi node-wrappy node-write-file-atomic node-xdg-basedir node-xtend node-y18n node-yallist node-yargs node-yargs-parser python3-icu python3-pam rdate thin-provisioning-tools Use 'sudo apt autoremove' to remove them. 0 to upgrade, 0 to newly install, 0 to remove and 135 not to upgrade. (base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg File '/usr/share/keyrings/docker-archive-keyring.gpg' exists. Overwrite? (y/N) y (base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null (base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ sudo apt-get update Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease Hit:2 http://mirrors.aliyun.com/ubuntu focal-security InRelease Hit:3 http://mirrors.aliyun.com/ubuntu focal-updates InRelease Ign:4 https://download.docker.com/linux/ubuntu focal InRelease Hit:5 http://mirrors.aliyun.com/ubuntu focal-proposed InRelease Hit:6 http://mirrors.aliyun.com/ubuntu focal-backports InRelease Err:7 https://download.docker.com/linux/ubuntu focal Release Could not handshake: Error in the pull function. [IP: 3.168.86.51 443] Ign:8 http://mirrors.aliyun.com/ubuntu trusty InRelease Hit:9 http://mirrors.aliyun.com/ubuntu trusty Release Hit:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease Hit:13 https://deb.nodesource.com/node_18.x nodistro InRelease Ign:10 https://www.scootersoftware.com bcompare4 InRelease Get:14 https://www.scootersoftware.com bcompare4 Release [1,717 B] Get:15 https://www.scootersoftware.com bcompare4 Release.gpg [836 B] Err:15 https://www.scootersoftware.com bcompare4 Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC34ED227AFAE3F2 Reading package lists... Done E: The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://www.scootersoftware.com bcompare4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC34ED227AFAE3F2 (base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ sudo apt-get install docker-compose-plugin Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package docker-compose-plugin (base) powersys@sam:~/work/diffusion/stable-diffusion-webui/stable-diffusion-webui-docker$ docker compose version docker: 'compose' is not a docker command. See 'docker --help'
现在的关键问题是:你的系统 无法连接 Docker 官方仓库,导致 docker-compose-plugin 无法被安装。主要是因为这个错误:
Could not handshake: Error in the pull function. [IP: 3.168.86.51 443]
这通常是由于:
-
网络问题(GFW/防火墙/代理)
-
Docker 源被墙或不通
✅ 快速解决办法(推荐):直接下载官方 docker-compose 二进制文件
这样你不依赖 apt 和 Docker 仓库,绕过网络问题。按以下步骤操作:
1. 下载 docker-compose 二进制
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2. 添加执行权限
sudo chmod +x /usr/local/bin/docker-compose
3. 验证安装
docker-compose version
这将让你使用传统的 docker-compose 命令,功能和 docker compose 插件一样。
❓可选后续:修复 Docker 官方源连接问题
如果你希望恢复通过 APT 安装 Docker 组件,可以尝试:
1. 用国内镜像加速器(如清华或阿里)
将 Docker 源替换成清华源:
echo "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
然后再尝试安装:
sudo apt-get install docker-compose-plugin
需要我帮你一键修复源或继续用二进制方式,都可以。你可以先试下载 docker-compose 二进制,那是最快的路径。是否继续?
更多推荐
所有评论(0)