Install libgtk-3-dev on Ubuntu 20.04 - c++

I would like to write a GUI in cpp. As far as I know gtk is a nice solution for this. Sadly it appears to me that gtk is no longer available under Ubuntu 20.04. (I am using Xubuntu if this matters)
Executing: sudo apt install libgtk-3-dev
Leads to:
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.
I added "deb http://archive.ubuntu.com/ubuntu focal-updates main" as suggested and tried again resulting in:
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.
I am looking for a solution to install libgtk-3-dev.

The problem is that the proper version of the library libgtk-3-dev and related dependencies are not in the main focal repository yet. My solution was to add focal-updates repo. You can do it through GUI (Software&Update) or by manually editing file:
/etc/apt/sources.list
and adding following line:
deb http://archive.ubuntu.com/ubuntu focal-updates main
Then I was able to install the library (I used Synaptic manager) without any problems.
And finally I have disabled the focal-updates repo to stay just with release repo as before, not to automatically update other not-yet-released libraries.

I would first make sure I have all the required dependencies, make sure to install the specific version required. The dependencies can be found here on Ubuntu 's website
If the dependencies can not be found in the apt repository, you can always download the source files for each missing package from their respective websites, and build libgtk from source.
You most likely have a package that's incompatible with one of the others needed installed however it would require a bit more digging to find the root.

Related

Unable to install g++ in ubuntu 20.04

I have seen some questions similar to this on this website old latest.
But none of them have been answered and I am unable to comment there because I have less reputation points.
When I run sudo apt install g++ I get the following error:
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:
g++ : Depends: gcc (= 4:9.3.0-1ubuntu2) but it is not going to be installed
Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
Depends: gcc-9 (>= 9.3.0-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
When I run sudo apt install build-essential
I get the following error:
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:
build-essential : Depends: gcc (>= 4:9.2) but it is not going to be installed
Depends: g++ (>= 4:9.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I need to install g++ in ubuntu20.04.
Thanks for the help!
I found a work around by installing aptitude first.
I followed the following steps:
sudo apt-get install aptitude
Then aptitude gives a list of packages (none of which were installed)
and asks to keep those packages in the same version. Choose No (n).
Then aptitude asks to downgrade some packages. Choose Yes (Y).
Finally run the command: sudo aptitude install build-essential
After running the above command g++ was already install and I didn't need to separately install it.\

getting error in installing Prerequisites wxWidgets "E: Unable to correct problems, you have held broken packages."

i'm following https://wiki.wxwidgets.org/Compiling_and_getting_started install guide for wxWidgets.
when i'm installing Prerequisites getting error:
command:
sudo apt install libgtk2.0-dev
error:
The following packages have unmet dependencies:
libgtk2.0-dev : Depends: libglib2.0-dev (>= 2.27.3) but it is not going to be installed
Depends: libgdk-pixbuf2.0-dev (>= 2.21.0) but it is not going to be installed
Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
Depends: libatk1.0-dev (>= 1.29.2) but it is not going to be installed
Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
run
sudo apt-cache search libwxgt*
it output some packages name.
than try to install one by one all the packages.
output
libwxgtk-media3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 media library runtime)
libwxgtk-media3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 media library development)
libwxgtk-webview3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 webview library runtime)
libwxgtk-webview3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 webview library development)
libwxgtk3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 runtime)
libwxgtk3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK 3 development)
for example
sudo apt-get install libwxgtk-media3.0-gtk3-0v5
...
and so on.

trying to install `gdb-multiarch` on ubuntu 18.04

I am trying to install gdb-multiarch on ubuntu 18.04. When I use sudo apt-get install gdb-multiarch, I am getting following error.
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:
gdb-multiarch : Depends: gdb (= 8.1-0ubuntu3.2) but it is not going to be installed
Depends: libpython3.6 (>= 3.6.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I couldn't find a way to install above dependencies.
It's probably caused by an installation of a version of python that wasn't included with your Ubuntu install so your package manager is confused about what to do.
This worked for me:
https://askubuntu.com/questions/1061762/ubuntu-18-04-cant-upgrade-because-of-libpython3-6-version-conflicts

issue working with HARDWARE acceleration / gstreamer on odroid XU4

i try to have a v4l source from my c920 logitech camera with gstreamer . I have an odroid XU4 with ubuntu 14.04 version 4.9 . I 'm trying to use the hardware acceleration to avoid using a lot of CPU .
I installed gstreamer from source since version > 1.2 is not available directly for ubuntu 14.04
I did it like this :
git clone -b 1.10 https://github.com/GStreamer/gstreamer.git
cd gstreamer
./autogen.sh
make -j
sudo make install
sudo ldconfig
I followed this tutorial :
https://forum.odroid.com/viewtopic.php?f=146&t=24366
I did the build from source for each dependencies needed by the tutorial in this order:
- gst-plugins-base
- gst-libav
- gst-plugins-bad
after that I get gst-plugins-good from https://github.com/mihailescu2m/gst-plugins-good and compile/install it
But I try to make I get this error :
gstv4l2videodec.c:48:3: error: conflicting types for 'GstV4l2VideoCData'
} GstV4l2VideoCData;
I don't understand where that come from and did not find any solution on the web. I don't want to break anything so I don't want to install wrong versions of libraries . Any idea of the source of the bug ?
Thanks for your help , i'm quite a noobie with odroid so sorry if the answer is obvious.
I fixed the error by applying this patch to the files concerned : https://github.com/fnoop/gst-plugins-good/commit/3825320c95740d57501638563cdf2546dc016846
but now I get an error when I 'm trying to run
dpkg-buildpackage -us -uc -b -j4
I get :
dpkg-checkbuilddeps: Unmet build dependencies: libgstreamer1.0-dev (>= 1.8.0) libgstreamer-plugins-base1.0-dev (>= 1.8.1) gstreamer1.0-plugins-base (>= 1.8.0) libsoup2.4-dev (>= 2.48) gstreamer1.0-doc gstreamer1.0-plugins-base-doc
I don't know how to install the correct versions of libgstreamer-plugins-base1.0-dev and libgstreamer1.0-dev for Ubuntu 14.04.
Does anyone know how to get to this ?
dpkg-checkbuilddeps searches for packages installed through .deb files. This excludes installations that don't use the debian package mechanism (in your case the gstreamer package).
You can always modify the debian/build-deps file in your gst-plugins-good repo by removing the (>= 1.8.0) for instance for all unmet dependencies. Then you can try to see if the build succeeds anyway. But then you have to make sure you installed all missing deps by hand with there correct version.

Cannot install Boost library in Ubuntu 12.04

I am trying to install Boost library in my ubuntu 12.04 and always getting the following error:
The following packages have unmet dependencies:
libboost-all-dev : Depends: libboost-iostreams-dev but it is not going to be installed
Depends: libboost-regex-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages
I have search for a solution to the unmet dependencies issue but nothing seems to work. Can some one help with this ?
I'm getting the above error when running sudo apt-get install libboost-all-dev command on my terminal.