Wednesday, January 5, 2022

[SOLVED] Can apt-get autoremove remove system files?

Issue

I tried to install Python 3 on my Ubuntu 16.04.4 LTS and while using apt i found this:

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.

I can do sudo apt autoremove but i fear that packages like linux-image-4.15.0-29-generic are important and after deleting it my Ubuntu will be broken. Who can say is it safe to do autoremove?


Solution

No. apt-get autoremove will only remove files which are not in use by any installed package. Since all the packages you need to run your system have been installed apt-get autoremove will not remove any important system file.

If you require one of the package listed in the apt-get autoremove, you can always install it manually using:

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

Then when you run your autoremove the package will no longer be in the list.

I noticed that among the files in question there was a kernel file. If you want to know if that particular version of the kernel is in use right now, use:

uname -a


Answered By - ekscrypto