apt-get install 导致所有软件包被删除

apt-get install 导致所有软件包被删除

我对此感到非常沮丧,我根本无法理解为什么会发生这种情况。我之所以如此沮丧,是因为有人使用我的 Teamspeak 服务器,而我目前正在度假,因此无法实际访问计算机。

无论如何,我尝试设置 IKE2 VPN,并尝试安装 Openswan。我的服务器正在运行 Kodibuntu(media center ubuntu 发行版),我使用 SSH 访问它。当我尝试安装 Openswan 时,我收到了一条消息

The following packages have unmet dependencies:
 openswan : Depends: iproute
E: Unable to correct problems, you have held broken packages.

因此我认为我只需安装iproute即可(请记住,我并不是 Linux 专业人士。)

我继续输入,

sudo apt-get install iproute

,希望它能够解决问题。

我收到了通常的消息;

Do you want to continue? [Y/n]

我快速按下Y回车键,才意识到我刚刚开始卸载系统上所有必需的软件包,然后在 Putty 中向上滚动,我发现:

The following NEW packages will be installed:
  cupsddk iproute libatm1 libdb5.1
0 upgraded, 4 newly installed, 138 to remove and 1 not upgraded.
Need to get 1,172 kB of archives.
After this operation, 685 MB disk space will be freed.

被删除的部分软件包如下:

- ubuntu-minimal 
- network-manager 
- network-manager-gnome
- kodibuntu-core
- openssh-server

现在我想知道,这怎么可能发生?——它为什么决定删除所有这些包?

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb attr bcrelay crda dconf-cli dkms dnsmasq-base
  dpkg-repack enchant evolution-data-server evolution-data-server-common
  evolution-data-server-online-accounts geoclue geoclue-ubuntu-geoip
  gir1.2-appindicator3-0.1 gir1.2-atk-1.0 gir1.2-freedesktop
  gir1.2-gdkpixbuf-2.0 gir1.2-gnomebluetooth-1.0 gir1.2-gtk-3.0
  gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-json-1.0
  gir1.2-packagekitglib-1.0 gir1.2-pango-1.0 gir1.2-soup-2.4
  gir1.2-timezonemap-1.0 gir1.2-vte-2.90 gir1.2-webkit-3.0 gir1.2-xkl-1.0
  gnome-accessibility-themes gnome-desktop3-data gnome-icon-theme-symbolic
  gnome-settings-daemon-schemas gnome-themes-standard
  gnome-themes-standard-data gnome-user-guide gsettings-ubuntu-schemas
  gstreamer1.0-plugins-good gstreamer1.0-x hunspell-en-us hwdata ibus ibus-gtk
  ibus-gtk3 im-config indicator-application indicator-keyboard iptables
  iputils-arping iw lib32gcc1 libaa1 libaccounts-glib0 libaccountsservice0
  libaio1 libappindicator3-1 libavahi-compat-libdnssd1 libavc1394-0 libc6-i386
  libcaca0 libcamel-1.2-45 libcuda1-304 libdbusmenu-glib4 libdbusmenu-gtk3-4
  libdebian-installer4 libdv4 libebackend-1.2-7 libebook-1.2-14
  libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20
  libedata-cal-1.2-23 libedataserver-1.2-18 libelfg0 libenchant1c2a libfs6
  libgdata-common libgdata13 libgee2 libgeoclue0 libglamor0 libglib2.0-bin
  libgnome-bluetooth11 libgnome-desktop-3-7 libgoa-1.0-0b libgoa-1.0-common
  libgweather-3-6 libgweather-common libharfbuzz-icu0 libhdb9-heimdal
  libhunspell-1.3-0 libibus-1.0-5 libical1 libiceutil35 libido3-0.1-0
  libiec61883-0 libindicator3-7 libjavascriptcoregtk-3.0-0 libjson-glib-1.0-0
  libjson-glib-1.0-common libkdc2-heimdal liblightdm-gobject-1-0 libmm-glib0
  libmnl0 libmtdev1 libnetfilter-conntrack3 libnfnetlink0 libnl-3-200
  libnl-genl-3-200 libnl-route-3-200 libnm-glib-vpn1 libnm-glib4
  libnm-gtk-common libnm-gtk0 libnm-util2 liboauth0 libpackagekit-glib2-16
  libprotobuf8 libpulse-mainloop-glib0 libqt4-dbus libqt4-network libqt4-sql
  libqt4-sql-mysql libqt4-sql-sqlite libqt4-xml libqtcore4 libqtdbus4
  libreadline5 librest-0.7-0 libsgutils2-2 libshout3 libsignon-glib1
  libsoup-gnome2.4-1 libtimezonemap1 libupower-glib1 liburl-dispatcher1
  libwacom-common libwacom2 libwavpack1 libwebkitgtk-3.0-0
  libwebkitgtk-3.0-common libxatracker2 libxkbfile1 libxklavier16 libxvmc1
  libyelp0 libzeroc-ice35 lightdm-gtk-greeter linux-headers-generic
  lubuntu-icon-theme mobile-broadband-provider-info nautilus-data
  nvidia-libopencl1-304 nvidia-opencl-icd-304 obexd-client python-dnspython
  python3-aptdaemon.pkcompat python3-cairo python3-gi-cairo python3-icu
  python3-pam python3-xkit qdbus qtchooser qtcore4-l10n rdate
  samba-dsdb-modules samba-vfs-modules sbsigntool tdb-tools
  ttf-ubuntu-font-family ubiquity-ubuntu-artwork unity-greeter usbutils
  wireless-regdb x11-apps x11-session-utils x11-xfs-utils x11-xkb-utils
  xfonts-base xfonts-scalable xinit xinput xserver-common yelp yelp-xsl zenity
  zenity-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  cupsddk libatm1 libdb5.1
