Docker/Linux 如何安装yum vim

Posted by luoruiqing on June 23, 2020
1
2
apt-get update # 更新源
apt-get install -y vim yum  # 安装 vim, yum

如果速度太慢, 可以更换源地址:

1
2
cp /etc/apt/sources.list /etc/apt/sources.list.bak # 备份默认源地址
vim /etc/apt/sources.list # 编辑源, 自行百度apt-get源并写入保存

若无vim编辑器, 使用echo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#deb包
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >> "/etc/apt/sources.list"
##测试版源  
echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse" >> "/etc/apt/sources.list"
# 源码  
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse" >> "/etc/apt/sources.list"
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >> "/etc/apt/sources.list"
##测试版源  
echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse" >> "/etc/apt/sources.list"
# Canonical 合作伙伴和附加  
echo "deb http://archive.canonical.com/ubuntu/ xenial partner" >> "/etc/apt/sources.list"
echo "deb http://extras.ubuntu.com/ubuntu/ xenial main" >> "/etc/apt/sources.list"