Score:1

Firefox has vanished from applications menu in Ubuntu 20.04

ru flag

I use both Gnome and KDE Plasma on Ubuntu 20.04. I used the 'Edit Application' feature in Plasma to get Firefox to start using my dedicated graphics card. I also installed certain updates using Discover in Plasma (which I generally don't do). Here are these updates from the logs:

Upgrade: grub-common:amd64 (2.04-1ubuntu26.11, 2.04-1ubuntu26.12), ubuntu-advantage-tools:amd64 (20.3, 27.0.2~20.04.1), grub2-common:amd64 (2.04-1ubuntu26.11, 2.04-1ubuntu26.12), grub-pc:amd64 (2.04-1ubuntu26.11, 2.04-1ubuntu26.12), grub-pc-bin:amd64 (2.04-1ubuntu26.11, 2.04-1ubuntu26.12), grub-efi-amd64-bin:amd64 (2.04-1ubuntu44, 2.04-1ubuntu44.2), grub-efi-amd64-signed:amd64 (1.167+2.04-1ubuntu44, 1.167.2+2.04-1ubuntu44.2)

After this, I logged back into Gnome to see that Firefox has vanished from the Applications menu and the 'Installed' section in Software Centre. I can search for it in Software Centre and it says it's still installed. I can even access and launch it from /usr/share/applications. I can still run it on KDE Plasma. But on Gnome it just won't show up in the Applications menu despite uninstalling and reinstalling twice. I even undid what I had initially done on Plasma regarding the dedicated graphics card but that has not made any difference. Lastly, I tried to uninstall it on Gnome using Software Centre and then install it from Plasma using Discover, but it didn't help either. The odd thing is that I did the same setting change regarding the dedicated GPU for three other applications and they're all fine, but Firefox just won't appear in the Applications menu, so I'm not sure if the issue is being caused by editing the application or because of the updates I installed from Discover. How do I fix this?

UPDATE: Here is what I believe is the relevant content from the /usr/share/applications/firefox.desktop:

Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
Actions=new-window;new-private-window;

I opened /usr/bin/firefox and these are its contents

#!/bin/sh

set -e

# Firefox launcher containing a Profile migration helper for
# temporary profiles used during alpha and beta phases.

# Authors:
#  Alexander Sack <[email protected]>
#  Fabien Tassin <[email protected]>
#  Steve Langasek <[email protected]>
#  Chris Coulson <[email protected]>
# License: GPLv2 or later

MOZ_LIBDIR=/usr/lib/firefox
MOZ_APP_LAUNCHER=`which $0`
MOZ_APP_NAME=firefox

export MOZ_APP_LAUNCHER

while [ ! -x $MOZ_LIBDIR/$MOZ_APP_NAME ] ; do
    if [ -L "$MOZ_APP_LAUNCHER" ] ; then
        MOZ_APP_LAUNCHER=`readlink -f $MOZ_APP_LAUNCHER`
        MOZ_LIBDIR=`dirname $MOZ_APP_LAUNCHER`
    else
        echo "Can't find $MOZ_LIBDIR/$MOZ_APP_NAME"
        exit 1
    fi
done

usage () {
    $MOZ_LIBDIR/$MOZ_APP_NAME -h | sed -e 's,/.*/,,'
    echo
    echo "      -g or --debug          Start within debugger"
    echo "      -d or --debugger       Specify debugger to start with (eg, gdb or valgrind)"
    echo "      -a or --debugger-args  Specify arguments for debugger"
}

moz_debug=0
moz_debugger_args=""
moz_debugger="gdb"

while [ $# -gt 0 ]; do
    case "$1" in
        -h | --help )
            usage
            exit 0
            ;;
        -g | --debug )
            moz_debug=1
            shift
            ;;
        -d | --debugger)
            moz_debugger=$2;
            if [ "${moz_debugger}" != "" ]; then
          shift 2
            else
              echo "-d requires an argument"
              exit 1
            fi
            ;;
        -a | --debugger-args )
            moz_debugger_args=$2;
            if [ "${moz_debugger_args}" != "" ] ; then
                shift 2
            else
                echo "-a requires an argument"
                exit 1
            fi
            ;;
        -- ) # Stop option processing
            shift
            break
            ;;
        * )
            break
            ;;
    esac
done

if [ $moz_debug -eq 1 ] ; then
    case $moz_debugger in
        memcheck)
            debugger="valgrind"
            ;;
        *)
            debugger=$moz_debugger
            ;;
    esac

    debugger=`which $debugger`
    if [ ! -x $debugger ] ; then
        echo "Invalid debugger"
        exit 1
    fi

    case `basename $moz_debugger` in
        gdb)
            exec $debugger $moz_debugger_args --args $MOZ_LIBDIR/$MOZ_APP_NAME "$@"
            ;;
        memcheck)
            echo "$MOZ_APP_NAME has not been compiled with valgrind support"
            exit 1
            ;;
        *)
            exec $debugger $moz_debugger_args $MOZ_LIBDIR/$MOZ_APP_NAME "$@"
            ;;
    esac
else
    exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"
fi
vanadium avatar
cn flag
It is the `.desktop` launcher of Firefox that has been changed to the extent that it does not anymore show up under Gnome.
ru flag
How do I fix this?
vanadium avatar
cn flag
Your "Edit application" feature seems to have changed the desktop file in a way that causes it not to be shown in Gnome (i.e., some change that is not quite compatible with different desktops, or maybe a OnlyShowIn directive, etc.). So you will need to look at its contents to see where the issue may be.
ru flag
I've updated the question with the contents of /usr/bin/firefox
vanadium avatar
cn flag
I do not expect the changes to be in the wrapper script. I expect the changes to be in the `.desktop` launcher in `/usr/share/applications` (for a default installed Firefox).
ru flag
Updated again with what I think is the relevant bit in the .desktop launcher.
Score:0
ru flag

Here is a resolution for this issue. In my case, I just ran sudo dpkg -P firefox and then installed it from the Software Centre.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.