2

The goal is to have a have a headless server installation on a physical machine that only serves one service. In other words the server is dedicated to run a single task. You could also call this a bare metal appliance. The service requires Oracle/Sun Java version 6 or 7. The wish is that the Ubuntu installation is trimmed down in hard disk space. Secondary goal beside low disk space usage is less security updates to be installed for components that are not even used. Result: less reboots, and lower down time.

JeOS no longer exists. A virtual machine installation does not apply, as this installation will run on physical hardware. Ubuntu-13.10-server-amd64 "F4 Minimal installation" with "openssh-server" and "unattended-upgrades" still consumes 942 MB.

After purging unnecessary packages with sudo apt-get purge accountsservice apparmor console-setup eject ftp fuse geoip-database info iputils-tracepath iso-codes kbd krb5-locales language-selector-common laptop-detect locales man-db manpages memtest86+ mtr-tiny ntfs-3g os-prober parted plymouth-theme-ubuntu-text popularity-contest ppp pppconfig pppoeconf rsync sgml-base tasksel telnet ufw vim-common xauth xkb-data xml-core there are 881 MB to remain.

How to install ubuntu or trim down an existing installation to consume minimal hard disk drive space?

Pro Backup
  • 3,210
  • 3
  • 25
  • 33

1 Answers1

1

1. Ubuntu Core

After installation using the instructions from What commands are needed to install Ubuntu Core? the used space on the disk is 610MB (measured using $ df -h).

Largely due to the installation of the linux kernel command apt-get update && apt-get install linux-{headers,image}-generic. According to the command output causes 325 MB of additional disk space to be used. In reality the space used before running this command is 132 MB, and after the apt-get update is 141 MB. So in reality the Linux kernel in Ubuntu Core 13.10 amd64 consumes 469 MB of disk space.

The following extra packages will be installed:
  crda dmsetup gettext-base grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common iw
  libasprintf0c2 libdevmapper1.02.1 libfreetype6 libfuse2 libnl-3-200 libnl-genl-3-200 libssl1.0.0
  linux-firmware linux-headers-3.11.0-18 linux-headers-3.11.0-18-generic
  linux-image-3.11.0-18-generic linux-image-extra-3.11.0-18-generic os-prober ucf wireless-regdb

The following NEW packages will be installed:
  crda dmsetup gettext-base grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common iw
  libasprintf0c2 libdevmapper1.02.1 libfreetype6 libfuse2 libnl-3-200 libnl-genl-3-200 libssl1.0.0
  linux-firmware linux-headers-3.11.0-18 linux-headers-3.11.0-18-generic linux-headers-generic
  linux-image-3.11.0-18-generic linux-image-extra-3.11.0-18-generic linux-image-generic os-prober
  ucf wireless-regdb

2. Debootstrap

The utility used by the Ubuntu installer, and recognized as the official way to install an Ubuntu base system, is debootstrap.
https://help.ubuntu.com/12.04/installation-guide/powerpc/linux-upgrade.html

A hardy debootstrap minbase install is 142M in df -h size. According to What takes less space: debootstrap or Ubuntu Core? a 12.04 debootstrap installation measures 205M.

The Fedora counterpart of debootstrap is named febootstrap. Its author - Richard W.M. Jones - has written an interesting blog post where he describes how to reduce the 225M minimal febootstrap to 38M. This small installation can even be slimmed further to 16M when willing to loose the RPM database (=updates), locales, time zones, etcetera.

Pro Backup
  • 3,210
  • 3
  • 25
  • 33
  • The compressed size of Ubuntu Core rootfs has almost doubled from 38M in 13.10 to 63M since release 14.04 (Trusty Tahr). – Pro Backup Aug 15 '14 at 20:09