Suggested packages:
  iproute-doc
The following packages will be REMOVED:
  accountsservice alsa-base aptdaemon avahi-daemon bluez bluez-alsa bluez-cups
  colord console-setup consolekit cron cryptsetup cryptsetup-bin cups
  cups-core-drivers cups-daemon dbus dbus-x11 dmraid dmsetup eject gconf2 gcr
  gnome-bluetooth gnome-keyring gnome-power-manager gnome-screensaver
  gnome-user-share grub-common grub-gfxpayload-lists grub-pc grub-pc-bin
  grub2-common gvfs gvfs-backends gvfs-daemons gvfs-fuse hplip ifupdown
  indicator-datetime indicator-power indicator-session initramfs-tools
  initscripts iproute2 isc-dhcp-client kbd kodibuntu-core
  kodibuntu-default-session kodibuntu-default-settings kodibuntu-initscripts
  kodibuntu-live-settings kpartx kpartx-boot language-selector-common
  libcryptsetup4 libdevmapper-event1.02.1 libdevmapper1.02.1
  libdmraid1.0.0.rc16 liblvm2app2.2 libnss-mdns libpam-systemd
  libparted0debian1 lightdm linux-generic linux-image-3.13.0-43-generic
  linux-image-3.13.0-52-generic linux-image-extra-3.13.0-43-generic
  linux-image-extra-3.13.0-52-generic linux-image-generic lubuntu-core
  lubuntu-default-settings lvm2 lxsession lxsession-logout mountall
  network-manager network-manager-gnome network-manager-pptp
  network-manager-pptp-gnome nfs-common nvidia-304 nvidia-current
  nvidia-settings openssh-server parted plymouth plymouth-label
  plymouth-theme-kodibuntu-animated-logo plymouth-theme-kodibuntu-logo
  plymouth-theme-kodibuntu-text plymouth-theme-lubuntu-logo
  plymouth-theme-lubuntu-text plymouth-x11 policykit-1 ppp pptp-linux
  printer-driver-gutenprint printer-driver-hpcups printer-driver-postscript-hp
  printer-driver-splix procps resolvconf rpcbind rsyslog samba
  screen-resolution-extra systemd-services ubiquity ubiquity-frontend-gtk
  ubuntu-drivers-common ubuntu-minimal udev udisks udisks2
  unity-settings-daemon upower upstart ureadahead watershed wpasupplicant xorg
  xserver-xorg xserver-xorg-core xserver-xorg-input-all
  xserver-xorg-input-evdev xserver-xorg-input-mouse
  xserver-xorg-input-synaptics xserver-xorg-input-vmmouse
  xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-glamoregl
  xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-r128
  xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware
The following NEW packages will be installed:
  cupsddk iproute libatm1 libdb5.1
0 upgraded, 4 newly installed, 138 to remove and 1 not upgraded.
Need to get 1,172 kB of archives.
After this operation, 685 MB disk space will be freed.

答案1

我对这个 Ubuntu 发行版不熟悉...但是,您可以查看 .bash_history(sp?) 中是否有其他有权更改您服务器的人。如果您在最后输入“N”,另一个选择是尝试运行 apt-get -f install,看看是否有帮助。该命令“应该”可以解决您的损坏软件包问题。

答案2

我认为这与您安装 iproute 的时间无关。根据我的经验,唯一一次像这样删除大量软件包的情况是当您删除链接到元软件包的软件包时。例如,如果您删除 Evolution,它会删除一大堆 gnome 内容,因为 gnome 内容是 Evolution 的依赖项,通过删除它,您告诉软件包管理器您不再需要这些依赖项。

解决此问题的唯一方法是访问机器。我认为查看 bash 历史记录是一个不错的开始。查找之前删除的其他软件包。

另外,当您看到此消息时:

0 upgraded, 4 newly installed, 138 to remove and 1 not upgraded.

您应该立即停止并开始排除故障。Apt 告诉您它即将删除 138 个软件包,apt 就是这么做的。

答案3

  • 我不同意 levlaz 的回答,当元包被删除时,相关包会列在automatically installed and are no longer required列表。除非您明确运行以删除它们,否则 APT 不会强迫您删除它们apt-get autoremove

  • 据我所知,这看起来像是一个软件包版本或软件包体系结构冲突:

    The following NEW packages will be installed:
      cupsddk iproute libatm1 libdb5.1
    

    在包中寻找类似的已移除,我只看到iproute2。(注意:如果是包架构冲突,我们会在中找到相同的包名称,例如iproute已移除列表,但事实并非如此)

    嗯,这不应该发生。与 Trusty 和更高版本一样iprouteiproute2 的过渡虚拟包

    这是一个过渡性虚拟包,用于让升级系统安装 iproute2 包。一旦没有其他包依赖它,就可以安全地将其删除。

    这里当前 Ubuntu 版本的iproute/软件包。iproute2

  • 可能你iproute从 PPA 中获取了旧版本或不良版本。请参阅 iproute2 的控制文件

    Package: iproute2
    Version: 3.12.0-2
    Architecture: amd64
    ...
    Depends: libc6 (>= 2.14), libdb5.3
    Recommends: libatm1 (>= 2.4.1-17~), libxtables10
    Suggests: iproute2-doc
    Conflicts: arpd, iproute (<< 20130000-1)
    Replaces: iproute
    

    查看apt-cache policy iproute iproute2

相关内容