apt-get autoremove 可以删除系统文件吗?

Can apt-get autoremove remove system files?

我尝试在我的 Ubuntu 16.04.4 LTS 上安装 Python 3,在使用 apt 时我发现了这个:

The following packages were automatically installed and are no longer required:
  cabextract gcc-5-base:i386 gstreamer1.0-plugins-base:i386 libasn1-8-heimdal:i386 libasound2:i386 libasound2-plugins:i386 libasyncns0:i386
  libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libblosc1 libboost-filesystem1.58.0:i386 libboost-system1.58.0:i386
  libboost-wave1.58.0 libbsd0:i386 libcapi20-3 libcapi20-3:i386 libcapnp-0.5.3:i386 libcdparanoia0:i386 libcups2:i386 libdbus-1-3:i386
  libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libegl1-mesa:i386 libelf1:i386
  libexif12:i386 libexpat1:i386 libffi6:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libgbm1:i386 libgd3:i386
  libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglib2.0-0:i386 libglu1-mesa:i386 libgmp10:i386 libgnutls30:i386
  libgphoto2-6:i386 libgphoto2-port12:i386 libgsm1:i386 libgssapi-krb5-2:i386 libgssapi3-heimdal:i386 libgstreamer-plugins-base1.0-0:i386
  libgstreamer1.0-0:i386 libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386 libhogweed4:i386
  libhx509-5-heimdal:i386 libicu55:i386 libidn11:i386 libieee1284-3:i386 libjack-jackd2-0:i386 libjbig0:i386 libjpeg-turbo8:i386
  libjpeg8:i386 libjson-c2:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5support0:i386
  liblcms2-2:i386 libllvm6.0:i386 liblog4cplus-1.1-9 libltdl7:i386 libmirclient9:i386 libmircommon7:i386 libmircore1:i386
  libmirprotobuf3:i386 libmpg123-0:i386 libmspack0 libnettle6:i386 libodbc1 libodbc1:i386 libogg0:i386 libopenal1:i386 libopenimageio1.7
  libopenshadinglanguage1.8 libopensubdiv libopenvdb3.1 libopus0:i386 liborc-0.4-0:i386 libosmesa6 libosmesa6:i386 libp11-kit0:i386
  libpcap0.8:i386 libpciaccess0:i386 libpng12-0:i386 libprotobuf-lite9v5:i386 libpulse0:i386 libpython-all-dev libpython-dev libpython2.7-dev
  libpython3.6 libpython3.6-minimal libpython3.6-stdlib libroken18-heimdal:i386 libsamplerate0:i386 libsane:i386 libsasl2-modules:i386
  libsdl2-2.0-0 libsdl2-2.0-0:i386 libsensors4:i386 libsndfile1:i386 libsndio6.1 libsndio6.1:i386 libspeexdsp1:i386 libsqlite3-0:i386
  libssl1.0.0:i386 libstdc++6:i386 libtasn1-6:i386 libtheora0:i386 libtiff5:i386 libtxc-dxtn-s2tc0:i386 libusb-1.0-0:i386 libv4l-0:i386
  libv4lconvert0:i386 libvisual-0.4-0:i386 libvorbis0a:i386 libvorbisenc2:i386 libvpx3:i386 libvulkan1 libvulkan1:i386
  libwayland-client0:i386 libwayland-cursor0:i386 libwayland-egl1-mesa:i386 libwayland-server0:i386 libwind0-heimdal:i386 libwrap0:i386
  libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386
  libxcb-xfixes0:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386
  libxi6:i386 libxinerama1:i386 libxkbcommon0:i386 libxml2:i386 libxpm4:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386
  libxslt1.1:i386 libxss1:i386 libxxf86vm1:i386 linux-headers-4.13.0-45 linux-headers-4.13.0-45-generic linux-headers-4.15.0-24
  linux-headers-4.15.0-24-generic linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic linux-image-4.13.0-45-generic
  linux-image-4.15.0-24-generic linux-image-4.15.0-29-generic linux-image-extra-4.13.0-45-generic linux-modules-4.15.0-24-generic
  linux-modules-4.15.0-29-generic linux-modules-extra-4.15.0-24-generic linux-modules-extra-4.15.0-29-generic p7zip python-all python-all-dev
  python-dev python-wheel python2.7-dev python3-numpy
Use 'sudo apt autoremove' to remove them.

我可以 sudo apt autoremove 但我担心像 linux-image-4.15.0-29-generic 这样的包很重要,删除它后我的 Ubuntu 会被破坏。谁能说自动删除是否安全?

没有。 apt-get autoremove 只会删除任何已安装软件包未使用的文件。因为你需要的所有软件包都已安装 运行 你的系统 apt-get autoremove 不会删除任何重要的系统文件。

如果您需要 apt-get autoremove 中列出的软件包之一,您始终可以使用以下方法手动安装它:

apt-get install linux-image-4.15-0.29-generic

然后当您 运行 您的自动删除包将不再在列表中。

我注意到在有问题的文件中有一个内核文件。如果您想知道该特定版本的内核现在是否正在使用,请使用:

uname -a

它有可能删除您不想删除的内容。它只是从我的安装中删除了所有内容。甚至 gedit。

apt autoremove 只会删除不再需要的包。但是,您始终可以直接删除某些系统或实用程序包所依赖的包。在这种情况下,autoremove 将像裂变反应链一样工作,并一一删除所有内容。它发生在我身上。