我使用 KDE 安装了 Debian 9。当我尝试删除、安装或升级软件包时,我收到以下消息:
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
baloo-kf5 ca-certificates-java coinor-libcbc3
coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5 coinor-libcoinutils3v5
coinor-libosi1v5 default-java-plugin default-jre default-jre-headless
dolphin dolphin4 fonts-crosextra-caladea fonts-crosextra-carlito
fonts-lato fonts-linuxlibertine fonts-opensymbol fonts-sil-gentium
fonts-sil-gentium-basic gir1.2-atspi-2.0 gir1.2-wnck-3.0 gnome-orca
hyphen-en-us icedtea-8-plugin icedtea-netx icedtea-netx-common
java-common kaccessible kde-baseapps-bin kde-baseapps-data kde-icons-mono
kdeaccessibility kdepasswd kdesudo kfind kmag kmousetool kpart-webkit
libabw-0.1-1 libatk-adaptor libatk-wrapper-java libatk-wrapper-java-jni
libboost-date-time1.62.0 libboost-filesystem1.62.0
libboost-iostreams1.62.0 libbrlapi0.6 libcdr-0.1-1 libcgi-fast-perl
libcgi-pm-perl libclass-accessor-perl libclucene-contribs1v5
libcmis-0.5-5v5 libcwidget3v5 libdolphinvcs5 libe-book-0.1-1 libeot0
libetonyek-0.1-1 libexttextcat-2.0-0 libexttextcat-data libfcgi-perl
libfreehand-0.1-1 libgltf-0.0-0v5 libharfbuzz-icu0 libhsqldb1.8.0-java
libhyphen0 libio-string-perl libjpeg-turbo-progs libkabc4
libkf5baloowidgets-bin libkf5baloowidgets5 libkldap4 libkmime4
libknewstuff2-4 libkonq-common libkonq5-templates libkonq5abi1
libkonqsidebarplugin4a libkopete4 libkpimidentities4 libkpimtextedit4
libkpimutils4 libkresources4 liblangtag-common liblangtag1 liblouis-data
liblouis12 libmediastreamer-base3 libmspub-0.1-1 libmwaw-0.3-3
libmythes-1.2-0 libodfgen-0.1-1 liborcus-0.11-0 libortp9
libpagemaker-0.0-0 libparse-debianchangelog-perl libqaccessibilityclient0
libqca2-plugin-ossl libreoffice libreoffice-avmedia-backend-gstreamer
libreoffice-base libreoffice-base-core libreoffice-base-drivers
libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw
libreoffice-help-en-us libreoffice-impress libreoffice-java-common
libreoffice-kde libreoffice-math libreoffice-report-builder-bin
libreoffice-sdbc-hsqldb libreoffice-style-galaxy libreoffice-writer
librevenge-0.0-0 libruby2.3 libservlet3.1-java libsigc++-2.0-0v5
libsub-name-perl libtidy5 libturbojpeg0 libvisio-0.1-1 libwnck-3-0
libwnck-3-common libwpd-0.10-10 libwpg-0.3-3 libwps-0.4-4 libxres1
lp-solve mythes-en-us openjdk-8-jre openjdk-8-jre-headless python3-brlapi
python3-louis python3-pyatspi python3-speechd python3-uno rake ruby
ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert
ruby-test-unit ruby2.3 rubygems-integration uno-libs3 ure xbrlapi
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
我该如何解决这个问题?
答案1
你没有问题。
跑步
apt-get --purge autoremove
apt 将删除所有列出的软件包。
正如消息所说,不再需要这些包了。这--purge
是完全可选的,但在我看来通常是很好的做法。它从系统中删除所有包文件,包括配置文件。
答案2
APT 将已安装的软件包分类为自动安装或手动安装。如果某个软件包被标记为自动安装,并且没有手动安装的软件包依赖于该软件包,则该软件包将被自动删除。
如果您不直接使用某个软件包,最好将其标记为自动安装。最大的好处是如果用不同名称的包替换该包,升级会更顺利。特别是,库应始终标记为自动安装,除非它们由手动安装的可执行文件使用。大型应用程序通常会被分割成多个包,并且分割会不时发生变化,因此最好只保留您想要手动安装的主包和可选功能,让其余的自动管理。例如,保持libreoffice
手动安装并让其他软件包自动安装。
但是,如果您使用软件包,则需要将它们标记为手动安装。通常,这种情况会自动发生,因为任何安装软件包的显式请求都会将其标记为手动安装,例如或 GUI 等效安装。apt-get install PACKAGE
使用该命令apt-mark
操作自动/手动包数据库。声明为自动安装,声明为手动安装。apt-mark auto PACKAGE
PACKAGE
apt-mark manual PACKAGE
PACKAGE
运行apt-get autoremove
以删除任何手动安装的软件包不需要的所有软件包。您会收到确认提示,因此如果这仍然删除您想要保留的内容,请取消并声明更多软件包为手动安装。