Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[Solved] Unable to install libgtk2.0-dev

Help for Current Versions of MX
Post Reply
Message
Author
User avatar
thomasl
Forum Regular
Forum Regular
Posts: 107
Joined: Sun Feb 04, 2018 10:26 am

[Solved] Unable to install libgtk2.0-dev

#1 Post by thomasl » Thu Nov 08, 2018 11:27 am

(Feel free to move if this is the wrong forum.)
I want to compile geany (a text editor). To do so I need, among other things, this:

Code: Select all

sudo apt-get install libgtk2.0-dev
which gives me that:

Code: Select all

The following packages have unmet dependencies:
 libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) 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.
After some googling and further investigation it seems that there are newer version of libfreetype6 and libfreetype6-dev installed than the ones needed by libgtk2.0-dev. I could try to downgrade that but then I get this lovely bit:

Code: Select all

apt-get install libfreetype6=2.6.3-3.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  ffmpeg firefox gimp gstreamer1.0-libav gstreamer1.0-plugins-bad guvcview libasound2-plugins libasound2-plugins:i386 libavcodec57 libavcodec57:i386
  libavdevice57 libavdevice58 libavfilter6 libavfilter7 libavformat57 libavformat58 libavresample3 libavresample3:i386 libavutil55:i386 libcairo2:i386
  libcanberra-pulse libchromaprint1 libffmpegthumbnailer4v5 libfontconfig1:i386 libfreetype6:i386 libgd3:i386 libgegl-0.3-0 libgegl-0.4-0 libgimp2.0
  libgphoto2-6:i386 libguvcview-2.0-2 libharfbuzz0b:i386 libmpv1 libopencv-calib3d2.4v5 libopencv-features2d2.4v5 libopencv-highgui2.4-deb0
  libopencv-objdetect2.4v5 libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpostproc54 librsvg2-2:i386 libswresample2:i386 libswscale4 libtheora0:i386
  moc-ffmpeg-plugin mpc-qt mplayer mx-system-sounds pacpl pulseaudio pulseaudio-module-bluetooth spacefm tumbler-plugins-extra unpaper vlc vlc-plugin-base
  vlc-plugin-video-output wine-staging wine-staging-amd64 wine-staging-i386:i386 winehq-staging
The following packages will be DOWNGRADED:
  libfreetype6
0 upgraded, 0 newly installed, 1 downgraded, 61 to remove and 0 not upgraded.
Of course I cancelled that... but what now?

EDIT: The system is fully updated.
Last edited by thomasl on Fri Nov 09, 2018 10:46 am, edited 1 time in total.
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
“In foreign countries they fear baldness. They are so rich in foreign countries, they can afford to fear all kinds of silly things.”

User avatar
timkb4cq
Forum Veteran
Forum Veteran
Posts: 4430
Joined: Wed Jul 12, 2006 4:05 pm

Re: Unable to install libgtk2.0-dev

#2 Post by timkb4cq » Thu Nov 08, 2018 4:00 pm

From the dependencies you list, you must be running MX-15 or MX-16.
I just installed libgtk2.0-dev on my fully updated MX-15 system with no problems. libfreetype6 is 2.7-0mx150+ and is just fine, so that shouldn't be a problem.
Try

Code: Select all

sudo apt-get install libpango1.0-dev libcairo2-dev
to see what is blocking their installation.

Oh, and BTW, geany 1.33 is available in the MX Testing repository, so you can use the MX Package Installer in MX-Tools to upgrade geany to the latest stable version if you have no other reason for compiling it yourself.
MSI 970A-G43 MB, AMD FX-6300 (six core), 16GB RAM, GeForce 730, Samsung 850 EVO 250GB SSD, Seagate Barracuda XT 3TB

User avatar
thomasl
Forum Regular
Forum Regular
Posts: 107
Joined: Sun Feb 04, 2018 10:26 am

Re: Unable to install libgtk2.0-dev

#3 Post by thomasl » Fri Nov 09, 2018 8:35 am

timkb4cq wrote:
Thu Nov 08, 2018 4:00 pm
From the dependencies you list, you must be running MX-15 or MX-16.
:confused: Not at all. I firmly believe that I am running MX17.1/64. This was a fresh install, based on the MX17.1 April 2018 snapshot and has been kept updated since. (I actually did a dist-upgrade immediately before starting this geany compile thing.) See the output of uname:

Code: Select all

