gdb 安装错误——libc6-dev

gdb 安装错误——libc6-dev

更新:我已经重新安装了(3次)Ubuntu,并执行了sudo apt policy libc6 libc6-dev以下输出:

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 100
        100 /var/lib/dpkg/status
N: Unable to locate package libc6-dev

然后我做了sudo apt update另一个sudo apt policy libc6 libc6-dev并得到了这个输出:

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libc6-dev:
  Installed: (none)
  Candidate: 2.35-0ubuntu3.1
  Version table:
     2.35-0ubuntu3.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

这样我就能sudo apt-get install build-essential gdb g++成功地表演了。

感谢@steeldriver 与我一起研究这个问题。我不知道如何关闭这个问题;我想版主最终会这样做的。干杯!!


我遇到了与一个老问题(2018 年 7 月),但现在(2022 年 12 月)推出了更新版本的 Ubuntu(22.04 LTS)。

当使用安装 g++ 编译器和 gdb 调试器时, sudo apt-get install build-essential gdb g++我得到以下输出,并出现错误libc6-dev

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gdb is already the newest version (12.0.90-0ubuntu1).
gdb set to manually installed.
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:
 libc6-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

这是输出cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy
ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

用户 Olimjon 在该问题中提供的最后一条评论建议全新安装 Ubuntu,我已经这样做了两次,但问题仍然存在。

最终,我的目标是遵循 Victor Gordan 关于 OpenGL 的教程,但是,我无法成功编译和运行示例。

关于如何修复 libc6-dev 依赖项有什么建议吗?

附加及更新信息

的输出apt policy libc6 libc6-dev

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 100
        100 /var/lib/dpkg/status
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libc6-dev:
  Installed: (none)
  Candidate: 2.35-0ubuntu3
  Version table:
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

sources.list文件包含:

# deb cdrom:[Ubuntu 22.04.1 LTS _Jammy Jellyfish_ - Release amd64 (20220809.1)]/ jammy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

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

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

相关内容