为什么删除几个模块会删除很多包?

为什么删除几个模块会删除很多包?

我运行了以下命令:

sudo apt-get remove postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

为什么该命令会执行以下操作以及撤消它的最佳方法是什么?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  couchdb-common erlang-asn1 erlang-base-hipe erlang-crypto erlang-eunit
  erlang-inets erlang-mnesia erlang-os-mon erlang-public-key
  erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tools
  erlang-webtool erlang-xmerl gtk2-engines libbit-vector-perl
  libcarp-clan-perl libclass-data-inheritable-perl
  libclass-method-modifiers-perl libcommon-sense-perl
  libcrypt-openssl-bignum-perl libcrypt-openssl-rsa-perl libdata-random-perl
  libdate-calc-perl libdate-calc-xs-perl libenet2a libextutils-depends-perl
  libextutils-pkgconfig-perl libgd-perl libgnome2-canvas-perl
  libgnome2-wnck-perl libgoo-canvas-perl libgoocanvas-common libgoocanvas3
  libgtk2-appindicator-perl libgtk2-imageview-perl libgtk2-unique-perl
  libgtkimageview0 libhttp-server-simple-perl libjs-prototype
  libjs-scriptaculous libjson-perl libjson-xs-perl libmouse-perl
  libmozjs185-1.0 libpath-class-perl libproc-processtable-perl
  libproc-simple-perl libsctp1 libsort-naturally-perl libtie-ixhash-perl
  libunique-1.0-0 libx11-protocol-perl libxml-xpathengine-perl lksctp-tools
  perlmagick supertuxkart-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libxml-libxml-perl
The following packages will be REMOVED
  account-plugin-aim account-plugin-yahoo aisleriot apt-transport-https apturl
  atom ca-certificates checkbox-gui checkbox-ng checkbox-ng-service
  chromium-browser chromium-browser-l10n compiz compiz-gnome couchdb
  couchdb-bin curl darktable deja-dup-backend-gvfs evolution-data-server
  gconf-service gconf-service-backend gconf2 gir1.2-gdata-0.0 git
  gnome-contacts gnome-terminal gnome-terminal-data gnome-user-share
  gstreamer0.10-plugins-bad gstreamer1.0-plugins-bad gvfs-backends
  indicator-applet kerneloops-daemon libbonoboui2-0 libcmis-0.4-4 libcurl3
  libcurl3-gnutls libflickcurl0 libfolks-eds25 libgconf2-4 libgdata13
  libgnome2-0 libgnome2-bin libgnome2-common libgnome2-gconf-perl
  libgnome2-perl libgnome2-vfs-perl libgnomeui-0 libgnomevfs2-0
  libgnomevfs2-common libgnomevfs2-extra libldap-2.4-2 libldb1
  liblwp-protocol-https-perl libmailutils4 libnet-dbus-perl
  libnet-dropbox-api-perl libnet-oauth-perl liboauth0 libpanel-applet-4-0
  libpurple0 libraptor2-0 librasqal3 librdf0
  libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc
  libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk
  libreoffice-help-en-us libreoffice-impress libreoffice-math
  libreoffice-ogltrans libreoffice-pdfimport
  libreoffice-presentation-minimizer libreoffice-writer libruby1.9.1
  libsasl2-2 libsasl2-modules libslv2-9 libsmbclient libspice-server1
  libwww-mechanize-perl libwww-perl libxml-parser-perl libxml-sax-expat-perl
  libxml-twig-perl mailutils mythes-en-us nautilus-share network-manager-gnome
  oneconf oneconf-common postfix python-cupshelpers python-gconf python-gnome2
  python-httplib2 python-ldb python-oneconf python-piston-mini-client
  python-pycurl python-requests python-samba python-smbc
  python-ubuntu-sso-client python3-checkbox-ng python3-httplib2
  python3-oneconf python3-piston-mini-client python3-pycurl python3-requests
  python3-software-properties python3-uno redshift ruby ruby1.9.1
  samba-common-bin samba-libs seahorse shutter smbclient software-center
  software-center-aptdaemon-plugins software-properties-common
  software-properties-gtk spotify-client steam-launcher supertuxkart
  system-config-printer-common system-config-printer-gnome
  system-config-printer-udev telepathy-haze transmission-gtk ubuntu-desktop
  ubuntu-sso-client ubuntu-sso-client-qt unity unity-lens-photos
  unity-scope-gdrive unity-scope-musicstores vlc vlc-nox vlc-plugin-notify
  vlc-plugin-pulse whoopsie xserver-xorg-video-all xserver-xorg-video-qxl
The following NEW packages will be installed
  libxml-libxml-perl
0 to upgrade, 1 to newly install, 151 to remove and 9 not to upgrade.
Need to get 337 kB of archives.
After this operation, 1,072 MB disk space will be freed.
Do you want to continue? [Y/n]

答案1

依赖项

许多这样的软件包依赖于一个名为的软件包ubuntu-desktop

现在您尚未选择删除它 - 它不在此列表中:

postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

但请注意包装ca-certificates

我运行了这个命令:

apt-cache rdepends postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

它返回一个列表,如下所示:

postfix
Reverse Depends:
 |ubumirror
  postfix-policyd-spf-python
  postfix:i386
  ...
mailutils
Reverse Depends:
  heirloom-mailx:i386
  bsd-mailx:i386
  ...
libsasl2-2
Reverse Depends:
  libvirt0
  libvirt-bin
  mutt-patched
  libkmanagesieve4
  libkldap4
  libkimap4
  ...
ca-certificates
Reverse Depends:
  google-chrome-unstable
  google-chrome-stable
  google-chrome-beta
  ubuntu-touch
  ...
  ubuntu-desktop
  ...
libsasl2-modules
Reverse Depends:
  xubuntu-desktop
  ubuntustudio-desktop
  ubuntu-gnome-desktop
  sendmail-bin
  ...

ca-certificates在这里很重要,因为ubuntu-desktop取决于它。

很多东西都需要ubuntu-desktop。很多。如果你移除它们,很多东西都会损坏 - 所以不要移除它们。如果必须移除,请不要移除ca-certificates- 你为什么要这么做?

答案2

这是因为删除其中一些包会破坏其他包的依赖关系。

你最好不要同意删除该内容。

如果你已经删除了所有内容,你可以通过以下方式恢复

sudo apt-get install ubuntu-desktop

但没有人能保证一切都能恢复。

您可以查看/var/log/apt/history.log已删除的内容。然后安装缺失的软件包。

ubuntu-desktop即使不是全部,也应该撤掉大部分。

根据您的具体情况不要删除ca 证书

相关内容