Ubuntu – Network indicator missing but connected (16.04 LTS Unity)

aptindicatornetwork-managernetworking

After a recent upgrade it seems that I have removed network-manager-gnome, or did upgrade -f did it, so I do not see the network indicator in the panel. Network is active, both wireless and local.

I have tried:

  1. nm-applet, it's not installed. If I try to install it by installing network-manager-gnome I receive:

    The following packages have unmet dependencies: 
    network-manager-gnome : Depends: default-dbus-session-bus but it is not installable or dbus-session-bus but it is not installable
                            Recommends: mobile-broadband-provider-info but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    
  2. Restarting the service sudo service network-manager restart just restarts it to make it work again, but again, no indicator.

Edit (Requested Outputs):

  • Output of cat nm-applet:

    [Desktop Entry]
    Name=Network
    Comment=Manage your network connections
    Icon=nm-device-wireless
    Exec=nm-applet
    Terminal=false
    Type=Application
    NoDisplay=true
    NotShowIn=KDE;GNOME;
    X-GNOME-Bugzilla-Bugzilla=GNOME
    X-GNOME-Bugzilla-Product=NetworkManager
    X-GNOME-Bugzilla-Component=nm-applet
    X-GNOME-UsesNotifications=true
    X-Ubuntu-Gettext-Domain=nm-applet
    
  • locate nm-applet indicates:

    gaj@gaj-Lenovo-Z51-70:~$ locate nm-applet
    /etc/xdg/autostart/nm-applet.desktop
    /usr/share/app-install/desktop/network-manager-gnome:nm-applet.desktop
    /usr/share/locale-langpack/en_AU/LC_MESSAGES/nm-applet.mo
    /usr/share/locale-langpack/en_CA/LC_MESSAGES/nm-applet.mo
    /usr/share/locale-langpack/en_GB/LC_MESSAGES/nm-applet.mo
    /usr/share/locale-langpack/hr/LC_MESSAGES/nm-applet.mo
    
  • If I try to install network-manager-gnome using using aptitude i get:

    The following NEW packages will be installed:
      network-manager-gnome{b} 
    0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 910 kB of archives. After unpacking 6049 kB will be used.
    The following packages have unmet dependencies:
     network-manager-gnome : Depends: default-dbus-session-bus which is a virtual package and is not provided by any available package.
     or
                                      dbus-session-bus which is a virtual package and is not provided by any available package.
    
    The following actions will resolve these dependencies:
    
         Keep the following packages at their current version:
    1)     network-manager-gnome [Not Installed]              
    
    
    
    Accept this solution? [Y/n/q/?] y
    

    Outputs:

    Starting pkgProblemResolver with broken count: 1
    Starting 2 pkgProblemResolver with broken count: 1
    Investigating (0) network-manager-gnome [ amd64 ] < none -> 1.2.4-0ubuntu2~ubuntu16.04.1~ppa1 > ( gnome )
    Broken network-manager-gnome:amd64 Depends on default-dbus-session-bus [ amd64 ] < none > ( none )
    Broken network-manager-gnome:amd64 Depends on dbus-session-bus [ amd64 ] < none > ( none )
    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:
     network-manager-gnome : Depends: default-dbus-session-bus but it is not installable or
                                      dbus-session-bus but it is not installable
    E: Unable to correct problems, you have held broken packages.
    

Best Answer

your locate command indicates that you are missing a great deal of content from the usr/share/nm-applet/ directory. the content you are missing can be found in the network-manager-gnome_1.1.93-1ubuntu1_amd64.deb package which can be found here. If you are unable to install it by normal means dpkg has a big hammer for situations such as this and issuing the command sudo dpkg -i --force-downgrade network-manager-gnome_1.1.93-1ubuntu1_amd64.deb

If you have a current backup For an even bigger hammer you can use the --force-depends or --force-all switches

I'm not kidding about the backup. More information is available regarding dpkg force options with the command: dpkg --force-help which I have replicated below for your convenience

dpkg forcing options - control behaviour when problems found:
  warn but continue:  --force-<thing>,<thing>,...
  stop with error:    --refuse-<thing>,<thing>,... | --no-force-<thing>,...
 Forcing things:
  [!] all                Set all force options
  [*] downgrade          Replace a package with a lower version
      configure-any      Configure any package which may help this one
      hold               Process incidental packages even when on hold
      not-root           Try to (de)install things even when not root
      bad-path           PATH is missing important programs, problems likely
      bad-verify         Install a package even if it fails authenticity check
      bad-version        Process even packages with wrong versions
      overwrite          Overwrite a file from one package with another
      overwrite-diverted Overwrite a diverted file with an undiverted version
  [!] overwrite-dir      Overwrite one package's directory with another's file
  [!] unsafe-io          Do not perform safe I/O operations when unpacking
  [!] confnew            Always use the new config files, don't prompt
  [!] confold            Always use the old config files, don't prompt
  [!] confdef            Use the default option for new config files if one
                         is available, don't prompt. If no default can be found,
                         you will be prompted unless one of the confold or
                         confnew options is also given
  [!] confmiss           Always install missing config files
  [!] confask            Offer to replace config files with no new versions
  [!] architecture       Process even packages with wrong or no architecture
  [!] breaks             Install even if it would break another package
  [!] conflicts          Allow installation of conflicting packages
  [!] depends            Turn all dependency problems into warnings
  [!] depends-version    Turn dependency version problems into warnings
  [!] remove-reinstreq   Remove packages which require installation
  [!] remove-essential   Remove an essential package

WARNING - use of options marked [!] can seriously damage your installation.
Forcing options marked [*] are enabled by default.

It appears that you obtained the version you have installed from ppa:vascofalves/gnome-backports I recommend you remove this PPA from your sources.list as it's clearly stated in the description that

PPA description

Backports of GNOME packages. This is for my personal use. Don't expect anything here to work properly.

Sources:

http://packages.ubuntu.com/xenial/amd64/network-manager-gnome/download

How can PPAs be removed?

https://launchpad.net/~vascofalves/+archive/ubuntu/gnome-backports

Related Question