You probably missed a step in the documentation which adds the required package repository to the system.
Here is the step by step commands I have executed as per the official documentation from docker. In this i have added that repository also but Im getting same issue
Im using AWS EC2 instance - Ubuntu22.04
@rimelek is right, you missed a step:
sudo apt-get update
Seems to be the first thing they’re doing
This does seem like a line break, from them copy-pasting.
There’s no
\
, so what’d cause it to concatinate both lines into one command?
Where is your picture from? I can’t find it on the screenshot they uploaded
Another thing I find weird is how nothing was logged to console from all those lines OP copy-pasted and ran at once
The > /dev/null
at the end should only affect that very last commadn, no?
The line you shared in your screenshot is before the docker repo is added.
The screenshot is taken from the middle of the second block.
Indeed, potential none of those commands are executed. It should have output and at least an error message caused by the command I had in my screenshot snippet.
Only the line that adds the docker repos to /etc/apt/source.list.d/docker.list
@barath08 please do not share screenshots of texts, as they make it unnecessary hard to read the text, and make it impossible to quote content.
A-ha! Now I get it, sorry
The Highlighted line was the Issue, So from copy pasting the command from the official documentation of docker https://docs.docker.com/engine/install/ubuntu/ , it’s getting line break and commands are not executing properly, we need to arrange commands in one line, This issue need to be fixed in the official docker documenation https://docs.docker.com/engine/install/ubuntu/