当前位置: 首页 > news >正文

ubuntu : 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

往后看,90%能解决你的问题

原文链接:学一下 (suxueit.com)

我相信很多人刚使用ubuntu都遇到过这个问题,如果没有遇到,可能是你运气好使用了正确的软件源

 libprotobuf-dev : 依赖: zlib1g-dev 但是它将不会被安装
zlib1g-dev : 依赖: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) 但是 1:1.2.8.dfsg-2ubuntu4.1 已安装。
# 等待一些列的报错问题

思考问题

你肯定看到过

  • 使用aptitude解决的方法: 为什么要用aptitude呢,难道ubuntu默认的apt是垃圾,解决不了这个问题了?

    Sudo aptitude install 需要安装的软件名
  • 也肯定看到过让你换一个阿里源的解决办法: 为啥要换源呢,不换就不行了?

    deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    

解决问题

ubuntu自带的apt肯定是能解决的

apt安装的时候会去配置的软件源找包,并查看相关依赖

所以只要源配置正确了,基本就不会出现这种依赖错误的问题

什么样的源是正确的呢,网上只有让换阿里源,或者其他源的,且没有告诉你源应该保持和自己系统的版本一致【或者说CodeName一致】

查看CodeName

lsb_release -c

找到对应codeName的源【例如我的是 jammy】

deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

详细的CodeName源

ubuntu镜像_ubuntu下载地址_ubuntu安装教程-阿里巴巴开源镜像站 (aliyun.com)

http://www.lryc.cn/news/323849.html

相关文章:

  • 瑞芯微RK3576|触觉智能:开启科技新篇章
  • Visual Studio 2013 - 清理
  • 1、初识JVM
  • JavaScript 权威指南第七版(GPT 重译)(七)
  • 从零开始搭建游戏服务器 第四节 MongoDB引入并实现注册登录
  • 【Unity】宏定义Scripting Define Symbols
  • 算法 之 排序算法
  • Prism:打造WPF项目的MVVM之选,简化开发流程、提高可维护性
  • Springboot+vue的四川美食分享网站+数据库+报告+免费远程调试
  • 温湿度项目V1.0——原理图设计
  • H5 与 App、网页之间的通信
  • 亚马逊云科技:企业如何开启生成式AI之旅?
  • AMPQ和rabbitMQ
  • 在存在代理的主机上,为docker容器配置代理
  • 备考ICA----Istio实验4---使用 Istio 进行金丝雀部署
  • LeetCode-热题100:39.组合总和
  • 演讲嘉宾公布 | 智能家居与会议系统专题论坛将于3月28日举办
  • Unity发布webgl之后打开PDF文件,不使用js,不和浏览器交互
  • Python之装饰器-无参装饰器
  • 音视频实战--音视频编码
  • 【黄金手指】windows操作系统环境下使用jar命令行解压和打包Springboot项目jar包
  • React【Day1】
  • MNN 执行推理(九)
  • 算法公式汇总
  • c语言管理课程信息系统
  • 大模型在天体物理学研究中的辅助作用与案例分析
  • 洛谷_P1873 [COCI 2011/2012 #5] EKO / 砍树_python写法
  • Android_NDK调试
  • 全量知识系统 概要设计(SmartChat回复)
  • 一、SpringBoot基础搭建