類似提問:
Docker centos 沒有vim怎麼編輯文件?
Docker centos 沒有vi怎麼編輯文件?
Docker ubuntu 沒有vim怎麼編輯文件?
Docker ubuntu 沒有vi怎麼編輯文件?
下面的內容統統告訴你答案!!!!ubuntu
很簡單,由於有中國有互聯網長城,因此須要換源(你懂的)vim
沒有vim,就要安裝vim
怎麼安裝呢?
固然是執行下面語句centos
apt update apt install vim
從Docker下載的鏡像默認登陸用戶就是root,因此不須要加sudo,若是你不是這種狀況,那就加上sudo
可是很慢啊,由於默認是ubuntu官方的源,速度感人bash
這個速度很迷,有的網絡下能夠有好幾兆,那夠用,有的網絡下就只有幾十KB,你懂的
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
這是一個標準的阿里雲網絡
這是ubuntu18的,你要是其餘的版本或者發行版,就去找對應的軟件源,不想像個沙子同樣無腦複製
這麼多內容確定不行,累死人ionic
咱們只須要第一行阿里雲
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" > /etc/apt/sources.list
而後再執行rest
apt update apt install vim
而後你就裝上vim,裝好vim以後再去code
vim /etc/apt/sources.list
把完整的軟件源都補上it