Ubuntu安装软件报错E Unable to correct problems, you have held broken packages

Ubuntu安装软件报错E: Unable to correct problems, you have held broken packages

问题

sudo apt install时报错E: Unable to correct problems, you have held broken packages

原因

Ubuntu 版本跟apt源不匹配,使用最新的源即可,本文使用阿里源。

解决方法

查看版本信息

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal

换源

sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
:wq
$ sudo apt update
$ sudo apt-get upgrade

成功:此时再sudo apt install 软件名即可!!!

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu系统中遇到`E: Unable to correct problems, you have held broken packages`这个错误通常表示在尝试安装软件包时遇到了依赖项冲突或已经冻结(held)了一些包,导致无法自动解决依赖问题。这可能是由于以下几个原因: 1. 包件版本过旧或不兼容:系统中的某个包已被冻结,新安装的teamviewer可能与已存在的包存在版本冲突。 2. 缺少依赖:系统中缺少必要的库或依赖项,影响了teamviewer的安装。 3. 系统更新管理器问题:如果系统中有未处理的更新请求,可能会造成包持被状态。 为了解决这个问题,你可以采取以下步骤: 1. **查看并修复依赖**:运行 `sudo apt-get update && sudo apt-get upgrade` 来检查是否有可用的更新,并确保所有依赖都是最新的。 2. **强制安装**:尝试用 `sudo apt-get install -f teamviewer` 进行强制安装,但这可能会覆盖已有的、可能有用的包。 3. **解除包锁定**:如果你确定某些包不需要被锁定,可以用 `sudo apt-mark unhold package_name` 解除包的锁定状态,然后重新安装。 4. **手动安装**:有时候,直接从TeamViewer官网下载安装文件进行安装也可以避免依赖问题。 5. **清理缓存**:执行 `sudo apt-get clean` 和 `sudo rm -rf /var/lib/apt/lists/*` 清理本地缓存,但此操作需谨慎。 完成上述步骤后,请再次尝试安装teamviewer,看是否能够解决问题。如果问题依然存在,可能需要查找特定的解决方案,比如查阅TeamViewer官方文档或社区论坛。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值