25

I don't need the manpages and documentations on my debian server. Is it save to empty that folder completely to free up some disk-space, by replacing all files in that folder with empty dummy files.

Or is there a better way to uninstall all manpages and documentations?

So far I installed localepurge which already uninstalled all unused locales and could also uninstall my german locales but I would like to keep some German localisation.

With "safe" I mean not totally safe, but the same "safeness" like I have using localepurge (which never caused any problem so far)

GAD3R
  • 63,407
  • 31
  • 131
  • 192
rubo77
  • 27,777
  • 43
  • 130
  • 199
  • Are you building an embedded system, by the way? In this day and age I can't imagine any other kind of system where a couple of hundred megabytes would make that much difference and be worth the trouble of breaking the package manager for. – Celada Jan 22 '15 at 04:41
  • I am just really low on disk-space in a VM in the cloud. So you are saying it would **break the package manager**? – rubo77 Jan 22 '15 at 04:43
  • I'd start by checking you don't have any packages you don't need, and removing those first. You could also check for doc-only packages. Documentation includes with the software doesn't usually use a lot of space. – Faheem Mitha Jan 22 '15 at 11:58
  • 3
    Clearing `/usr/share/doc` certainly shouldn't break any package manager, but (A) it's not relevant to manpages, and (B) if you're going to clear it, delete the files properly, not the bizarre idea of replacing them all with empty files (which will still consume smaller space for inodes... and would just look incredibly silly). – underscore_d Nov 04 '15 at 21:58

2 Answers2

20

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.

As copyright files are also stored in /use/share/doc, such modified systems are normally not allowed to distribute if copyright files are not bundled otherwisely.

jofel
  • 26,513
  • 6
  • 65
  • 92
3

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.

Celada
  • 43,173
  • 5
  • 96
  • 105
  • So by definition there is only documentation inside that folder? then it seems to me, it would be the same risk like using localepurge which never caused any probmem to me – rubo77 Jan 22 '15 at 04:38
  • sure, I updated my question, didn't know the big difference between man pages and documentation, but now I clarified that I don't need both – rubo77 Jan 22 '15 at 04:40