When I enter the command

sudo apt-get install gtk+2.0

I get Output is like this:

Reading state information... Done
Note, selecting 'gir1.2-spice-client-gtk-2.0' for regex 'gtk+-2.0'
Note, selecting 'gir1.2-gtk-2.0' for regex 'gtk+-2.0'
Note, selecting 'libspice-client-gtk-2.0-dev' for regex 'gtk+-2.0'
Note, selecting 'libspice-client-gtk-2.0-1' for regex 'gtk+-2.0'
Note, selecting 'gir1.0-gtk-2.0' for regex 'gtk+-2.0'
gir1.2-gtk-2.0 is already the newest version.
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:
 libspice-client-gtk-2.0-dev : Depends: libgtk2.0-dev (>= 2.18.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I am new to Ubuntu what I have to do?

  • 3
    I don't think there is a package named gtk+2.0 - what package are you trying to install, exactly, and why? (unfortunately apt-get insists on treating package names as regexes when it doesn't find an exact match) Apr 30, 2016 at 17:52
  • I have to install a software named lamps for data analysis purpose. For it installation they need The graphics environment gtk+ (example: gtk+-1.2.10-33). so what i have to do Apr 30, 2016 at 17:57
  • If you have Ubuntu, you already have a GTK-based graphic environment.
    – dadexix86
    Apr 30, 2016 at 18:02
  • but when i am make my software they showing gcc -g pkg-config --cflags gtk+-2.0 -c -o ascii2d.o ascii2d.c Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found ascii2d.c:1:21: fatal error: gtk/gtk.h: No such file or directory compilation terminated. make: *** [ascii2d.o] Error 1 so what i am supposed to do Apr 30, 2016 at 18:11
  • 10
    If you're trying to build software that requires gtk+-2.0 then the package you should install is called libgtk2.0-dev. Make sure you run sudo apt-get update first to make sure the package catalog is up to date. Apr 30, 2016 at 18:15

2 Answers 2


The right command is:

sudo apt-get install gtk2.0

First you need gtk2 and the command for that is

sudo apt-get install gtk2.0

chances are that its already installed.

Then you need the development package libgtk2.0-dev and this can be installed by the command:

sudo apt-get install build-essential libgtk2.0-dev
  • I tried to install gtk2.0 in Ubuntu-bash (Windows 10) I got following error after running the first comment. Errors were encountered while processing: libpython3.5-minimal:amd64 python3.5-minimal libpython3.5-stdlib:amd64 python3.5 libpython3.5:amd64 libpython3.5-dev:amd64 libpython3-dev:amd64 python3.5-dev python3-dev python3-pip python3-setuptools python3-wheel E: Sub-process /usr/bin/dpkg returned an error code (1)
    – phenomenon
    Oct 30, 2017 at 9:50
  • 2
    Are you trying install within a Linux Subsystem on Windows 10? My tested solution is only for a real Ubuntu system installed on its own partition. I have not tested on a Windows Linux subsystem and I cannot recommend its use. Serious users should install Ubuntu on its own partition. Nov 2, 2017 at 2:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .