You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将通过apt安装的docker-compose升级至最新或1.9.0+版本?

Hey there! Let's walk through upgrading your Docker Compose from v1.8.0 to at least v1.9.0 (or the latest stable version) properly. Since you installed the old version via apt, we'll start by removing that package cleanly, then install the official up-to-date build as Docker recommends.

Upgrade Docker Compose Step-by-Step

1. Uninstall the Old APT Version

First, we need to remove the v1.8.0 package you installed via apt—this ensures no conflicts with the new version:

# Remove the core package
sudo apt-get remove docker-compose
# Optional but recommended: Purge residual configuration files
sudo apt-get purge docker-compose
# Clean up unused dependencies
sudo apt-get autoremove

2. Install the Latest Official Version

Docker's official method uses curl to pull the pre-built binary tailored to your system. This command automatically detects your OS and architecture to grab the correct build:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Pro tip: If you specifically want v1.9.0 instead of the latest stable release, replace latest in the URL with v1.9.0.

3. Set Executable Permissions

The downloaded binary won't be runnable until we grant it execute permissions:

sudo chmod +x /usr/local/bin/docker-compose

4. Verify the Upgrade

Check the installed version to confirm everything worked as expected:

docker-compose --version

You should see a version number that's at least v1.9.0 (or the latest stable release).

Optional: Fix "Command Not Found" Errors

If your system can't locate docker-compose after installation, create a symlink to add it to your system's default PATH:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

内容的提问来源于stack exchange,提问作者Sam_2207

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:52:17