docker rm `docker ps -a -q`
docker rmi `docker images -q`
没有打标签
docker rmi `docker images -q | awk ‘/^<none>/ { print $3 }‘`
镜像名包含关键字
docker rmi --force `docker images | grep doss-api | awk ‘{print $3}‘` //其中doss-api为关键字
#!/bin/bash
mv /etc/apt/sources.list /etc/apt/sources.list.bak
Codename=$( (lsb_release -a)|awk ‘{print $2}‘|tail -n 1 )
echo "\
#deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse ">/etc/apt/sources.list
apt-get update
~
~
~
原文:https://www.cnblogs.com/xiaoxuebiye/p/11370427.html