orin nx重装系统之后,安装vscode(自用)(E: Unable to correct problems, you have held broken packages.)

百度直接输入vscode,进行搜索,点击进入vscode的下载页面,选择deb格式进行下载,

然后cd到download文件夹找到下载的安装包。

sudo apt install vscode安装包

提示错误:

The following packages have unmet dependencies:
 code:amd64 : Depends: libasound2:amd64 (>= 1.0.17) but it is not installable
              Depends: libatk-bridge2.0-0:amd64 (>= 2.5.3) but it is not installable
              Depends: libatk1.0-0:amd64 (>= 2.2.0) but it is not installable
              Depends: libatspi2.0-0:amd64 (>= 2.9.90) but it is not installable
              Depends: libc6:amd64 (>= 2.14) but it is not installable
              Depends: libc6:amd64 (>= 2.16) but it is not installable
              Depends: libc6:amd64 (>= 2.17) but it is not installable
              Depends: libc6:amd64 (>= 2.2.5) but it is not installable
              Depends: libcairo2:amd64 (>= 1.6.0) but it is not installable
              Depends: libcurl3-gnutls:amd64 but it is not installable or
                       libcurl3-nss:amd64 but it is not installable or
                       libcurl4:amd64 but it is not installable or
                       libcurl3:amd64 but it is not installable
              Depends: libdbus-1-3:amd64 (>= 1.5.12) but it is not installable
              Depends: libdrm2:amd64 (>= 2.4.75) but it is not installable
              Depends: libexpat1:amd64 (>= 2.0.1) but it is not installable
              Depends: libgbm1:amd64 (>= 17.1.0~rc2) but it is not installable
              Depends: libglib2.0-0:amd64 (>= 2.16.0) but it is not installable
              Depends: libglib2.0-0:amd64 (>= 2.37.3) but it is not installable
              Depends: libgssapi-krb5-2:amd64 but it is not installable
              Depends: libgtk-3-0:amd64 (>= 3.9.10) but it is not installable
              Depends: libgtk-3-0:amd64 (>= 3.9.10) but it is not installable or
                       libgtk-4-1:amd64 but it is not installable
              Depends: libkrb5-3:amd64 but it is not installable
              Depends: libnspr4:amd64 (>= 2:4.9-2~) but it is not installable
              Depends: libnss3:amd64 (>= 2:3.30) but it is not installable
              Depends: libnss3:amd64 (>= 3.26) but it is not installable
              Depends: libpango-1.0-0:amd64 (>= 1.14.0) but it is not installable
              Depends: libsecret-1-0:amd64 (>= 0.18) but it is not installable
              Depends: libx11-6:amd64 but it is not installable
              Depends: libx11-6:amd64 (>= 2:1.4.99.1) but it is not installable
              Depends: libxcb1:amd64 (>= 1.9.2) but it is not installable
              Depends: libxcomposite1:amd64 (>= 1:0.4.4-1) but it is not installable
              Depends: libxdamage1:amd64 (>= 1:1.1) but it is not installable
              Depends: libxext6:amd64 but it is not installable
              Depends: libxfixes3:amd64 but it is not installable
              Depends: libxkbcommon0:amd64 (>= 0.4.1) but it is not installable
              Depends: libxkbfile1:amd64 but it is not installable
              Depends: libxrandr2:amd64 but it is not installable
              Recommends: libvulkan1:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.

网上搜了一下,说是源的问题,我就

sudo gedit /etc/apt/sources.list

将内容更换为链接中的内容了。

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse

然后回到download,继续安装vscode,仍旧提示上述错误 。。。。。

最后发现是下载的安装包版本太新了。。。。

换了个旧的安装包,成功安装了。

以后避坑吧。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值