2~>uname --all
Linux mx17p 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1~mx17+1 (2018-02-23) x86_64 GNU/Linux
timkb4cq wrote:
Thu Nov 08, 2018 4:00 pm

Code: Select all

sudo apt-get install libpango1.0-dev libcairo2-dev

Code: Select all

2~>sudo apt-get install libpango1.0-dev libcairo2-dev
Reading package lists... Done
Building dependency tree... 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:
 libcairo2-dev : Depends: libfontconfig1-dev (>= 2.2.95) but it is not going to be installed
                 Depends: libfreetype6-dev (>= 2.1.10) but it is not going to be installed
 libpango1.0-dev : Depends: libfontconfig1-dev (>= 2.10.91) but it is not going to be installed
                   Depends: libfreetype6-dev but it is not going to be installed
                   Depends: libxft-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
timkb4cq wrote:
Thu Nov 08, 2018 4:00 pm
Oh, and BTW, geany 1.33 is available in the MX Testing repository
I know :happy: , that's what I'm currently using. However, I want to change some bits and pieces and recompile the thing. I also have the sources for a plugin I want to use but there's no .deb available.

If all else fails I will have to install MX15 or 16 in a VM, right?
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
“In foreign countries they fear baldness. They are so rich in foreign countries, they can afford to fear all kinds of silly things.”

User avatar
timkb4cq
Forum Veteran
Forum Veteran
Posts: 4430
Joined: Wed Jul 12, 2006 4:05 pm

Re: Unable to install libgtk2.0-dev

#4 Post by timkb4cq » Fri Nov 09, 2018 9:27 am

OK, I think I have figured out what happened.
You most likely had updated libfreetype6 and libfontconfig from the Test repo (possibly as dependencies of Gimp from Test).
The matching -dev files for those need to be installed to get libgtk2.0-dev installed - but they are in the Test repo which is not enabled.
So open the MX-Package Installer, select the MX Test repo, uncheck the box which hides libraries and install libfontconfig1-dev libfreetype6-dev and libxft-dev
After those are installed libgtk2.0-dev can be installed from the standard repos. I have it installed in MX-17 with those updated libraries so it does work.
MSI 970A-G43 MB, AMD FX-6300 (six core), 16GB RAM, GeForce 730, Samsung 850 EVO 250GB SSD, Seagate Barracuda XT 3TB

User avatar
thomasl
Forum Regular
Forum Regular
Posts: 107
Joined: Sun Feb 04, 2018 10:26 am

Re: Unable to install libgtk2.0-dev

#5 Post by thomasl » Fri Nov 09, 2018 10:46 am

