Zhixian's Tech Blog

2018-06-15

How to fix “topmenu-gtk-module” error in Ubuntu 18.04 LTS

Filed under: computing, ubuntu — Tags: , , , — Zhixian @ 10:09:06 am

Overview

This blog post is a quick note to myself explaining how I fix the ‘Failed to load module “topmenu-gtk-module’ error message from displaying.

Scenario

Sometimes when launching an application in Linux you may come across an error message that reads:

Gtk-Message: 09:24:00.567: Failed to load module “topmenu-gtk-module”

topmenu-gtk-module

You are most likely to see this error when you try to launch a desktop application from the command-line.

This error message appears because your operating system is probably missing required packages, specifically “topmenu-gtk3” or “topmenu-gtk2”.

However if you are on Ubuntu 18.04 LTS, you will find that you could not install these packages using “apt-get” command-line tool, simply because they are not available. The latest of these packages are only available on Xenial or Artful. 😦

unable-to-locate-package

During the upgrade from Xenial to Bionic, the installation process disables all other PPAs.
Here are a few examples:

disabled-ppas

While its possible to fix this issue by downloading and compiling the source files for these packages, being of a lazy nature I decide against to do that. Instead what I chose to do is intentionally add the Xenial package repository back into my list of “Software & Updates”.

deb http://sg.archive.ubuntu.com/ubuntu/ubuntu xenial main universe

include-xenial

After I added that back in, it should prompt you to update your list of packages.
If it did not, run:

sudo apt-get update

After the command-line have finish running, you can install “topmenu-gtk2” and/or “topmenu-gtk3”.

sudo apt-get install topmenu-gtk3

sudo apt-get install topmenu-gtk2

I tried install “topmenu-gtk3” first. But that did not get rid of the message. So I went on to install “topmenu-gtk2”.

After the packages finished installing, you should not see the error message when you run your desktop application from the command-line.

Advertisements

3 Comments »

  1. Nice clear instructions … but I couldn’t get them to work! 😦

    (a) Under “Software and Updates -> Other Software” I see:

    Ubuntu 16.04 LTS ‘Xenial Xerus’ (Source Code)
    Community maintained

    which is not quite the same as what is shown above.

    However I ticked the box, and it asked for my password and “updated the cache”.
    So I thought that I was on my way.

    (b) Then I did sudo apt-get update — there seemed to be no problems.

    (c) But then I did both

    sudo apt-get install topmenu-gtk3

    and

    sudo apt-get install topmenu-gtk2

    and both responded with

    E: Unable to locate package topmenu-gtk3

    (or E: Unable to locate package topmenu-gtk2 respectively).

    I have no idea what to try next. Can you help?

    Comment by Rolf Turner — 2018-08-23 @ 19:24:08 pm

  2. Having had no response to my previous comment, I thrashed about on my own.
    Based on another example that I had seen I did:

    sudo add-apt-repository ‘deb http://sg.archive.ubuntu.com/ubuntu/ubuntu xenial main universe’

    “by hand” rather than by trying to invoke System -> Administration -> Sofware & Updates -> Other Sofware, as recommended above.

    Having done that, I followed the remainder of the prescribed procedure:

    sudo apt-get update
    sudo apt-get install topmenu-gtk2

    The error “Failed to load module “topmenu-gtk-module” then ceased to occur.

    Using the gtk3 version failed for me as it did for Zhixian.

    I hope that the foregoing is useful to someone.

    Comment by Rolf Turner — 2018-08-25 @ 06:25:08 am

  3. The only way I can get inkscape to work with 18.04.2 LTS (Mate) is to force it to use the canberra-gtk-module using this alias:-

    alias iscape=’GTK_MODULES=”canberra-gtk-module” /usr/bin/inkscape’

    (and just in case WordPress fools with the quotes, the outside ones are singles and the canberra ones are doubles).

    Put the whole line into your .bash_aliases or .bashrc file and then either log out and back in again, or just do “. .bash_aliases”. You should now be able to use “iscape” to start inkscape with a menu-bar. Yay!

    -John-

    Comment by PuceBaboon — 2019-07-02 @ 21:55:07 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: