如何解决apt依赖错误[已关闭]

问题描述 投票:0回答:1

我想在 Ubuntu 22.04 中使用命令安装

pip

sudo apt install python3-pip

但我收到此错误:

The following packages have unmet dependencies:
 python3-distutils : Depends: python3-lib2to3 (= 3.10.4-0ubuntu1) but 3.10.8-1~22.04 is to be installed
 python3-setuptools : Depends: python3-pkg-resources (= 59.6.0-1.2) but 59.6.0-1.2ubuntu0.22.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

问题是什么,如何解决?

linux ubuntu dependency-management apt
1个回答
0
投票

我解决了这个问题。问题是 apt 存储库列表中的某些条目已停用。所以我做了以下修复它:

  1. 转到文件
    /etc/apt/sources.list
  2. 取消注释以
    security
    开头的
    deb
    条目,并注释以
    deb-src
  3. 开头的条目
  4. sudo apt update
  5. sudo apt install python3-pip

然后 apt 就可以成功解决包版本问题了。

© www.soinside.com 2019 - 2024. All rights reserved.