Fix "Unable to locate package docker-compose-plugin" on Ubuntu
Install Docker Compose on Ubuntu
When trying to install Docker Compose with the command:
1 | sudo apt install docker-compose-plugin |
you might encounter the following error:1
2
3
4Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package docker-compose-plugin
This happens because the default Ubuntu repositories don’t include the latest Docker packages. To fix it, you need to enable the official Docker repository first.
Solution
- Remove old Docker Compose (if installed)
1
sudo apt remove docker-compose
- Add Docker’s official repository
1
2
3
4
5
6
7
8
9
10
11sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - Install Docker Compose Plugin
1
2sudo apt-get update
sudo apt-get install docker-compose-plugin
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.





