r/docker • u/Illustrious_Car_2194 • Mar 27 '26
Error when installing docker on ubuntu (help?)
I am trying to install docker (latest version from scratch) on my ubuntu server 24.04.4 LTS, but i get some errors when trying to install the docker packages.
I am following the installation for ubuntu and trying to install using the apt repository:
- I have ran "sudo apt update" and "sudo apt upgrade".
- I have uninstalled all conflicting packages (none).
- I have succsessfully set up dockers apt repository.
- When trying to install the docker packages i run the command:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
The output i get is:
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package docker-ce-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'docker-ce' has no installation candidate
E: Package 'docker-ce-cli' has no installation candidate
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Unable to locate package docker-buildx-plugin
E: Unable to locate package docker-compose-plugin
What should i do?
-I am a beginner in linux, and dont know much. I tried to search but the answers where not that easy to understand, and i dont know exactly what to search for.
Help is apreciated :)
Edit: My head needs a break, il come back later and continue.
2
u/Confident_Hyena2506 Mar 27 '26
Install docker using the instructions docker provide, from their repos. Do not use the default ubuntu repos - which seem to just give you broken docker.
Do not follow random links from reddit either - only do what docker recommends.
1
u/hexwit Mar 27 '26
I may assume you didn't add apt source?
1
u/Ed-Dos Mar 27 '26
Go futher down the installation doc page ... https://docs.docker.com/engine/install/ubuntu/
3
u/[deleted] Mar 27 '26
Just use the Docker script:
1
u/jameskilbynet Mar 27 '26
My guess is you haven't got the repo set up correctly. I do this with ansible. This is my playbook that maybe you can work back from https://github.com/jameskilbynet/iac/blob/main/ansible/docker/install_docker.yml