1、安装前首先要配置【正确】镜像源
打开终端执行命令:
备份镜像源文件:sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
编辑镜像源文件:sudo vim /etc/apt/sources.list
里面内容全部删除。
打开清华源选择正确的linux系统和版本:
注意:不要用其他的镜像源,否则你得到的永远是【E: 无法定位软件包 yum】错误。
把清华源里面的内容全部复制到 sources.list,额外在头部添加一行:
deb http:
//archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
如Ubuntu:
#另外添加的一行
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
保存退出
2、更新软件源
执行终端命令:sudo apt-
get
update
3、
安装yum
命令:sudo apt-
get
install yum
4、检测版本
命令:yum --version