Can't fully uninstall docker

Hello, I am trying to remove Docker and then re-install it because it seems that my first installation broke. I try to remove it, but I get these outputs when I do so:

alessio@fedora:~$ docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Common Commands:
  run         Create and run a new container from an image
  exec        Execute a command in a running container
  ps          List containers
  build       Build an image from a Dockerfile
  pull        Download an image from a registry
  push        Upload an image to a registry
  images      List images
  login       Log in to a registry
  logout      Log out from a registry
  search      Search Docker Hub for images
  version     Show the Docker version information
  info        Display system-wide information

Management Commands:
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.13.0)
  checkpoint  Manage checkpoints
  compose*    Docker Compose (Docker Inc., v2.24.7)
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  plugin      Manage plugins
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Swarm Commands:
  config      Manage Swarm configs
  node        Manage Swarm nodes
  secret      Manage Swarm secrets
  service     Manage Swarm services
  stack       Manage Swarm stacks
  swarm       Manage Swarm

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  import      Import the contents from a tarball to create a filesystem image
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  wait        Block until one or more containers stop, then print their exit codes

Global Options:
      --config string      Location of client config files (default "/home/alessio/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env
                           var and default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket to connect to
  -l, --log-level string   Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/alessio/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/alessio/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/alessio/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Run 'docker COMMAND --help' for more information on a command.

For more help on how to use Docker, head to https://docs.docker.com/go/guides/
alessio@fedora:~$  sudo dnf remove docker-desktop
[sudo] password for alessio: 
No match for argument: docker-desktop
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
alessio@fedora:~$ rm -r $HOME/.docker/desktop
rm: cannot remove '/home/alessio/.docker/desktop': No such file or directory
alessio@fedora:~$  sudo rm /usr/local/bin/com.docker.cli
rm: cannot remove '/usr/local/bin/com.docker.cli': No such file or directory
alessio@fedora:~$ 
::1                      localhost4               localhost6               localhost.localdomain
localhost                localhost4.localdomain4  localhost6.localdomain6  
alessio@fedora:~$ 

Can somebody help me figure this out?

I did do this twice some weeks ago to update Docker itself… can you copy paste the complete set of commands used by your side?

It seems whatever instructions you are following are wrong.

Try rpm -qa | grep docker to find all the docker package names then remove them with dnf.

I would like to point out that you may find podman, designed for fedora and redhat systems, is better on fedora then docker.
Podman is designed to replace docker.

4 Likes

Fedora (CentOS Stream and RHEL) removed the Docker container engine and the docker command some time ago.

If you still want to use Docker on Fedora, you can get it from various upstream projects, but it is not supported on Fedora. So if you don’t have an explicit need for Docker, try Podman as @barryascott suggested.

2 Likes

Thank you @barryascott ! I found packages still left. Also, yes, I am in need of docker and since it couldn’t work I thought it was just me who broke the files.

I will look into podman then :slight_smile:

There’s more than one way to install and uninstall Docker, see:

dnf whatprovides docker
rpm -q -f $(type -P docker)

But what actually important is the reason behind reinstalling it, because this action is normally pointless and likely unrelated to the original problem.

Makes sense. In facts, I am not sure what was the problem with docker, but podman works better now. Although I am having problems with configuring Google Cloud with it now.