I am trying to reduce the footprint of my Ubuntu docker image. Given that there is very little use for the man files and I deleted them, committed the image and then tried to use it. AFAICT it did no harm. However, I thought it worth asking here. Am I storing up any ugly problems for the future by doing this?
Short answer: no, this should not cause any major issue.
I think that you will not cause any major damage except these two cases:
- If do you need a manual for any command, you won't find it.
/usr/share/manfolder will grow when you do a package install/update.
Disable the apt cache:
When you install a package with
aptitudeon a Debian-based system, the downloaded package is, by default, kept in the APT cache located at
/var/cache/apt/archives. This is really not necessary as you typically do not re-install the same package ever again. Over time, the content in
Create a file in
02nocachewith these contents:
Dir::Cache ""; Dir::Cache::archives "";
Clear the apt cache:
sudo rm -rf /var/cache/apt/archives
Disable man pages, locales and docs:
You can disable a lot of rubbish doing this:
Create a file called
/etc/dpkg/dpkg.cfg.dwith these contents:
# /etc/dpkg/dpkg.cfg.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
Delete the current contents:
sudo rm -rf /usr/share/doc/ sudo rm -rf /usr/share/man/ sudo rm -rf /usr/share/locale/