Skip to content

Podman

目录权限检查

sh
podman exec <container_name> ls -n /opt/emqx/

停止并删除所有容器

sh
# 停止所有正在运行的容器
podman stop $(podman ps -q)

# 删除所有容器(包括已停止的)
podman rm -a -f

# 删除所有本地镜像
podman rmi -a -f

# 删除所有不使用的卷
podman volume prune -f

# 删除所有不使用的网络
podman network prune -f

终极一键清理(慎用)

把 Podman 的缓存、镜像、容器、卷全部一次性清空(回到最初安装时的状态):

sh
podman system prune -a --volumes -f

检查清理结果

sh
# 容器列表
podman ps -a

# 镜像列表
podman images

# 卷列表
podman volume ls