Mar*_*rer 62 uninstall documentation
我喜欢在 Virtual Box 机器中创建一个相当小的 Ubuntu 安装。它应该基本上只提供 TeX Live 和相关工具。我现在想我在/usr/share/doc. 在这种情况下,我不需要这个文档,只需要 LaTeX 相关man页面,它们不在那里。
有没有办法使用 卸载所有这些文档文件apt-get?
或者,只是删除内容是否合理保存/usr/share/doc?
我喜欢与其他人共享 Virtual Box 机器,这应该不会出现问题。
And*_*ley 43
根据Ubuntu wiki,您可以指示dpkg不要安装任何文档。这应该可以防止 apt 安装任何文档(版权信息除外)。
创建一个
/etc/dpkg/dpkg.cfg.d/01_nodoc指定所需过滤器的文件。例子:Run Code Online (Sandbox Code Playgroud)path-exclude /usr/share/doc/* # we need to keep copyright files for legal reasons path-include /usr/share/doc/*/copyright # if you also want to remove the man pages uncomment the next line #path-exclude /usr/share/man/* path-exclude /usr/share/groff/* path-exclude /usr/share/info/* # lintian stuff is small, but really unnecessary path-exclude /usr/share/lintian/* path-exclude /usr/share/linda/*
然后您可以手动删除任何已安装的文档:
find /usr/share/doc -depth -type f ! -name copyright|xargs rm || true
find /usr/share/doc -empty|xargs rmdir || true
rm -rf /usr/share/groff/* /usr/share/info/*
rm -rf /usr/share/lintian/* /usr/share/linda/* /var/cache/man/*
Run Code Online (Sandbox Code Playgroud)
如果您还想删除手册页,请执行以下操作:
rm -rf /usr/share/man/*
Run Code Online (Sandbox Code Playgroud)
该示例是为 OEM 编写的,但对我来说也同样有效。将我的/usr/share/doc/目录从 ~150MB 降到 ~20MB。
小智 34
这应该删除与乳胶相关的软件包的文档:
sudo apt-get --purge remove tex.\*-doc$
Run Code Online (Sandbox Code Playgroud)
它确实节省了几百 MB。
Den*_*aia 14
查找已安装的 texlive 软件包的快速而肮脏的方法(我 100% 确定还有其他方法):
dpkg -l | grep '^ii.*texlive.*doc'
Run Code Online (Sandbox Code Playgroud)
并删除它们:
apt-get remove --purge \
texlive-fonts-recommended-doc texlive-latex-base-doc texlive-latex-extra-doc \
texlive-latex-recommended-doc texlive-pictures-doc texlive-pstricks-doc
Run Code Online (Sandbox Code Playgroud)