By default apt-get installs packages in the drive that the ubuntu installation resides on. But can i install a package other than the ubuntu partition ? If i can, how to do it ?
4 Answers
It's not clear why you want this. If it's for space reasons, one viable approach would be to mount large directories (probably /bin or /usr, where many programs reside) in an extra partition. See e.g. this question: How can I store /var on a separate partition? for how to do that.
Another option beside the defunct link for another answer's "portable application" which seems to now correlate to the link below, which is a collection of single file AppImages, is to use the other portable package apps like Flatpak or Snap. With these you can symlink the dirs onto another partition.
- 850
Depending on the software, you may be able to find it as a portable application, which you could install wherever you want.
I have tried to figure out how to do this as well. I have read that you can only install on the default partition. This is because installing on other partitions can cause viruses or unwanted things on your computer. What I have done to get around this is to install the package on the default partition then add a script to the beggining of it that will move the files where you want the first time the program is started.
- 144,580