timkb4cq wrote:
Fri Nov 09, 2018 9:27 am
So open the MX-Package Installer, select the MX Test repo, uncheck the box which hides libraries and install libfontconfig1-dev libfreetype6-dev and libxft-dev
After those are installed libgtk2.0-dev can be installed from the standard repos.
Yep, that did the trick, thanks a lot. (One small change: libxft-dev doesn't exist in test repo so I installed the standard repo version (which, if I have understood this correctly, would have happened anyway with "apt-get install libgtk2.0-dev").

And geany compiled and runs. Again thanks!
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
“In foreign countries they fear baldness. They are so rich in foreign countries, they can afford to fear all kinds of silly things.”

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16624
Joined: Fri Dec 15, 2006 8:07 pm

Re: [Solved] Unable to install libgtk2.0-dev

#6 Post by Stevo » Fri Nov 09, 2018 3:23 pm

If I were going to tweak Geany myself, I'd make those changes in the debianized source files, increment the version so it's higher, then rebuild and install the new deb so it's in the apt system.

It might also be possible to "debianize" your plugin source taking existing plugins as a template.

User avatar
thomasl
Forum Regular
Forum Regular
Posts: 107
Joined: Sun Feb 04, 2018 10:26 am

Re: [Solved] Unable to install libgtk2.0-dev

#7 Post by thomasl » Sat Nov 10, 2018 7:45 am

Stevo wrote:
Fri Nov 09, 2018 3:23 pm
If I were going to tweak Geany myself, I'd make those changes in the debianized source files, increment the version so it's higher, then rebuild and install the new deb so it's in the apt system.
One simple sentence... and so many questions. :bagoverhead:

1. What's the difference between geany sources as dl'ed from their website and the "debianized" source files?

2. And where *are* those sources?

3. Why does it make sense to increase the version number? Why not either install the modified executable over the installed version (the mods are minor, mostly to do with geany's session handling) or have it installed in ~/.local?

4. Does "install the new deb so it's in the apt system" mean a locally produced .deb that is only ever locally installed?

5. I know how to compile stuff but I have not the slightest idea as to how to create a .deb. Does "debianized" mean that the sources come with all required "plumbing" to produce the .deb as well?
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
“In foreign countries they fear baldness. They are so rich in foreign countries, they can afford to fear all kinds of silly things.”

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16624
Joined: Fri Dec 15, 2006 8:07 pm

Re: [Solved] Unable to install libgtk2.0-dev

#8 Post by Stevo » Sat Nov 10, 2018 5:13 pm

5. I know how to compile stuff but I have not the slightest idea as to how to create a .deb. Does "debianized" mean that the sources come with all required "plumbing" to produce the .deb as well?
It's basically the system we use to backport packages from upstream Debian to our own repositories. It automatically compiles the code if it's that sort of package, i.e., all the plumbing is built-in. There's a simple guide here: https://wiki.debian.org/SimpleBackportCreation

though instead of the hassle of adding and disabling the repositories to pull the sources, it can be easier just to directly download the source files from the page at packages.debian.org, the three for geany here for example: https://packages.debian.org/buster/geany

put them in a folder with no spaces in its PATH, then run in that folder:

Code: Select all

dpkg-source -x <name of .dsc file>
which basically extracts the debian folder from its .xz file, put it into the original source directory that's also extracted, and then applies any patches from debian/patches.

If your changes are simple changes to the build configuration allowed by geany's configure system, those can be applied in the debian/rules file, which holds the commands to compile and install the package into a deb, though most of that happens behind the scenes now with debhelper. In geany's case, it's this code:

Code: Select all

override_dh_auto_configure:
	dh_auto_configure -- --enable-vte --enable-the-force --enable-gtk3
	sed -i -r 's,^sys_lib_dlsearch_path_spec="(.*)$$,sys_lib_dlsearch_path_spec="/usr/lib /lib \1,' $(CURDIR)/libtool 
So you see the syntax to enable vte, the "force", and a GTK+ 3 build. So if you want to build with gtk 2, like your original question would show, you'll have to check if configure does that as default (run configure -h) or if you have to change that flag, then add libgtk-2.0-dev to the build-depends in debian/control in place of libgtk-3-dev.

If your changes are to the files that are in the original geany source code (outside the debian folder), you'll have to make them, then record those changes into a patch with

Code: Select all

dpkg-source --commit
which will create a patch in debian/patches. This allows Debian to preserve the unchanged original source file.

User avatar
thomasl
Forum Regular
Forum Regular
Posts: 107
Joined: Sun Feb 04, 2018 10:26 am

Re: [Solved] Unable to install libgtk2.0-dev

#9 Post by thomasl » Sun Nov 11, 2018 8:45 am

@Stevo: Thanks for the write-up... this is helpful and something to chew upon. Unfortunately, I am still somewhat of a noob as far as Linux is concerned, not to mention the finer points of development for Linux. So I will certainly look into this but for the moment this goes over my head.

However, there's still one practical question around this. I am used to adapt or change and recompile stuff under Windows: I am using a few packages where I download the sources whenever there's a new version, do a three-way merge and compile. I am sure the same model will work for Linux, especially since I do all the merging with kdiff3 which is originally a Linux app. However, I am still not clear as to how best to proceed once I have compiled such a new version. Overwrite the installed binary (or binaries)? Copy everything into a local directory? Or still another way?
Dual-boot MX17.1/64 frugal root persistence + Windows 7 on Lenovo Edge72 i5-3470S/12GB and Tosh R950 i5-3340M/8GB
“In foreign countries they fear baldness. They are so rich in foreign countries, they can afford to fear all kinds of silly things.”

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16624
Joined: Fri Dec 15, 2006 8:07 pm

Re: [Solved] Unable to install libgtk2.0-dev

#10 Post by Stevo » Sun Nov 11, 2018 4:03 pm

It is somewhat of a load to absorb, but I think once you actually try some packaging, things will become clearer and you'll start to appreciate the Debian approach. Just try backporting geany without any changes your first time to appreciate how it can be made easy, or some other simple packages.

We MX packagers found the best way is to stay within the Debian packaging system. You just need to have your changed custom version have a higher version in debian/changelog. A simple way to do this is add an epoch to the beginning, so instead of

geany-1.33-1

you'd have

geany-1:1.33-1

for example.

Post Reply

Return to “MX Help”