Docker容器里无法使用Xxx命令

Linux系统 apt-get 命令的使用:安装、更新、卸载软件包:https://blog.csdn.net/xietansheng/article/details/80044644


1 更新apt-get

1.1 查看所用的源

vim /etc/apt/sources.list

# deb http://snapshot.debian.org/archive/debian/20191224T000000Z stretch main
deb http://deb.debian.org/debian stretch main
# deb http://snapshot.debian.org/archive/debian-security/20191224T000000Z stretch/updates main
deb http://security.debian.org/debian-security stretch/updates main
# deb http://snapshot.debian.org/archive/debian/20191224T000000Z stretch-updates main
deb http://deb.debian.org/debian stretch-updates main

1.2 备份原来的源

mv /etc/apt/sources.list /etc/apt/sources.list.bak

1.3 修改为国内源

echo "" > /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >> /etc/apt/sources.list

> 输出重定向

>> 输出追加重定向

deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib

1.4 更新apt软件源

apt-get update

2 下载对应的Xxx即可

apt-get install vim
apt-get install tree
apt-get install yum

 


 https://blog.csdn.net/huangbaokang/article/details/98029026

发布了508 篇原创文章 · 获赞 84 · 访问量 108万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 撸撸猫 设计师: 设计师小姐姐

分享到微信朋友圈

×

扫一扫,手机浏览