我想用cpp写一个GUI程序。据我所知,gtk是一个不错的解决方案。但不幸的是,在Ubuntu 20.04上似乎无法使用gtk了。(如果有关系的话)我正在使用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.
我按照建议添加了 "deb http://archive.ubuntu.com/ubuntu focal-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.
我正在寻找一个安装libgtk-3-dev的解决方案。