nacos使用docker部署mysql无法使用vi命令

下载nacos-docker后启动,发现无法在mysql的docker中使用vi和vim命令

首先查出mysql的容器id

docker ps | grep mysql

nacos使用docker部署mysql无法使用vi命令_第1张图片

进入容器

docker exec -it 172d92bfd808 /bin/bash

备份/etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.listbak

清空/etc/apt/sources.list后更新/etc/apt/sources.list

echo "" > /etc/apt/sources.list

echo "deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial universe" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties" >> /etc/apt/sources.list
echo "deb http://archive.canonical.com/ubuntu xenial partner" >> /etc/apt/sources.list
echo "deb-src http://archive.canonical.com/ubuntu xenial partner" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse" >> /etc/apt/sources.list

执行apt-get update ,完毕后执行apt-get install vi,如果不行就执行apt-get install vim,使用vim进行命令

 

你可能感兴趣的:(java,docker,ubuntu,mysql,nginx,linux)