Is it safe to empty /usr/share/doc?

It should be fine to delete files in /usr/share/doc on Debian-based systems.

The Debian policy explicitly specifies in section 12.3:

Packages must not require the existence of any files in /usr/share/doc/ in order to function. [...]

The system administrator should be able to delete files in /usr/share/doc/ without causing any programs to break.

As the package manager is also a program, it should handle this situation (missing files) properly. It could be needed after updates to purge /usr/share/doc by hand again.

The answers to this Ubuntu question explain, how disk space can be saved and the package manager can be configured properly in Debian-based systems.


Interfering with the Debian package manager by deleting files that are under its control is always a dangerous thing to do. Hence the inclusion of this paragraph in the documentation of localepurge:

Please note, that this tool is a hack which is not integrated with Debian's package management system and therefore is not for the faint of heart. This program interferes with the Debian package management and does provoke strange, but usually harmless, behaviour of programs related with apt/dpkg like dpkg-repack, reportbug, etc. Responsibility for its usage and possible breakage of your system therefore lies in the sysadmin's (your) hands.

Nevertheless, if you really need the disk space, you are of course free to do it if it works for you. One would expect that packages don't generally depend on their documentation being present in order to work, but there are no guarantees.

Or is there a better way to uninstall all manpages.

Deleting /usr/share/doc has nothing to do with manpages. Those are found in /usr/share/man.