User Tools

Site Tools


howto:use_upx_to_compress_executables

Use upx to compress executables

Prerequisities

UPX stands for The Ultimate Packer for eXecutables, an efficient multiplatform for several different executable formats. It is easy to use, unobtrusive and has negligible performance impact. On the other hand, it can compress only executables, while much more space could be reclaimed by compressing e.g. the whole /usr (using squashfs, fuse-compress, compfused or such).

You can really benefit from upx only if you remove unionfs or use upx exclusively on newly installed or updated packages, otherwise the compressed executables will take additional diskspace on the /dev/sda2 partition!

Installation

  1. Add Xandros repositories to /etc/apt/sources.list
  2. install upx:
    apt-get install upx-ucl-beta

Usage

  1. find a big executable (somewhere under /usr/bin)
  2. run upx from the command line like this:
    upx --brute /usr/bin/executable_name

    The compression takes a while, you can leave out the –brute switch to make it much faster (and very slightly less efficient). Decompression will be very fast in any case.

If you are using unionfs, to find out the list of executables you can use upx on to save space, mount /dev/sda2 somewhere:

sudo mkdir /tmp/mnt
sudo mount /dev/sda2 /tmp/mnt -o rebind

and go to the /tmp/mnt/usr/bin directory - yuo can compress the executables directly there.

howto/use_upx_to_compress_executables.txt · Last modified: 2008/06/27 07:20 by garabik