ubuntu20 实操安装yum成功!

在linux系统中直接 apt-get intstall yum,会报错

weweaq@ubuntu:~$ sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease                    
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease             
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
weweaq@ubuntu:~$ sudo apt-get install yum
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package yum

直接安装没有用,看博客是需要换源
Ubuntu 安装使用yum-阿里云开发者社区 (aliyun.com)
清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

复制这个
ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

# 先安装一手vim
sudo apt-get install vim 

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

sudo vim /etc/apt/sources.list

(1)将文件里面的内容全部删除,将上面我们查找的镜像软件源粘贴进去!!切记:尽量的将格式也粘贴的和上面的一样,不会出错!!

(2)再将下面的命令(软件镜像源),也粘贴到上面文件的第一行

deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

![[Pasted image 20240817213252.png|800]]

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install yum

发现报错,说缺少这几个包
![[Pasted image 20240817215226.png]]

于是,安装所需依赖即可
sudo apt-get install python-sqlitecachec python-urlgrabber python-pycurl python2

最后再尝试一下

sudo apt-get install yum

![[Pasted image 20240817215519.png]]

安装成功,看看版本
![[Pasted image 20240817215537.png]]

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值