![如何停止列出大量标记:和以下 dep:条目的 apt-get 操作](https://linux22.com/image/1000057/%E5%A6%82%E4%BD%95%E5%81%9C%E6%AD%A2%E5%88%97%E5%87%BA%E5%A4%A7%E9%87%8F%E6%A0%87%E8%AE%B0%EF%BC%9A%E5%92%8C%E4%BB%A5%E4%B8%8B%20dep%EF%BC%9A%E6%9D%A1%E7%9B%AE%E7%9A%84%20apt-get%20%E6%93%8D%E4%BD%9C.png)
当我运行 apt-get install|remove 操作时,输出会达到一百行或更多行 Marking: 或 Following dep: 一堆不相关的包。
以下是部分输出的示例:
Marking: firefox-esr-l10n-en-gb:amd64 52.0esr-16.04.1
Marking: filezilla:amd64 3.15.0.2-1ubuntu1
Marking: kde-spectacle:amd64 17.04.0-0neon+16.04+build8
Marking: openoffice.org-hyphenation:amd64 0.9
Following dep: openoffice.org-hyphenation:amd64 Depends on openoffice.org-updatedicts [ amd64 ] < none -> > ( none ), provided by dictionaries-common:amd64 1.26.3 (1/1)
Marking: pcmciautils:amd64 018-8
Marking: python-pam:amd64 0.4.2-13.2ubuntu2
Marking: libaudio2:i386 1.9.4-4
Following dep: libaudio2:i386 PreDepends on multiarch-support [ i386 ] < none -> 2.23-0ubuntu7 > ( libs ), provided by multiarch-support:amd64 2.23-0ubuntu7 (1/1)
Marking: socat:amd64 1.7.3.1-1
Marking: libdirectfb-extra:i386 1.2.10.0-5.1
Following dep: libdirectfb-extra:i386 PreDepends on multiarch-support [ i386 ] < none -> 2.23-0ubuntu7 > ( libs ), provided by multiarch-support:amd64 2.23-0ubuntu7 (1/1)
我认为这只是 apt 中的一个详细程度设置,但我一直没能找到它——有人能帮我把它关掉吗?
答案1
这似乎是个Debug::pkgAutoRemove
选择。来自man apt.conf
:
Debug::pkgAutoRemove
Log events related to the automatically-installed status of
packages and to the removal of unused packages.
虽然上述描述不是完全有帮助,但你可以通过查看apt
源代码来确认 - 具体来说apt-1.3.5/apt-pkg/depcache.cc
:
bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove", false);
if(debug_autoremove)
std::clog << "Marking: " << Pkg.FullName() << " " << Ver.VerStr() << std::endl;
您应该能够通过查找和修改文件中的设置来将其关闭/etc/apt.conf
,/etc/apt.conf.d/xxx
或者在命令行上使用-o
选项例如
sudo apt-get -oDebug::pkgAutoRemove=false install foo