1、在docker环境下,使用vi编辑文件,vi conmmond not found

apt-get update
apt-get install vim

 2、回到宿主机

进入/etc/docker 

在此目录下 使用 touch daemon.json命令创建daemon.json文件

touch daemon.json
{
    "dns": ["8.8.8.8", "114.114.114.114"]
}
// 重启docker
systemctl restart docker
// 启动docker容器
docker exec -it xxx bin/bash

3、执行apt-get update命令可能出错如下:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32

执行apt-key adv添加,再遇到同样添加即可

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32

4、docker容器内进入/etc/apt/目录

// 进入apt目录
cd /etc/apt/
// 备份 source.list
cp source.list source.list2
// 执行下面命令添加apt镜像源
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list

5、再次执行,一次不行就两次,

apt-get update
apt-get install vim

参考:Linux 异常:The following signatures couldn‘t be verified because the public key is not available_TineAine的博客-CSDN博客

修改mysql配置文件vim commend not found 和安装vim -Temporary failure resolving 'deb.debian.org和'docker联网问题解决_one-皮卡丘的博客-CSDN博客

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