Ubuntu – How to change Software Center’s default installation path


I'm using Ubuntu 10.10 – the Maverick Meerkat. Whenever I install software using the Software Center, it installs it to /usr/lib. I have less space in this drive. Is it possible to change the default installation path to any other place? And how?

Best Answer

Debian/Ubuntu use a standard directory hierarchy. The command man hier will describe this for you. It is common for packages to create symlinks to place files in the correct place when the program expects them elsewhere.

There are two options I use to increase space on a partition: - As a temporary solution I create a directory on another partition for a directory like /var/cache/apt/archives which can take a fair amount of space. I then move the contents of the directory to the new partition and replace the directory with a sumlink.
- A permenant solution is to create a new partition for a large moveable directory like home, var or usr. Then I rsync the directory onto the new partition and mount it. Cleanup is done by mounting the root partition on /mnt and removing the files from the directory under /mnt.

Cleaning up /tmp and moving it to a tmpfs mount can free up space if it is on disk.

You may also free up space with the apt autoclean or apt clean commands. The second option will remove all download debs for /var/cache/apt/archives.

Running apt and removing obsolete kernels may also free up space. Usually two are sufficient, and they don't always get removed automatically. Don't remove the current kernel. If you haven't rebooted for a long time you may want to reboot to the newest kernel before removing old kernels.

The command du -sk /usr /home /var | sort -n will tell you how large those directory trees are.