Error response from daemon: conflict: unable to delete xxx (must be forced) – image is referenced in one or more repositories

Problem

Trying to remove some unused docker images that you no longer use with docker rmi image_id you get the following error message:

Error response from daemon: conflict: unable to delete 75d009de0479 (must be forced) - image is referenced in one or more repositories

Solution

Use the following to delete multiple images (ie ubuntu):

docker images ubuntu | tail -n +2 | awk '{ print $1 ":" $2 }' | xargs sudo docker rmi

Mentioned here