自学内容网 自学内容网

Ubuntu24.04 yum安装

安装yum:

sudo apt-get install yum

执行报错 E: Package 'yum' has no installation candidate

解决:更换镜像源,找到自己的系统版本(如本系统为Ubuntu24.04)用vim进行更换,网址:

 ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirroricon-default.png?t=O83Ahttps://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

修改镜像源:

sudo vim /etc/apt/sources.list

第一行: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/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
 
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
 
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse

更新软件源和软件包:

sudo apt update
sudo apt-get upgrade

sudo apt update:从软件源(repositories)中检索最新的软件包列表信息,并不会更新已安装软件,只是确保apt下载的软件是最新的。

sudo apt-get upgrade:升级系统上所有可升级的软件包到最新版本。这个命令会检查所有已安装的软件包是否有可用的更新,并自动下载和安装这些更新。

注意:两个都要执行。

报错:W: GPG error: http://archive.ubuntu.com/ubuntu trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 

提示没有配置公钥,无法验证签名

配置公钥:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32

sudo apt-get update
sudo apt-get upgrade 

 安装:

sudo apt-get install yum

 

参考:Ubuntu22.04 解决 E: 无法定位软件包 yum_e: 无法定位软件包 libqt6opengl6-dev-CSDN博客


原文地址:https://blog.csdn.net/menglinjie/article/details/142524663

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!