我最近安装了 Ubuntu,但我对它还不熟悉。现在我想用 Visual Code 编程,但问题是我无法下载它。我试过了sudo apt install ./<file>.deb
(当然是用我的文件路径),但只收到此错误:
The following packages have unmet dependencies:
code:amd64 : Depends: libnss3:amd64 (>= 2:3.26) but it is not installable
Depends: apt:amd64 but it is not installable
Depends: libxkbfile1:amd64 but it is not installable
Depends: libsecret-1-0:amd64 but it is not installable
Depends: libgtk-3-0:amd64 (>= 3.10.0) but it is not installable
Depends: libxss1:amd64 but it is not installable
Depends: libgbm1:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.
我在安装任何东西时也遇到了很多问题,包括更改键盘布局。
我在使用 M1 MacBook 和 Parallels Desktop。
sudo apt update 的输出:
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Hit:5 https://packages.microsoft.com/repos/vscode stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
sudo apt -f install 的输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg --get-selections | grep hold 没有输出
我感谢任何帮助。
答案1
M1 是 ARM,所以您不能在这里安装 amd64 包。
但你可以尝试从https://github.com/VSCodium/vscodium/releases使用以下命令之一(取决于 CPU 架构):
cd ~/Downloads
# 32-bit
wget -c https://github.com/VSCodium/vscodium/releases/download/1.63.2/codium_1.63.2-1639700511_armhf.deb
sudo apt-get install ./codium_1.63.2-1639700511_armhf.deb
# 64-bit
wget -c https://github.com/VSCodium/vscodium/releases/download/1.63.2/codium_1.63.2-1639700587_arm64.deb
sudo apt-get install ./codium_1.63.2-1639700587_arm64.deb