docker中容器(Debian)安装软件
环境:Debian[*] 修改yum源
[*] 在宿主机上创建sources.list文件
$ vi /etc/apt/sources.list替换成deb http://mirrors.aliyun.com/debian wheezy main contrib non-freedeb-src http://mirrors.aliyun.com/debian wheezy main contrib non-freedeb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-freedeb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-freedeb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-freedeb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
[*] 拷贝到容器中
docker cp sources.list 容器名:/etc/apt/sources.list
[*] 进入容器,更新源
apt-get update
apt-get clean &&apt-get autoclean 清理无用的包(可选)
[*] 安装ip工具
apt-get install iproute
[*] 删除软件包
apt-get remove package - - purge 删除包,包括删除配置文件等
7.APT其他常用命令
apt-cache search package 搜索包
apt-cache show package 获取包的相关信息,如说明、大小、版本等
详细参考https://blog.csdn.net/pzw_0612/article/details/52658913
页:
[1]