删除 mysql-common 会删除一些不相关的包

删除 mysql-common 会删除一些不相关的包
$ sudo apt remove mysql-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-client' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  ant ant-optional blender-data colord-data dialign digikam-data emboss-data fonts-dejavu gdal-data gir1.2-gst-plugins-bad-1.0 hplip-data java-wrappers libactivation-java
  libaec0 libaopalliance-java libapache-pom-java libargs4j-java libarmadillo9 libarpack2 libasm-java libastro1 libatinject-jsr330-api-java libavresample-dev libbarclay-java
  libbatik-java libbiojava-java libbiojava1.7-java libblas-dev libblosc1 libbytecode-java libbz2-dev libcaf-openmpi-3 libcdi-api-java libcglib-java libcharls2
  libcoarrays-openmpi-dev libcodemodel-java libcolorhug2 libcommons-cli-java libcommons-codec-java libcommons-collections3-java libcommons-compress-java libcommons-dbcp-java
  libcommons-io-java libcommons-jexl2-java libcommons-lang3-java libcommons-logging-java libcommons-math3-java libcommons-net-java libcommons-parent-java libcommons-pool-java
  libcurl3-gnutls:i386 libdap25 libdapclient6v5 libdc1394-22-dev libdcmtk14 libdom4j-java libdtd-parser-java libepsilon1 libexif-dev libexif-doc libfabric1
  libfastinfoset-java libfreemarker-java libfreexl1 libfyba0 libgatk-native-bindings-java libgdbm-compat4:i386 libgdbm6:i386 libgdcm-dev libgdcm3.0 libgeos-3.8.0 libgeos-c1v5
  libgeotiff5 libgeronimo-annotation-1.3-spec-java libgeronimo-interceptor-3.0-spec-java libgkl-java libgkl-jni libgl2ps1.4 libgoogle-gson-java libgphoto2-dev
  libgraphicsmagick++-q16-12 libgraphicsmagick-q16-3 libgstreamer-opencv1.0-0 libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-good1.0-dev libguava-java libguice-java
  libhawtjni-runtime-java libhdf4-0-alt libhdf5-103 libhdf5-openmpi-103 libhpdf-2.3.0 libhsqldb-java libhtml-template-perl libhtsjdk-java libhttpclient-java libhttpcore-java
  libhwloc-dev libhwloc-plugins libhwloc15 libibatis-java libibverbs-dev libieee1284-3 libieee1284-3:i386 libilmbase-dev libistack-commons-java libj2ssh-java libjansi-java
  libjansi-native-java libjaxb-api-java libjaxb-java libjaxen-java libjemalloc2 libjoptsimple-java libjsoup-java libjsr305-java libkf5akonadi-data libkf5akonadicontact-data
  libkf5akonadicontact5abi1 libkf5akonadicore-bin libkf5akonadicore5abi2 libkf5akonadiprivate5abi2 libkf5akonadiwidgets5abi1 libkf5calendarcore5abi2 libkf5contacteditor5
  libkf5mime-data libkf5mime5abi2 libkf5sane-data libkmlbase1 libkmldom1 libkmlengine1 liblapack-dev liblensfun-data-v1 liblensfun1 liblightcouch-java liblog4j1.2-java
  liblog4j2-java libmarblewidget-qt5-28 libmaven-file-management-java libmaven-parent-java libmaven-resolver-java libmaven-shared-io-java libmaven-shared-utils-java
  libmaven3-core-java libmecab2 libmongodb-java libnetcdf-c++4 libnetcdf15 libnghttp2-14:i386 libngs-java libngs-sdk-dev libngs-sdk2 libnl-3-dev libnl-route-3-dev libnuma-dev
  libogdi4.1 libopencv-core-dev libopencv-core4.2 libopencv-dnn-dev libopencv-dnn4.2 libopencv-flann-dev libopencv-flann4.2 libopencv-imgproc-dev libopencv-imgproc4.2
  libopencv-ml-dev libopencv-ml4.2 libopencv-photo-dev libopencv-photo4.2 libopencv-ts-dev libopencv-viz-dev libopencv-viz4.2 libopenexr-dev libopenmpi-dev libopenmpi3
  libopenvdb6.2 libosdcpu3.4.0 libosdgpu3.4.0 libpci3:i386 libperl5.30:i386 libpicard-java libplexus-archiver-java libplexus-cipher-java libplexus-classworlds-java
  libplexus-component-annotations-java libplexus-interpolation-java libplexus-io-java libplexus-sec-dispatcher-java libplexus-utils2-java libpmix2 libpostgresql-jdbc-java
  libpq5 libproj15 libprotobuf17 libpsm-infinipath1 libpsm2-2 libqhull7 libqtav1 libqtavwidgets1 libraw1394-dev libraw1394-tools librcc0 librcd0 libreadline-dev
  librelaxng-datatype-java librngom-java librtmp1:i386 libsane-common libservlet-api-java libshp2 libsidutils0 libsisu-guice-java libsisu-inject-java libsisu-ioc-java
  libsisu-plexus-java libslf4j-java libsnappy-java libsnappy-jni libsnmp-base libsocket++1 libspatialite7 libspnav0 libsquish0 libssh-4:i386 libstax-ex-java
  libstreambuffer-java libsuperlu5 libsz2 libtagc0 libtbb-dev libtbb2 libtxw2-java liburiparser1 libvtk6.3 libwagon-http-java libwagon-provider-api-java libx32gcc1
  libxerces-c3.2 libxmlgraphics-commons-java libxnvctrl0 libxsom-java libxz-java marble-plugins marble-qt-data mecab-ipadic mecab-ipadic-utf8 mecab-utils
  mysql-client-core-8.0 mysql-server-core-8.0 odbcinst odbcinst1debian2 opencv-data openmpi-bin openmpi-common primer3 printer-driver-postscript-hp proj-bin proj-data
  python3-numpy python3-renderpm python3-reportlab python3-reportlab-accel r-base-core r-base-dev r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign
  r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-doc-html r-recommended
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  artemis* blender* colord* digikam* digikam-private-libs* emboss* emboss-lib* hplip* jemboss* kolourpaint* libgdal26* libhpmud0* libkf5sane5* libmysqlclient21*
  libopencv-calib3d4.2* libopencv-contrib4.2* libopencv-features2d4.2* libopencv-highgui4.2* libopencv-imgcodecs4.2* libopencv-objdetect4.2* libopencv-shape4.2*
  libopencv-stitching4.2* libopencv-superres4.2* libopencv-video4.2* libopencv-videoio4.2* libopencv-videostab4.2* libopenimageio2.1* libqt5sql5-mysql* libsane*
  libsane-hpaio* libsnmp35* mysql-client-8.0* mysql-common* printer-driver-hpcups* python3-opencv* sane-utils*
0 upgraded, 0 newly installed, 36 to remove and 0 not upgraded.
After this operation, 275 MB disk space will be freed.
Do you want to continue? [Y/n]

如何在不删除以上所有内容的情况下删除该包?

答案1

有一种东西叫做依赖。当你安装一个软件时,它可能会依赖其他一些额外的软件包来提供一些系统调用或一些服务。当你删除这个软件时,任何软件都不再需要这些额外的软件包,那么删除这些软件包也是安全的。

在你的情况下,当它说 时following packages were automatically installed,这意味着这些是我之前提到的额外软件包。因此,当你安装软件时,如果其依赖项尚不存在,它将安装依赖项automatically,而这些依赖项就是那些自动安装的软件包。

因此,一旦您删除了主软件,就不再需要自动安装的软件包。可以使用 删除这些软件包sudo apt autoremove。过去,您可能安装了一个需要unrelated您提到的这些软件包的软件,但可能没有运行sudo apt autoremove,因此现在显示这些软件包,因为它们已automatically安装但未automatically删除/卸载。您必须手动执行此操作。

无论如何,按照内核的说法,删除这些包是完全安全的。

只需运行sudo apt autoremove即可将其删除。

相关内容