Nat*_*tan 8 c++ gtk user-interface apt-get ubuntu-20.04
我想用cpp写一个GUI。据我所知,gtk 是一个很好的解决方案。遗憾的是,在我看来 gtk 在 Ubuntu 20.04 下不再可用。(如果这很重要,我正在使用 Xubuntu)
执行:sudo apt install libgtk-3-dev
导致:
Reading package lists... Done
Building dependency tree
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:
libgtk-3-dev : Depends: gir1.2-gtk-3.0 (= 3.24.20-0ubuntu1) but 3.24.20-1 is to be installed
Depends: libatk-bridge2.0-dev but it is not going to be installed
Depends: libatk1.0-dev (>= 2.15.1) but it is not going to be installed
Depends: libcairo2-dev (>= 1.14.0) but it is not going to be installed
Depends: libfontconfig1-dev but it is not going to be installed
Depends: libgdk-pixbuf2.0-dev (>= 2.40.0) but it is not going to be installed
Depends: libglib2.0-dev (>= 2.57.2) but it is not going to be installed
Depends: libpango1.0-dev (>= 1.41) but it is not going to be installed
Depends: libxi-dev but it is not going to be installed
Depends: libgtk-3-0 (= 3.24.20-0ubuntu1) but 3.24.20-1 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
我按照建议添加了“deb http://archive.ubuntu.com/ubuntu focus-updates main”并再次尝试,结果是:
Reading package lists... Done
Building dependency tree
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:
libgtk-3-dev : Depends: libatk-bridge2.0-dev but it is not going to be installed
Depends: libatk1.0-dev (>= 2.15.1) but it is not going to be installed
Depends: libcairo2-dev (>= 1.14.0) but it is not going to be installed
Depends: libfontconfig1-dev but it is not going to be installed
Depends: libgdk-pixbuf2.0-dev (>= 2.40.0) but it is not going to be installed
Depends: libglib2.0-dev (>= 2.57.2) but it is not going to be installed
Depends: libpango1.0-dev (>= 1.41) but it is not going to be installed
Depends: libxi-dev but it is not going to be installed
Depends: libgtk-3-0 (= 3.24.20-0ubuntu1) but 3.24.20-1 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
我正在寻找安装 libgtk-3-dev 的解决方案。
Bar*_*jka 10
问题在于,正确版本的库 libgtk-3-dev 和相关依赖项尚未出现在主焦点存储库中。我的解决方案是添加焦点更新存储库。您可以通过 GUI(软件和更新)或手动编辑文件来完成此操作:
/etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)
并添加以下行:
deb http://archive.ubuntu.com/ubuntu focal-updates main
Run Code Online (Sandbox Code Playgroud)
可能需要更新存储库列表(如果您从命令行工作):
sudo apt update
Run Code Online (Sandbox Code Playgroud)
然后我就可以毫无问题地安装该库(我使用 Synaptic 管理器)。最后,我禁用了 focus-updates 存储库,以便像以前一样保留发布存储库,而不是自动更新其他尚未发布的库。