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 修改为国内源

mv /etc/apt/sources.list /etc/apt/sources.list.bak
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

Docker容器里无法使用Xxx命令Docker容器里无法使用Xxx命令 底层_码农 发布了507 篇原创文章 · 获赞 83 · 访问量 108万+ 他的留言板 关注
上一篇:Hexo User Case


下一篇:ROS安装过程错误笔记(持续更新)