- 1.背景
- 2.换源
在docker进去tomcat容器中,想要安装vim,于是使用以下shell,但是报错,于是换源。
apt-get update && apt-get install vim
#进入tomcat容器 docker exec -it mytomcat01 bash #记录源的文件为sources.list cd /etc/apt #备份原来的源文件 cp /etc/apt/sources.list /etc/apt/sources.list_backup #command gedit not found gedit /etc/apt/sources.list ##更换阿里源 echo "" > /etc/apt/sources.list echo -e "deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiversen deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiversen deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiversen deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiversen deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiversen deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiversen deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiversen deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiversen deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" > /etc/apt/sources.list ##更换清华源 echo "" > /etc/apt/sources.list echo -e "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiversen deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiversen deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiversen deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversen deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiversen deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiversen deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" > /etc/apt/sources.list
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)