安装 libgirepository-1.0-1:i386 导致奇怪的现象

安装 libgirepository-1.0-1:i386 导致奇怪的现象

这个 apt-get 交换让我感到困惑(在 64 位 CPU 上):

$ lsb_release -a                                                                                                                                                                       
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty

运行该命令时出现以下输出:

$ sudo apt-get install libgirepository-1.0-1:i386

Following packages have been installed and are no longer necessary:
  app-install-data-partner cdrdao fonts-lao fonts-thai-tlwg fonts-tlwg-garuda
  fonts-tlwg-kinnari fonts-tlwg-loma fonts-tlwg-mono fonts-tlwg-norasi
  fonts-tlwg-purisa fonts-tlwg-sawasdee fonts-tlwg-typewriter
  fonts-tlwg-typist fonts-tlwg-typo fonts-tlwg-umpush fonts-tlwg-waree
  foomatic-db-compressed-ppds gir1.2-dbusmenu-glib-0.4
  gir1.2-javascriptcoregtk-3.0 gnome-icon-theme gnome-icon-theme-symbolic
  gstreamer1.0-clutter humanity-icon-theme indicator-application kdesudo
  kubuntu-notification-helper libao-common libao4 libappindicator1
  libappindicator3-1 libcairo-script-interpreter2 libcairo2-dev
  libclutter-1.0-0 libclutter-1.0-common libclutter-gst-2.0-0
  libclutter-gtk-1.0-0 libcogl-common libcogl-pango15 libcogl15
  libdbusmenu-gtk3-4 libfontconfig1-dev libfreetype6-dev libgmime-2.6-0
  libharfbuzz-dev libharfbuzz-gobject0 libindicator3-7 libindicator7
  libjson-glib-1.0-0 libjson-glib-1.0-common libnautilus-extension1a
  libpeas-common libperl4-corelibs-perl libpixman-1-dev libpng12-dev
  libtotem-plparser18 libxcb-shm0-dev libxcomposite-dev libxft-dev
  libzeitgeist-2.0-0 printer-driver-min12xxw python-defer python3-pykde4
  syslinux-legacy ubuntu-extras-keyring ubuntu-release-upgrader-qt
  x11proto-composite-dev
  ...
Following packages will be REMOVED:
  aptdaemon apturl-kde gir1.2-atk-1.0 gir1.2-dee-1.0 gir1.2-freedesktop
  gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gst-plugins-base-0.10
  gir1.2-gstreamer-0.10 gir1.2-gtk-2.0 gir1.2-gtk-3.0 gir1.2-pango-1.0
  gir1.2-peas-1.0 gir1.2-soup-2.4 gir1.2-totem-1.0 gir1.2-totem-plparser-1.0
  gir1.2-udisks-2.0 gir1.2-unity-5.0 gir1.2-vte-2.90 gir1.2-webkit-3.0
  kubuntu-desktop libatk1.0-dev libgdk-pixbuf2.0-dev libgirepository-1.0-1
  libgtk2.0-dev libgtkglext1-dev libmuonprivate2 libpango1.0-dev
  libpangox-1.0-dev libpeas-1.0-0 libtotem0 muon muon-discover muon-notifier
  muon-updater python-appindicator python-aptdaemon
  python-aptdaemon.gtk3widgets python-gi python-gi-cairo python-gobject
  python-gst0.10 python-indicate python3-aptdaemon
  python3-aptdaemon.gtk3widgets python3-gi software-properties-common
  software-properties-gtk software-properties-kde totem totem-mozilla
  totem-plugins ubuntu-release-upgrader-gtk update-manager update-notifier
  usb-creator-common
Following NEW packages will be installed:
  libgirepository-1.0-1:i386   

我有两个问题。

  1. 为什么 apt-get 认为它应该删除这么多软件包?我根本没有告诉它删除 totem。
  2. 下次apt-get出现类似上述的真正奇怪的情况时,我该如何自己弄清楚为什么 apt-get 的行为如此奇怪?

答案1

首先你应该知道这不是一个奇怪的行为,这是完全正确的,而你以某种方式要求采取这种行为!!

那么为什么会发生这种情况呢?

您想要安装libgirepository-1.0-1:i386,但是您已经有这个 libgirepository-1.0-164 位版本,所以这里系统要求您用这个 32 位替换 64 位。

这个替换会产生一些后果,如果你选择替换,这意味着系统将删除libgirepository-1.0-1并安装 32 位,因此这个库包将被删除,然后系统将删除依赖于它的其他应用程序,因为如果删除这个库,这些应用程序将不再可用。

例如为什么 totem 会被移除,我们先看看 totem 的依赖关系

$ apt-cache rdepends totem 
totem
Reverse Depends:
  totem:i386
  totem:i386
  libtotem0:i386
  libtotem-dev:i386
  gnome-settings-daemon:i386
  totem-plugins-extra
  ubuntu-desktop
  totem-plugins
  totem-mozilla
  totem-dbg
  totem
 |nautilus
  libtotem0
  libtotem-dev
  gnome-settings-daemon
  totem:i386
  totem:i386
  libtotem0:i386
  libtotem-dev:i386
  gnome-settings-daemon:i386
  ubuntustudio-desktop
  ubuntu-sugar-remix
 |tunapie
  totem-plugins-extra
  totem-plugins-dvb-daemon
  totem-plugin-arte
  totem-plugin-arte
  streamtuner2
  remuco-totem
  gnome-core
  ezgo-multimedia
  bombono-dvd
  ubuntu-desktop
  totem-plugins
  totem-mozilla
  totem-dbg
  totem
 |nautilus
  libtotem0
  libtotem-dev
  gnome-settings-daemon

正如你在上文中看到的,totem 依赖于libtotem0许多其他包,但是让我们以此包为例,现在如果你检查的依赖关系,libgirepository-1.0-1你也会看到libtotem0许多其他包,所以为了解释这个例子,如果你删除了libgirepository-1.0-1并且想要安装 32 位,那么你需要删除才能libtotem0安装它的 32 位,以便与libgirepository-1.0-132 位兼容,尽管你要删除 totem(即使你不是故意的)。

希望现在事情会变得明朗

相关内容