Ubuntu安装yum遇到Package ‘yum‘ has no installation candidate

环境说明

Window11,WSL2,Ubuntu24.04

错误描述

root@LAPTOP:~# apt-get install yum
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package yum is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

问题原因

默认软件源找不到安装包,需要更新软件源地址

解决步骤

1.获取新的仓库 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/,选择Ubuntu 24.04,DEB822格式

在这里插入图片描述

2.备份软件源配置文件

cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.old

3.更新软件源配置文件

注意:
a.由于软件源会更新,以下内容不具备时效性,仅供参考
b.除了清华提供的源,还额外增加了一个源,参考 链接

rm /etc/apt/sources.list.d/ubuntu.sources
vim /etc/apt/sources.list.d/ubuntu.sources

配置文件内容:

# 额外增加的源
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: trusty
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

4.更新软件源

sudo apt-get update

在这里插入图片描述

5.安装yum

sudo apt-get install yum

在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

火车站卖橘子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值