5

【踩坑】通过 Apt 安装软件包时报错

 1 year ago
source link: https://loli.fj.cn/2023/06/27/%E9%80%9A%E8%BF%87Apt%E5%AE%89%E8%A3%85%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%97%B6%E6%8A%A5%E9%94%99/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

【踩坑】通过 Apt 安装软件包时报错

2023-06-27 2023-06-30

新安装的 Debain 系统通过 Apt 安装软件包时报错:The following packages have unmet dependencies

  • 通过 apt install curl 安装 curl 时报错
The following packages have unmet dependencies:
curl : Depends: libcurl4 (= 7.74.0-1.3+deb11u7) but 7.88.1-10 is to be installed
  • 新安装的系统默认使用的依赖版本比较新,但是有些软件包使用的依赖版本是旧版本,在安装这些软件包时,apt 发现需要安装的软件包的依赖已经存在,并且版本号不相同(如果是旧版本依赖,apt 可以自动更新,但是新版本依赖没办法降级),所以导致报错无法安装该软件包
  • 手动将版本过于新的依赖卸载,并重新安装,会自动安装较旧的版本

因为封装系统镜像时使用的依赖是最新的,而 apt 远程仓库中的依赖是次新的

libcurl4:根据报错中提到的过于新的依赖,确定需要卸载的软件包名

apt remove --purge libcurl4
apt install libcurl4
  • 这种方法不适用于依赖被系统程序引用的情况,容易造成移除中途失败,并且无法重新安装的情况

博客园 ——Mr.Higgerw


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK