在最近的一次升级后,我似乎删除了 network-manager-gnome,或者升级 -f 删除了它,所以我在面板中看不到网络指示器。网络处于活动状态,包括无线和本地。
我努力了:
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.
重启该服务
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
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
如果我尝试使用安装 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
输出:
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.
答案1
不管怎样,都先更新包列表。
sudo apt-get update
请注意,任何进一步的操作都可能会删除重要的网络包,并且您可能会陷入复杂的非网络情况。因此,请小心,在阅读其余步骤之前不要删除任何内容。
如果可能的话,使用 aptitude。
sudo aptitude
(如果已安装)。它在解决依赖关系方面确实比 apt-get 或您正在使用的任何 GUI 都更积极。请查看手册页,但为了快速启动,您可以通过按“b”(代表破碎的)几次。然后只需按一次“g”(代表去) 并查看软件包树中建议的解决方案。如果解决方案不是删除整个系统 :) (超过几个 deb),您可以使用第二个“g”来应用它。
如果您不具备 aptitude 或者上述修复没有成功,请通过以下方式修复所有损坏的软件包:
sudo apt-get -f install
如果仍然没有运气,则需要手动修复,并花费更多时间来解决问题。在这种情况下,首先查看保留的包:
apt-mark showhold
或者
dpkg --get-selections | grep hold
然后查看损坏的包裹:
dpkg -l | grep ^..r
然后解开令你发疯的破碎的东西:
sudo apt-mark unhold package_name
并尝试
sudo apt-get -f install
再次。
最后,您可以尝试安装 aptitude 并使用它来安装所需的软件包。如果不成功,请将保留和损坏的软件包列表添加到您的问题中,因为您可能确实有损坏的依赖项。
根据问题作者提供的额外信息进行编辑
似乎你已经安装了一些 PPA,它优先考虑网络管理器-gnome软件包版本为 1.2.4-0ubuntu2~ubuntu16.04.1~ppa1,目前最新的稳定版本(16.04)为 1.2.0-0ubuntu0.16.04.4。较新的软件包可能来自一些 gnome-backport 存储库,例如gnome-backport 存储库如下。
继续的两种方法...
- 恢复 Gnome 的稳定版本(适用于 16.04)
- 查找任何其他 PPA 中缺少的软件包
对于场景 1:我的下一个建议是开始资质在交互模式下运行sudo aptitude
,然后按斜线(“/”)进行搜索并在搜索字段中输入网络管理器-gnome然后输入。选择软件包后,按 Enter 键将其打开,然后使用箭头/pgdown 转到信息页面的底部。在那里,您可以选择安装官方版本“1.2.0-0ubuntu0.16.04.4”- 选择它并按加号 (+)。这将触发 aptitude 的软件包依赖解析器,它将尝试为您提供解决方案。如果 hedaer 变为红色,则意味着存在一些中断的依赖关系 - 按几次“b”来检查它们...
不幸的是,最有可能的解决方案是删除所有反向移植的 Gnome 员工...如果您能忍受 - 那就去做吧。然后尝试通过 aptitude 安装任何其他软件包,以提前查看您会遇到什么麻烦...
对于场景 2:我们首先需要知道你正在使用的反向移植存储库...可能是其他的这,因此正如评论讨论中所建议的那样 - 给出输出
egrep -v '^#|^ $' /etc/apt/sources.list /etc/apt/sources.list.d/
和
egrep Pin-Priority /etc/apt/preferences /etc/apt/preferences.d/*
答案2
您的定位命令表明您缺少目录中的大量内容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 force 选项的更多信息,请参见命令: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.
看来您已从 ppa:vascofalves/gnome-backports 获取了所安装的版本,我建议您删除该 PPA从你的 sources.list 中可以清楚地看出
PPA description
Backports of GNOME packages. This is for my personal use. Don't expect anything here to work properly.
资料来源:
http://packages.ubuntu.com/xenial/amd64/network-manager-gnome/download
https://launchpad.net/~vascofalves/+archive/ubuntu/gnome-backports
答案3
这个问题可以通过使用 aptitude 重新安装或安装 network-manager-gnome 来解决,我被告知依赖关系要么被解决,要么不会改变任何东西。解决依赖关系解决了问题(降级了它们)。