Eypros
Eypros

Reputation: 5723

Uninstall docker version installed via script

I have some trouble uninstalling docker. I have used the instructions from here to add a newer docker version which has GPU support (version >19.03). I have managed to install docker but I know need to uninstall it to get a newer version (I need to use 19.03.12 while now I am using 19.03.8).
The actual installation include these steps:

curl -fsSL https://test.docker.com -o test-docker.sh
sh test-docker.sh

The problem is that apt-get does not seem to find docker installed:

sudo apt-get install --only-upgrade docker

Reading package lists... Done
Building dependency tree
Reading state information... Done Skipping docker, it is not
installed and only upgrades are requested. 0 upgraded, 0 newly installed, 0 to remove and 356 not upgraded.

Is there a way to uninstall the docker version I am having on my system?

I am using Ubuntu 16.04.

Edit:

in this script there is a warning that is propagated if docker command is found on the system and if so that there might be problem if continuing with the installation. I didn't catch it and did not stop the installation. I don't know if this is helpful but I am pointing it out.

Edit2:

The output of

dpkg -l|grep docker

rc  docker                                                      1.5-1                                                       amd64        System tray for KDE3/GNOME2 docklet applications
ii  docker-ce                                                   5:19.03.12~3-0~ubuntu-xenial                                amd64        Docker: the open-source application container engine
ii  docker-ce-cli                                               5:19.03.8~3-0~ubuntu-xenial                                 amd64        Docker CLI: the open-source application container engine

Upvotes: 0

Views: 3101

Answers (1)

Ron
Ron

Reputation: 6611

The script at https://test.docker.com adds a repo to /etc/apt/sources.list.d/docker.list or /etc/apt/sources.list that will look something like this:

deb http://ftp.debian.org/debian $debian_version-backports main

and then it uses apt to install dependencies, and then install the package docker-ce

So you can remove docker-ce with:

apt-get remove docker-ce
#or
dpkg -P docker-ce

if you use the dpkg to remove the package, afterwards please run apt-get install -f to ensure no broken packages exist.

Once you remove the unneeded package version, you can as well remove the line from the repo mentioned above, and install the generic docker version, or add any other repo, to obtain another version of docker, or install it manually..

Upvotes: 1

Related Questions