As indicated in the other answers, apps installed using package managers or installation scripts are installed in fixed, conventional locations in the file system under root (/
). This cannot be changed (read "not easily" in case of installation scripts.
Apart from enlarging your root partition, you easily could relocate some of the system data to another storage medium using symlinks. Especially these applications that are manually installed,i.e., not from the software center, could be relocated. This includes /opt
and /usr/local/
.
Preferably change the system from a root recovery prompt, although, for these particular system folders, it may still be safe to move these particular folders from a TTY, and even from a regular graphical terminal. Still, prefer at least to not log in and work from a TTY.
Boot your computer to the login screen
With Ctrl+Alt+F4, switch to a terminal console and log in there.
Make a directory under your home folder to host the extra system files:
sudo mkdir /home/system
(You choose the name to your liking).
Move your /opt
and /usr/local
directories
sudo mv /opt /home/system/
sudo mv /usr/local /home/system/
- Create symlinks to these moved directories in the original place
ln -s /home/system/opt /opt
ln -s /home/system//usr/local /usr/local
- Verify these two folders now are "restored" (the system sees them in the expected location even where the data physically live on another partition:
ls /opt /usr/local
- Probably there is no need to reboot, but do it to be sure. Either go back to the login screen (Alt+F1 on standard Ubuntu, else could be Alt+F7) to restart, or type
reboot
.
Specific remark
You indicate your root partition is 60GB. This still is plenty for a partition solely used as the system partition. For you, there should be no need to move any system files out. So prefer to check what else is filling that partition, and eliminate that source of data. then you can leave any system data on the system partition.