尝试安装 cmake 时出错

尝试安装 cmake 时出错

尝试安装 cmake 时收到此错误消息。

Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following additional packages will be installed:
  cmake-data libjsoncpp1 librhash0 libuv1
Suggested packages:
  cmake-doc ninja-build
The following NEW packages will be installed:
  cmake cmake-data libjsoncpp1 librhash0 libuv1
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,332 kB/4,497 kB of archives.
After this operation, 23.7 MB of additional disk space will be used.
Err:1 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 cmake-data all 3.10.2-1ubuntu2.18.04.1
  Could not resolve 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/cmake/cmake-data_3.10.2-1ubuntu2.18.04.1_all.deb  Could not resolve 'ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我在这里看到了有关此问题的答案,但遇到了困难并且无法理解。

打开/etc/apt/sources.list文件。

检查 sources.list 文件中 http://security.ubuntu.com/ubuntu/ 后面的单词,让该单词为 xyz

转到地址 http://security.ubuntu.com/ubuntu/ 然后单击 dists。

现在检查 xyz 是否存在于此路径中。如果不存在,则将 xyz 替换为“dists”中存在的元素,例如:saucy、lucid、trusty 等。

现在运行sudo apt-get update命令。

相关内容