我对 Linux 还很陌生,但在使用它之前,我听说 Windows 程序在卸载后会在硬盘上留下很多残留物,而 Linux 会删除所有残留物。
我使用的是 Ubuntu 10.04。要卸载软件包,我使用sudo apt-get autoremove application_name
或sudo aptitude purge application_name
。最近我安装了 texlive-full,出于某些原因,我不得不快速卸载它。在我进入终端 之后updatedb
,然后locate *texlive*
输出很长:
maria@marysia-ubuntu:~$ locate *texlive*
/etc/texmf/fmt.d/10texlive-base.cnf
/etc/texmf/fmt.d/10texlive-formats-extra.cnf
/etc/texmf/fmt.d/10texlive-lang-cyrillic.cnf
/etc/texmf/fmt.d/10texlive-lang-czechslovak.cnf
/etc/texmf/fmt.d/10texlive-lang-polish.cnf
/etc/texmf/fmt.d/10texlive-latex-base.cnf
/etc/texmf/fmt.d/10texlive-math-extra.cnf
/etc/texmf/fmt.d/10texlive-metapost.cnf
/etc/texmf/fmt.d/10texlive-omega.cnf
/etc/texmf/fmt.d/10texlive-xetex.cnf
/etc/texmf/hyphen.d/09texlive-base.cnf
/etc/texmf/hyphen.d/10texlive-lang-arabic.cnf
/etc/texmf/hyphen.d/10texlive-lang-croatian.cnf
/etc/texmf/hyphen.d/10texlive-lang-cyrillic.cnf
/etc/texmf/hyphen.d/10texlive-lang-czechslovak.cnf
/etc/texmf/hyphen.d/10texlive-lang-danish.cnf
/etc/texmf/hyphen.d/10texlive-lang-dutch.cnf
/etc/texmf/hyphen.d/10texlive-lang-finnish.cnf
/etc/texmf/hyphen.d/10texlive-lang-french.cnf
/etc/texmf/hyphen.d/10texlive-lang-german.cnf
/etc/texmf/hyphen.d/10texlive-lang-greek.cnf
/etc/texmf/hyphen.d/10texlive-lang-hungarian.cnf
/etc/texmf/hyphen.d/10texlive-lang-indic.cnf
/etc/texmf/hyphen.d/10texlive-lang-italian.cnf
/etc/texmf/hyphen.d/10texlive-lang-latin.cnf
/etc/texmf/hyphen.d/10texlive-lang-latvian.cnf
/etc/texmf/hyphen.d/10texlive-lang-lithuanian.cnf
/etc/texmf/hyphen.d/10texlive-lang-mongolian.cnf
/etc/texmf/hyphen.d/10texlive-lang-norwegian.cnf
/etc/texmf/hyphen.d/10texlive-lang-other.cnf
/etc/texmf/hyphen.d/10texlive-lang-polish.cnf
/etc/texmf/hyphen.d/10texlive-lang-portuguese.cnf
/etc/texmf/hyphen.d/10texlive-lang-spanish.cnf
/etc/texmf/hyphen.d/10texlive-lang-swedish.cnf
/etc/texmf/hyphen.d/10texlive-lang-ukenglish.cnf
/etc/texmf/updmap.d/10texlive-base.cfg
/etc/texmf/updmap.d/10texlive-fonts-extra.cfg
/etc/texmf/updmap.d/10texlive-fonts-recommended.cfg
/etc/texmf/updmap.d/10texlive-games.cfg
/etc/texmf/updmap.d/10texlive-lang-african.cfg
/etc/texmf/updmap.d/10texlive-lang-arabic.cfg
/etc/texmf/updmap.d/10texlive-lang-cyrillic.cfg
/etc/texmf/updmap.d/10texlive-lang-czechslovak.cfg
/etc/texmf/updmap.d/10texlive-lang-french.cfg
/etc/texmf/updmap.d/10texlive-lang-greek.cfg
/etc/texmf/updmap.d/10texlive-lang-hebrew.cfg
/etc/texmf/updmap.d/10texlive-lang-indic.cfg
/etc/texmf/updmap.d/10texlive-lang-lithuanian.cfg
/etc/texmf/updmap.d/10texlive-lang-mongolian.cfg
/etc/texmf/updmap.d/10texlive-lang-polish.cfg
/etc/texmf/updmap.d/10texlive-lang-vietnamese.cfg
/etc/texmf/updmap.d/10texlive-latex-base.cfg
/etc/texmf/updmap.d/10texlive-latex-extra.cfg
/etc/texmf/updmap.d/10texlive-math-extra.cfg
/etc/texmf/updmap.d/10texlive-omega.cfg
/etc/texmf/updmap.d/10texlive-pictures.cfg
/etc/texmf/updmap.d/10texlive-science.cfg
/var/cache/apt/archives/texlive-base_2009-7_all.deb
/var/cache/apt/archives/texlive-bibtex-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-binaries_2009-5ubuntu0.2_i386.deb
/var/cache/apt/archives/texlive-common_2009-7_all.deb
/var/cache/apt/archives/texlive-doc-base_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-bg_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-cs+sk_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-de_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-en_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-es_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-fi_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-fr_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-it_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-ja_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-ko_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-mn_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-nl_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-pl_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-pt_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-ru_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-si_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-th_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-tr_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-uk_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-vi_2009-2_all.deb
/var/cache/apt/archives/texlive-doc-zh_2009-2_all.deb
/var/cache/apt/archives/texlive-extra-utils_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-font-utils_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-fonts-extra-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-fonts-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-fonts-recommended-doc_2009-7_all.deb
/var/cache/apt/archives/texlive-fonts-recommended_2009-7_all.deb
/var/cache/apt/archives/texlive-formats-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-full_2009-7_all.deb
/var/cache/apt/archives/texlive-games_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-generic-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-generic-recommended_2009-7_all.deb
/var/cache/apt/archives/texlive-humanities-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-humanities_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-lang-african_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-arabic_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-armenian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-croatian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-cyrillic_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-czechslovak_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-danish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-dutch_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-finnish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-french_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-german_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-greek_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-hebrew_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-hungarian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-indic_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-italian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-latin_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-latvian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-lithuanian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-mongolian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-norwegian_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-other_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-polish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-portuguese_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-spanish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-swedish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-tibetan_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-ukenglish_2009-3_all.deb
/var/cache/apt/archives/texlive-lang-vietnamese_2009-3_all.deb
/var/cache/apt/archives/texlive-latex-base-doc_2009-7_all.deb
/var/cache/apt/archives/texlive-latex-base_2009-7_all.deb
/var/cache/apt/archives/texlive-latex-extra-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-latex-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-latex-recommended-doc_2009-7_all.deb
/var/cache/apt/archives/texlive-latex-recommended_2009-7_all.deb
/var/cache/apt/archives/texlive-latex3_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-luatex_2009-7_all.deb
/var/cache/apt/archives/texlive-math-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-metapost-doc_2009-7_all.deb
/var/cache/apt/archives/texlive-metapost_2009-7_all.deb
/var/cache/apt/archives/texlive-music_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-omega_2009-7_all.deb
/var/cache/apt/archives/texlive-pictures-doc_2009-7_all.deb
/var/cache/apt/archives/texlive-pictures_2009-7_all.deb
/var/cache/apt/archives/texlive-plain-extra_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-pstricks-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-pstricks_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-publishers-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-publishers_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-science-doc_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-science_2009-7ubuntu3_all.deb
/var/cache/apt/archives/texlive-xetex_2009-7_all.deb
/var/cache/apt/archives/texlive_2009-7_all.deb
/var/lib/dpkg/info/texlive-base.list
/var/lib/dpkg/info/texlive-base.postrm
/var/lib/dpkg/info/texlive-bibtex-extra.list
/var/lib/dpkg/info/texlive-bibtex-extra.postrm
/var/lib/dpkg/info/texlive-doc-base.list
/var/lib/dpkg/info/texlive-doc-base.postrm
/var/lib/dpkg/info/texlive-doc-bg.list
/var/lib/dpkg/info/texlive-doc-bg.postrm
/var/lib/dpkg/info/texlive-doc-cs+sk.list
/var/lib/dpkg/info/texlive-doc-cs+sk.postrm
/var/lib/dpkg/info/texlive-doc-de.list
/var/lib/dpkg/info/texlive-doc-de.postrm
/var/lib/dpkg/info/texlive-doc-en.list
/var/lib/dpkg/info/texlive-doc-en.postrm
/var/lib/dpkg/info/texlive-doc-es.list
/var/lib/dpkg/info/texlive-doc-es.postrm
/var/lib/dpkg/info/texlive-doc-fi.list
/var/lib/dpkg/info/texlive-doc-fi.postrm
/var/lib/dpkg/info/texlive-doc-fr.list
/var/lib/dpkg/info/texlive-doc-fr.postrm
/var/lib/dpkg/info/texlive-doc-it.list
/var/lib/dpkg/info/texlive-doc-it.postrm
/var/lib/dpkg/info/texlive-doc-ja.list
/var/lib/dpkg/info/texlive-doc-ja.postrm
/var/lib/dpkg/info/texlive-doc-ko.list
/var/lib/dpkg/info/texlive-doc-ko.postrm
/var/lib/dpkg/info/texlive-doc-mn.list
/var/lib/dpkg/info/texlive-doc-mn.postrm
/var/lib/dpkg/info/texlive-doc-nl.list
/var/lib/dpkg/info/texlive-doc-nl.postrm
/var/lib/dpkg/info/texlive-doc-pl.list
/var/lib/dpkg/info/texlive-doc-pl.postrm
/var/lib/dpkg/info/texlive-doc-pt.list
/var/lib/dpkg/info/texlive-doc-pt.postrm
/var/lib/dpkg/info/texlive-doc-ru.list
/var/lib/dpkg/info/texlive-doc-ru.postrm
/var/lib/dpkg/info/texlive-doc-si.list
/var/lib/dpkg/info/texlive-doc-si.postrm
/var/lib/dpkg/info/texlive-doc-th.list
/var/lib/dpkg/info/texlive-doc-th.postrm
/var/lib/dpkg/info/texlive-doc-tr.list
/var/lib/dpkg/info/texlive-doc-tr.postrm
/var/lib/dpkg/info/texlive-doc-uk.list
/var/lib/dpkg/info/texlive-doc-uk.postrm
/var/lib/dpkg/info/texlive-doc-vi.list
/var/lib/dpkg/info/texlive-doc-vi.postrm
/var/lib/dpkg/info/texlive-doc-zh.list
/var/lib/dpkg/info/texlive-doc-zh.postrm
/var/lib/dpkg/info/texlive-extra-utils.list
/var/lib/dpkg/info/texlive-extra-utils.postrm
/var/lib/dpkg/info/texlive-font-utils.list
/var/lib/dpkg/info/texlive-font-utils.postrm
/var/lib/dpkg/info/texlive-fonts-extra-doc.list
/var/lib/dpkg/info/texlive-fonts-extra-doc.postrm
/var/lib/dpkg/info/texlive-fonts-extra.list
/var/lib/dpkg/info/texlive-fonts-extra.postrm
/var/lib/dpkg/info/texlive-fonts-recommended-doc.list
/var/lib/dpkg/info/texlive-fonts-recommended-doc.postrm
/var/lib/dpkg/info/texlive-fonts-recommended.list
/var/lib/dpkg/info/texlive-fonts-recommended.postrm
/var/lib/dpkg/info/texlive-formats-extra.list
/var/lib/dpkg/info/texlive-formats-extra.postrm
/var/lib/dpkg/info/texlive-games.list
/var/lib/dpkg/info/texlive-games.postrm
/var/lib/dpkg/info/texlive-generic-extra.list
/var/lib/dpkg/info/texlive-generic-extra.postrm
/var/lib/dpkg/info/texlive-generic-recommended.list
/var/lib/dpkg/info/texlive-generic-recommended.postrm
/var/lib/dpkg/info/texlive-humanities-doc.list
/var/lib/dpkg/info/texlive-humanities-doc.postrm
/var/lib/dpkg/info/texlive-humanities.list
/var/lib/dpkg/info/texlive-humanities.postrm
/var/lib/dpkg/info/texlive-lang-african.list
/var/lib/dpkg/info/texlive-lang-african.postrm
/var/lib/dpkg/info/texlive-lang-arabic.list
/var/lib/dpkg/info/texlive-lang-arabic.postrm
/var/lib/dpkg/info/texlive-lang-armenian.list
/var/lib/dpkg/info/texlive-lang-armenian.postrm
/var/lib/dpkg/info/texlive-lang-croatian.list
/var/lib/dpkg/info/texlive-lang-croatian.postrm
/var/lib/dpkg/info/texlive-lang-cyrillic.list
/var/lib/dpkg/info/texlive-lang-cyrillic.postrm
/var/lib/dpkg/info/texlive-lang-czechslovak.list
/var/lib/dpkg/info/texlive-lang-czechslovak.postrm
/var/lib/dpkg/info/texlive-lang-danish.list
/var/lib/dpkg/info/texlive-lang-danish.postrm
/var/lib/dpkg/info/texlive-lang-dutch.list
/var/lib/dpkg/info/texlive-lang-dutch.postrm
/var/lib/dpkg/info/texlive-lang-finnish.list
/var/lib/dpkg/info/texlive-lang-finnish.postrm
/var/lib/dpkg/info/texlive-lang-french.list
/var/lib/dpkg/info/texlive-lang-french.postrm
/var/lib/dpkg/info/texlive-lang-german.list
/var/lib/dpkg/info/texlive-lang-german.postrm
/var/lib/dpkg/info/texlive-lang-greek.list
/var/lib/dpkg/info/texlive-lang-greek.postrm
/var/lib/dpkg/info/texlive-lang-hebrew.list
/var/lib/dpkg/info/texlive-lang-hebrew.postrm
/var/lib/dpkg/info/texlive-lang-hungarian.list
/var/lib/dpkg/info/texlive-lang-hungarian.postrm
/var/lib/dpkg/info/texlive-lang-indic.list
/var/lib/dpkg/info/texlive-lang-indic.postrm
/var/lib/dpkg/info/texlive-lang-italian.list
/var/lib/dpkg/info/texlive-lang-italian.postrm
/var/lib/dpkg/info/texlive-lang-latin.list
/var/lib/dpkg/info/texlive-lang-latin.postrm
/var/lib/dpkg/info/texlive-lang-latvian.list
/var/lib/dpkg/info/texlive-lang-latvian.postrm
/var/lib/dpkg/info/texlive-lang-lithuanian.list
/var/lib/dpkg/info/texlive-lang-lithuanian.postrm
/var/lib/dpkg/info/texlive-lang-mongolian.list
/var/lib/dpkg/info/texlive-lang-mongolian.postrm
/var/lib/dpkg/info/texlive-lang-norwegian.list
/var/lib/dpkg/info/texlive-lang-norwegian.postrm
/var/lib/dpkg/info/texlive-lang-other.list
/var/lib/dpkg/info/texlive-lang-other.postrm
/var/lib/dpkg/info/texlive-lang-polish.list
/var/lib/dpkg/info/texlive-lang-polish.postrm
/var/lib/dpkg/info/texlive-lang-portuguese.list
/var/lib/dpkg/info/texlive-lang-portuguese.postrm
/var/lib/dpkg/info/texlive-lang-spanish.list
/var/lib/dpkg/info/texlive-lang-spanish.postrm
/var/lib/dpkg/info/texlive-lang-swedish.list
/var/lib/dpkg/info/texlive-lang-swedish.postrm
/var/lib/dpkg/info/texlive-lang-tibetan.list
/var/lib/dpkg/info/texlive-lang-tibetan.postrm
/var/lib/dpkg/info/texlive-lang-ukenglish.list
/var/lib/dpkg/info/texlive-lang-ukenglish.postrm
/var/lib/dpkg/info/texlive-lang-vietnamese.list
/var/lib/dpkg/info/texlive-lang-vietnamese.postrm
/var/lib/dpkg/info/texlive-latex-base-doc.list
/var/lib/dpkg/info/texlive-latex-base-doc.postrm
/var/lib/dpkg/info/texlive-latex-base.list
/var/lib/dpkg/info/texlive-latex-base.postrm
/var/lib/dpkg/info/texlive-latex-extra-doc.list
/var/lib/dpkg/info/texlive-latex-extra-doc.postrm
/var/lib/dpkg/info/texlive-latex-extra.list
/var/lib/dpkg/info/texlive-latex-extra.postrm
/var/lib/dpkg/info/texlive-latex-recommended-doc.list
/var/lib/dpkg/info/texlive-latex-recommended-doc.postrm
/var/lib/dpkg/info/texlive-latex-recommended.list
/var/lib/dpkg/info/texlive-latex-recommended.postrm
/var/lib/dpkg/info/texlive-latex3.list
/var/lib/dpkg/info/texlive-latex3.postrm
/var/lib/dpkg/info/texlive-luatex.list
/var/lib/dpkg/info/texlive-luatex.postrm
/var/lib/dpkg/info/texlive-math-extra.list
/var/lib/dpkg/info/texlive-math-extra.postrm
/var/lib/dpkg/info/texlive-metapost-doc.list
/var/lib/dpkg/info/texlive-metapost-doc.postrm
/var/lib/dpkg/info/texlive-metapost.list
/var/lib/dpkg/info/texlive-metapost.postrm
/var/lib/dpkg/info/texlive-music.list
/var/lib/dpkg/info/texlive-music.postrm
/var/lib/dpkg/info/texlive-omega.list
/var/lib/dpkg/info/texlive-omega.postrm
/var/lib/dpkg/info/texlive-pictures-doc.list
/var/lib/dpkg/info/texlive-pictures-doc.postrm
/var/lib/dpkg/info/texlive-pictures.list
/var/lib/dpkg/info/texlive-pictures.postrm
/var/lib/dpkg/info/texlive-plain-extra.list
/var/lib/dpkg/info/texlive-plain-extra.postrm
/var/lib/dpkg/info/texlive-pstricks-doc.list
/var/lib/dpkg/info/texlive-pstricks-doc.postrm
/var/lib/dpkg/info/texlive-pstricks.list
/var/lib/dpkg/info/texlive-pstricks.postrm
/var/lib/dpkg/info/texlive-publishers-doc.list
/var/lib/dpkg/info/texlive-publishers-doc.postrm
/var/lib/dpkg/info/texlive-publishers.list
/var/lib/dpkg/info/texlive-publishers.postrm
/var/lib/dpkg/info/texlive-science-doc.list
/var/lib/dpkg/info/texlive-science-doc.postrm
/var/lib/dpkg/info/texlive-science.list
/var/lib/dpkg/info/texlive-science.postrm
/var/lib/dpkg/info/texlive-xetex.list
/var/lib/dpkg/info/texlive-xetex.postrm
maria@marysia-ubuntu:~$
我使用时sudo apt-get autoclean
没有任何变化。我安装了deborphan
,但什么都没显示(也许我使用的方式不对:只是输入了命令deborphan
)。是我做错了什么,还是有人告诉我一些不真实的事情?
我想知道两件事:如何删除软件包(如果我操作错误)以及如何清除硬盘上迄今为止我已卸载的所有软件包的残留(即使我不记得它们到底是什么)。我安装了 Ubuntu Tweak,但我不知道如何使用它,我想我更喜欢终端命令。
谢谢
答案1
apt-get autoclean
只会从软件包档案中删除旧版本,但不会对已安装的软件包进行任何更改。
要删除软件包,请使用sudo apt-get purge package
。这应该会卸载所有依赖项,但不会完全删除它们。我使用命令aptitude purge ~c
“.clean all uninstalled packages”。
即使清除了软件包,也可能留下数据文件和备份文件。备份应该是 下的目录/var/backup
。数据文件可能位于 中/var/lib
。我会在删除数据文件之前备份它们,以防其他应用程序使用它们。您可能想要 grep 中的数据文件目录/var/lib/dpkg/info
。如果有任何文件使用该目录,请保留它。例如,要查找使用 安装了哪些软件包/var/lib/ldap
,我会运行搜索grep -l /var/lib/ldap /var/lib/info/dpkg/*
。如果您有很多软件包,您可能需要使用find /var/lib/dpkg/info | xargs grep -l /var/lib/ldap
。
编辑:您可以使用命令列出所有可以标记为自动安装的程序aptitude search '~i!~M?for x: ~D( ~i!~M )'
。将其通过管道传输到命令“cut -d\ -f4 | sudo aptitude markauto”以将这些软件包标记为自动安装。
然后我使用命令aptitude search '~i!~M'
(已安装,不是自动安装)列出所有第一顺序安装的软件包。警告:删除软件包时,您可能会卸载要保留的软件包。首先模拟删除,然后在运行实际删除之前取消标记要保留的任何软件包的自动标记。
EDIT2:以上说明包括其他软件包建议作为第一级软件包的软件包。要列出这些软件包,请使用命令aptitude search '~i!~M?for x: ~Rsuggests:( ~i!~M )'
。如果需要,可以使用与其他依赖项相同的管道标记这些软件包。但是,您必须将建议的软件包配置为自动安装,否则所有建议的软件包及其依赖项将自动卸载。这可以通过APT::Install-Suggests "true";
在/etc/apt/apt.conf
或 中添加行来完成/etc/apt/apt.conf.d
。
依赖关系可能会导致意外选择第一级软件包。如果两者都未wordpress
标记wordpress-l10n
,则wordpress-l10n
视为第一级安装。通常wordpress-l10n
会标记为自动安装,因此这不是问题。这样您可能会遇到很多麻烦。
答案2
您可以使用 synaptic 来完成@BillThor 列出的大部分工作。