這個 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
我的問題有兩個。
- 為什麼 apt-get 認為它應該刪除這麼多軟體包?我根本沒有告訴它移除圖騰。
- 下次
apt-get
出現像上面這樣的非常奇怪的情況時,我怎麼能自己弄清楚為什麼 apt-get 看起來表現得如此奇怪?
答案1
首先你應該知道這不是一個奇怪的動作,這是完全正確的並且你有些要求這個動作!
那為什麼會發生這種情況呢?
你要安裝libgirepository-1.0-1:i386
,但你已經有這個
libgirepository-1.0-1
64位元版本,所以這裡系統要求你用這個32位元來取代64位元。
此替換會產生一些後果,如果您選擇替換這意味著系統將刪除libgirepository-1.0-1
並安裝32 位,因此當此lib 套件將被刪除時,系統將刪除依賴它的其他應用程序,因為這些應用程式將不再可用如果這個庫被刪除。
例如為什麼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 位元也與 32 位元相容libgirepository-1.0-1
,儘管您要刪除圖騰(即使您不是故意的)。
希望事情現在變得清楚