admin管理员组

文章数量:1531220

ubuntu使用apt命令安装build-essential提示依赖不满足,错误如下:

root@606fc6c54658:/# apt install build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libatomic1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 libc6-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.6 is to be installed
             Depends: libtirpc-dev but it is not going to be installed
             Depends: libnsl-dev but it is not going to be installed
 libcc1-0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 libgomp1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 libitm1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 liblsan0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 libquadmath0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 libubsan1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.3.0-1ubuntu1~22.04 is to be installed
 perl : Depends: perl-base (= 5.34.0-3ubuntu1) but 5.34.0-3ubuntu1.3 is to be installed
        Recommends: netbase but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

试图更新源提示如下:

root@606fc6c54658:/# apt update
Get:1 http://mirrors.ustc.edu/ubuntu jammy InRelease [270 kB]
Get:2 http://mirrors.ustc.edu/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://mirrors.ustc.edu/ubuntu jammy-backports InRelease [109 kB]
Get:4 http://mirrors.ustc.edu/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:5 http://security.ubuntu/ubuntu jammy-security InRelease [110 kB]
Get:6 http://mirrors.ustc.edu/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:7 http://mirrors.ustc.edu/ubuntu jammy/main amd64 Packages [1792 kB]
Get:8 http://mirrors.ustc.edu/ubuntu jammy/multiverse amd64 Packages [266 kB]
Reading package lists... Done
E: Release file for http://mirrors.ustc.edu/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 37d 6h 29min 32s). Updates for this repository will not be applied.
E: Release file for http://mirrors.ustc.edu/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 25d 22h 20min 18s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 37d 9h 9min 36s). Updates for this repository will not be applied.

注意看提示“...  is not valid yet (invalid for another 37d 9h 9min 36s). Updates for this repository will not be applied.”

通过date命令查看时间,发现与当前时间不一致,于是用ntpdate更新到最新时间,然后再执行apt update && apt install build-essential 即可成功安装。

ntpdate cn.pool.ntp

apt update

apt install build-essential

家庄朗普斯科技有限公司,www.lammps,主要开展云计算、服务器、集群软硬件一体化方案、超算租赁相关业务。

本文标签: 错误UbuntuBuildessential