linux ubuntu安装yum

该博客指导读者如何在Ubuntu系统中配置清华源,以加速软件更新和安装。首先,通过备份和编辑sources.list文件来替换默认镜像源,确保使用的是适用于Ubuntu的清华源。然后,更新软件源并安装yum。最后,验证yum的版本,确保安装成功。
摘要由CSDN通过智能技术生成

1、安装前首先要配置【正确】镜像源

打开终端执行命令:

备份镜像源文件:sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

编辑镜像源文件:sudo vim /etc/apt/sources.list

里面内容全部删除。

打开清华源选择正确的linux系统和版本:

注意:不要用其他的镜像源,否则你得到的永远是【E: 无法定位软件包 yum】错误。

ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirrorubuntu 使用帮助 | 镜像站使用帮助 | 清华大学开源软件镜像站,致力于为国内和校内用户提供高质量的开源软件镜像、Linux 镜像源服务,帮助用户更方便地获取开源软件。本镜像站由清华大学 TUNA 协会负责运行维护。https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

把清华源里面的内容全部复制到 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值