Can I disable all man pages?

I was having the opposite problem on a Debian 8 image which somebody had put together for a Wandboard. I was trying to find the manual page for some packages which were already installed and noticed that after installing some new ones, the manual pages were missing, even though they were present in the deb file.

I then found this file 01_nodoc in /etc/dpkg/dpkg.conf.d, which is a simple solution to the original question on how to save space by deleting manual pages and locales and copyright files where space is at a premium (eg embedded systems).

# /etc/dpkg/dpkg.conf.d/01_nodoc

# Delete locales
path-exclude=/usr/share/locale/*

# Delete man pages
path-exclude=/usr/share/man/*

# Delete docs
path-exclude=/usr/share/doc/*
path-include=/usr/share/doc/*/copyright

The issue is that the package management system expects the files it installs (including man pages) to remain there, so whatever mechanism you use to remove them (except rebuilding every package as HalosGhost suggests) is going to confuse it.

If what you are doing is to produce a single-purpose appliance, one approach you could take is to have separate build and deploy steps for the appliance. That is, you install all the packages you want in a separate build environment (a different SD card, or an emulated RPi), and then copy only what you want to have in production from the build environment to the production environment. At that stage, you can leave out man pages and anything else that isn't needed in production.

In order to pick up upgraded OS or security fixes, you upgrade or rebuild the build environment and copy (or rsync) to production again.

That's a bit more work, but it gives you a very controlled production device, compared to logging on and running upgrades directly on it.


Well, not knowing what distro your RPi is running, I cannot help you with the exact commands, but you can probably remove the man-db package which provides both the man utility and a variety of man pages. However, removing all man pages would require removing each man page from each package—I cannot imagine that this is worth your time just to save KiBs of space.

If you really wanted to, then you would need to rebuild each package; on a distro like Archlinux or Gentoo, this is not necessarily impossible, but is still quite tedious. On other less "hands-on" distros, you may find this task incredibly difficult.