sudo error when installing docker engine on ubuntu 22.04 [migrated] - docker

This question was migrated from Stack Overflow because it can be answered on Ask Ubuntu.
Migrated 9 days ago.
I followed the steps in docker desktop installation guide before and then when I was following the instructions on Install Docker Engine on Ubuntu, I tried the first one:
sudo apt-get remove docker docker-engine docker.io containerd runc
it gave me these errors:
E: Malformed entry 1 in list file /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list (Component)
E: The list of sources could not be read.
Additionally, I cannot use no other sudo commands either.
For example: sudo apt upgrade gives the same errors too.
I'm very new to Linux and I do not understand what this mean or how I may fix it.

Related

docker-compose running any command gives error

I searched the internet no good answer was found anywhere. When I run docker-compose up, down, or any command I am having this error.
cannot update snap namespace: cannot create symlink in "/etc/docker": existing file in the way
snap-update-ns failed with code 1
It was working fine, suddenly having this issue.
My OS is Ubuntu 20.04 docker version 20.10.8
Any kind of help is appreciated.
If you have not install the docker, you may run:
sudo snap install docker # version 20.10.8, or
Otherwise:
sudo apt install docker-compose # version 1.25.0-1
Hoping that this will help you!

Docker - Bash: IP: command not found

I'm currently trying to set up a hyperledger fabric network using docker toolbox, based on the guide HERE
When it comes to "Starting up validating peers" step, I followed and entered ip add into the terminal, but it returns bash: ip: command not found. Any solution? I've tried ifconfig as well and it's the same issue, command not found.
Using Docker Toolbox on Windows 10 Home
Install ip command package for Ubuntu.
apt update
apt install iproute2
I have tried hostname -I. Working fine for me.No need to install a new package.
Unfortunately, your link has been broken (or it might be inaccessible from Iran). Although there is not enough evidence of which Linux OS you are trying to use, a solution is provided as follow work under .deb (e.g. Ubuntu) and .rpm (e.g. Fedora) package managers.
At first, update the container's repository:
Ubuntu:
apt-get update
CentOS:
yum update
Fedora:
dnf update
Secondly, install net-tools package.
Ubuntu:
apt-get install net-tools
CentOS:
yum install net-tools
Fedora:
dnf install net-tools
Lately, ifconfig has been replaced with ip command. So make sure to check both commands, some Linux distributions have not changed the command yet.
for command ip not found in centos 7, you can use yum install iproute -y to fix.
for command ifconfig not found in centos 7, you can use yum install net-tools -y to fix.
Although OP was on Windows 10. I landed on this question searching for a fix for macOS and didn't find this answer for a while. So I'm linking it here as well just in case
You can install ip tool on OS X via brew:
brew install iproute2mac
Your link doesn't work.
Do docker ps or docker images in GitBash to see if the docker containers and images are running.
I recommend installing Docker Community Edition if you are running Win 10. Make sure u have Hyper-V enabled.

Docker-engine confilcts with docker.io

OS: Ubuntu 16.04
Docker version: 1.11.2
I have already installed docker 1.11.2 on my Ubuntu and I want to upgrade it to 1.12. All the steps are as follows:
I download the deb pkg named docker-engine_1.12.3-0~xenial_amd64.
Execute command: dpkg -i docker-engine_1.12.3-0~xenial_amd64 but notes with errors:
docker-engine conficts with docker.io.docker.io (version 1.11.2-0ubuntu5~16.04) has already been installed .
So I have to remove docker first by using commands as below:
service docker stop
apt-get remove docker
apt-get remove --auto-remove docker
rm -rf /var/lib/docker
Go to step 2, but with the same errors.
So, I hope someone would help me solve this problem.
The conflicting packages (which fight over the same binary) are docker.io (from the distribution) and docker-engine (from Docker itself).
Your command above does apt-get remove ... docker. Which achieve nothing for the aforementioned problem.
I have different machines running 16.04 and some use docker.io (easier, no extra repo) whereas others use docker-engine. I am indifferent. Pick on, docker should work just fine.
Firstly restart the ubuntu server with linux command(sudo shutdown -r now), and run the command : apt-get -f install(this command is suggested by the error information), then I install the docker-engine by the following site(https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04).

What would keep docker engine from upgrading to 1.11 on Ubuntu 14.04?

I am managing around 20 Ubuntu 14.04 VMs running docker engine. These VMs have been around for several months and have been through a number of upgrades. Of the 20, all are running docker 1.11 except for 2, which refuse to upgrade from docker 1.10.3 for some reason. I've tried a number of things. Last night I went through these steps, which I really thought would do the trick:
sudo service docker stop
sudo rm -rf /var/lib/docker
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-image-extra-$(uname -r)
sudo reboot
Unfortunately when the VMs came back up they were still running docker 1.10.3.
I started with the docker engine log (/var/log/upstart/docker.log) but there is no indication of a problem related to the upgrade.
I looked in the apt logs (/var/log/apt/term.log) for the 2 VMs that won't update, but there aren't any errors or messages indicating anything is wrong.
I also compared the repos (/etc/apt/sources.list) for a VM that did upgrade docker to 1.11 and one that didn't, and the sources are identical, which I would expect since I spun both VMs up with the same command line.
What could be preventing these VMs from upgrading to docker 1.11?
Where should I look to find the cause?

yum install error docker

CentOS version: lsb_release -d
Description: CentOS release 6.5 (Final)
My repo looks like this
cat /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
I have some old version of docker and when I try to install it, I get an error. When I try the skip option, even after that the docker service does not even exist on my centos yum install docker-engine has the following problem
Processing Conflict: docker-engine-1.7.1-1.el6.x86_64 conflicts docker-io
--> Finished Dependency Resolution
Error: docker-engine conflicts with docker-io-0.6.2-1.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest"
Then service docker start does not exist when I try to start it.
How do I do clean of all docker stuff and do this from scratch?
Docker's official release no longer supports RHEL/Centos 6. I think that stopped with 1.7.1 and the official release is at 1.10. I would suggest updating to Centos 7 or anything with a 3.10+ kernel to use the latest docker-engine as it has improved quite a bit.
If you are stuck with Centos 6.5 then either continue with the the EPEL docker-io package or install the 1.7.1 rpm.
Completely remove the Centos 6 package
yum remove docker-io
Remove all docker data (and never get it back!)
rm -rf /var/lib/docker
Remove the Docker repo config
rm /etc/yum.repos.d/docker.repo
Either install docker-io again
yum install docker-io
Or install the docker-engine-1.7.1 rpm
yum install http://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm
Start it and docker
service docker start
docker run hello-world

Resources