网络指示器丢失但已连接 (16.04 LTS Unity)

Moo*_*key 9 indicator apt network-manager networking

在最近的升级之后,我似乎已经删除了 network-manager-gnome,或者确实是 upgrade -f 做了,所以我没有在面板中看到网络指示器。网络处于活动状态,包括无线和本地。

我试过了:

  1. nm-applet,它没有安装。如果我尝试通过安装 network-manager-gnome 来安装它,我会收到:

    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.
    
    Run Code Online (Sandbox Code Playgroud)
  2. 重新启动服务sudo service network-manager restart只是重新启动它以使其再次工作,但同样没有任何指示。

编辑(请求的输出):

  • 的输出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
    
    Run Code Online (Sandbox Code Playgroud)
  • locate nm-applet 表示:

    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
    
    Run Code Online (Sandbox Code Playgroud)
  • 如果我尝试使用 using 安装 network-manager-gnome,aptitude我会得到:

    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
    
    Run Code Online (Sandbox Code Playgroud)

    输出:

    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.
    
    Run Code Online (Sandbox Code Playgroud)

Eld*_*eek 3

您的locate 命令表明您丢失了目录中的大量内容usr/share/nm-applet/。您缺少的内容可以在 network-manager-gnome_1.1.93-1ubuntu1_amd64.deb 包中找到,该包可以在此处找到。如果您无法通过正常方式安装它,dpkg 有一个大锤子可以解决这种情况并发出命令sudo dpkg -i --force-downgrade network-manager-gnome_1.1.93-1ubuntu1_amd64.deb

如果您有当前备份 对于更大的锤子,您可以使用 --force-depends 或 --force-all 开关

我不是在开玩笑关于备份。有关使用命令的 dpkg 强制选项的更多信息:dpkg --force-help为了您的方便,我在下面复制了该命令

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.
Run Code Online (Sandbox Code Playgroud)

看来您是从 ppa:vascofalves/gnome-backports 获取安装的版本的,我建议您从您的sources.list 中删除此 PPA,因为描述中明确指出:

PPA description

Backports of GNOME packages. This is for my personal use. Don't expect anything here to work properly.
Run Code Online (Sandbox Code Playgroud)

资料来源:

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

如何删除 PPA?

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