How to Solve Error Message unable to delete when removing an image using podman in Linux CentOS 8

Posted on

Introduction

This article will show how to solve the error. It is an error exist upon removing an image using podman tool. The removal process exist in a virtual server. The virtual server is using Linux CentOS 8 as the operating system. Furthermore, the following is the sequnces of the processes for listing images and removing one of the image.

[podman@10 netns]$ podman images
REPOSITORY                     TAG     IMAGE ID      CREATED        SIZE
docker.io/library/registry     2       ee34aa9d8ab2  2 weeks ago    26.8 MB
docker.io/library/hello-world  latest  d1165f221234  6 weeks ago    22.1 kB
localhost:5000/hello-world     latest  d1165f221234  6 weeks ago    22.1 kB
quay.io/centos/centos          latest  300e315adb2f  4 months ago   217 MB
k8s.gcr.io/pause               3.2     80d28bedfe5d  14 months ago  688 kB
[podman@10 netns]$ podman rmi d1165f221234
Error: 1 error occurred:
        * unable to delete d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726 (must force) - image is referred to in multiple tags: image is being used
[podman@10 netns]$

So, the error message exist as follows :

* unable to delete xxxxx (must force) - image is referred to in multiple tags: image is being used.

Basically, the image with the same id exist twice. It is in the remote and local repository of images. The solution for solving the problem exist in the introduction part is simple. Just execute the following command pattern :

podman rmi --force image_id

The command pattern above’s execution is exist in the following :

[podman@10 netns]$ podman rmi --force d1165f221234
Untagged: docker.io/library/hello-world:latest
Untagged: localhost:5000/hello-world:latest
Deleted: d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726
[podman@10 netns]$

In order to prove that the images are not exist anymore, just execute the above command for listing the images as follows :

[podman@10 netns]$ podman images
REPOSITORY                  TAG     IMAGE ID      CREATED        SIZE
docker.io/library/registry  2       ee34aa9d8ab2  2 weeks ago    26.8 MB
quay.io/centos/centos       latest  300e315adb2f  4 months ago   217 MB
k8s.gcr.io/pause            3.2     80d28bedfe5d  14 months ago  688 kB
[podman@10 netns]$

According to the above command output, all of the images with the label id of ‘d1165f221234’ will not exist anymore. So, the command execution for removing the images is a success.

Leave a Reply