3

I am trying to learn GTK+3 as per this site: https://python-gtk-3-tutorial.readthedocs.org/en/latest/install.html. From the page:

1.1. Dependencies

  • GTK+3
  • Python 2 (2.6 or later) or Python 3 (3.1 or later)
  • gobject-introspection

[...]

The easiest way to install PyGObject from source is using JHBuild. It is designed to easily build source packages and discover what dependencies need to be build and in what order. To setup JHBuild, please follow the JHBuild manual.

I followed the manual as per that link and downloaded via git JHBuild (as they say to do) and built it with make/make install. That went fine. The next step is where the problem begins. I ran the next command I was supposed to as per the page:

2.3. Build Prerequisites

Before any modules can be built, it is necessary to have certain build tools installed. Common build tools include the GNU Autotools (autoconf, automake, libtool and gettext), The GNU Toolchain (binutils, gcc, g++), make, pkg-config and Python, depending on which modules will be built.

JHBuild can check the tools are installed using the sanitycheck command:

$ jhbuild sanitycheck

When I first ran this I got this:

jhbuild: install prefix (/opt/gnome) can not be created

I ran the following commands and got the results below:

daddara@daddara-desktop:~/jhbuild/jhbuild$ sudo chmod 777 /opt/gnome/ -R
chmod: cannot access `/opt/gnome/': No such file or directory
daddara@daddara-desktop:~/jhbuild/jhbuild$ mkdir /opt/gnome
mkdir: cannot create directory `/opt/gnome': Permission denied
daddara@daddara-desktop:~/jhbuild/jhbuild$ jhbuild sanitycheck
jhbuild: install prefix (/opt/gnome) can not be created
daddara@daddara-desktop:~/jhbuild/jhbuild$ chmod 777 /opt/gnome/ -R
chmod: cannot access `/opt/gnome/': No such file or directory
daddara@daddara-desktop:~/jhbuild/jhbuild$ sudo chmod 777 /opt/gnome/ -R
chmod: cannot access `/opt/gnome/': No such file or directory
daddara@daddara-desktop:~/jhbuild/jhbuild$ jhbuild sanitycheck
jhbuild: install prefix (/opt/gnome) can not be created
daddara@daddara-desktop:~/jhbuild/jhbuild$ mkdir -p /opt/gnome
mkdir: cannot create directory `/opt/gnome': Permission denied

What the problem is with the installation?

Dada
  • 6,313
  • 7
  • 24
  • 43
Ajzz
  • 340
  • 1
  • 7
  • 22
  • You should not use the `sanitycheck` command: like the `bootstrap` command, it's not really meant to be used on modern Linux distributions. You should read the documentation on the GNOME wiki instead: https://wiki.gnome.org/HowDoI/Jhbuild – ebassi Mar 18 '15 at 11:19

2 Answers2

2

You need to make /opt/gnome with sudo mkdir, then use sudo chmod to set its permissions. You forgot the sudo in your mkdir.

andlabs
  • 11,290
  • 1
  • 31
  • 52
0

jhbuild was also failing for me with error:

jhbuild: install prefix (/opt/gnome) can not be created

In my case, the problem was I accidentally did a sudo make install inside the gnome-icon-theme module, so this command created /opt/gnome directory and installed inside it the gnome-icon-theme files, then later I was to jhbuild run gedit and the aforementioned error came out, this is because jhbuild will automatically use /opt/gnome if it exists (for backwards compatibility), an if non-existant then will use the recommended way using ~/jhbuild/install, you can see that here .

So in this case, as the only files inside /opt/gnome were the ones I accidentally installed by my sudo make install command, the solution was just to delete this directory (eg. by doing sudo rm -rf /opt/gnome) and after that, the command jhbuild run any-gnome-app worked properly again.

Hopefully this answer can help people coming here from searching google for the (/opt/gnome) can not be created error.

Nelson
  • 49,283
  • 8
  • 68
  • 81