The default install directory of apt-get is /opt.
Can I change it to another directory?
The default install directory of apt-get is /opt. Can I change it to another
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Best way I can think of is to use a symbolic link
note that not all programmes are installed to the same directory and /opt may not be the best thing to move. (see end for example of moving only one folder/program)
This is what I did with EasyPeasy (Ubuntu 10.04)
Follow this code carefully some of the commands can delete important files if used incorrectly.
First you need to make sure /opt (or your distros default apt-get install directory) is empty. If you have data in the opt folder, which you most likely do, you can move it to somewhere else first for safe keeping:
Once backed up you can remove the original directory:
You can then create your new Program Files folder in a drive with lots of space and create a symbolic link:
Finally move all your old program files to your new folder and clean up the temporary data:
If you only wanted to move a single program which is taking up a hunk of your space you could use the same process.
eg:
to move Java (JVM approx 300MB) do the following.
check directory of java using disk usage analyser.
mine is /usr/lib/jvm
Its best at this point to do a restart which should clear the cache.