How can I change the installation location?

When I was in Windows, I was able to change the installation location of apps to different drive during installation wizard only.
But I want to know can I do the same process in Linux as well ?
I want to to understand the procedure as all the installation I am doing is being carrying out primary drive only.

Others can correct me, but I don’t believe Calamares supports this. If you want to install applications on a different drive to your root system, your best bet would be to install a base system with the installer, and then manually install the applications on a different drive.

If you’re post the base installation process, and looking to install applications to a different drive, it will depend on your installation method. I believe most applications require installation to root (where your OS lives), but can have their data stored elsewhere. For example, Lutris or Wine can be installed to your main drive, but be pointed to files elsewhere, allowing you to store the majority of data (e.g. games) on a separate drive. I believe this is how Windows does it as well. Even when you select a different drive in the GUI installer, the software still stores base files on your C drive, either in a system folder or some kind of appdata folder. Unless the application is ‘portable’, in which case all the files are stored in one place, similar to - I think - AppImages on Linux.

I want to change the installation location of utility apps like pdf editor, GIMP,Inkscape,etc. And location for study related apps like Stellarium, Sagemath,etc.

While I was on Windows, I can easily change the location where installation should be performed, i.e. instead of installing on C: drive (SSD) , I would have installed on D:drive(HDD).

How did you install these?

See my edited response above.

I am yet to install these apps, but till today I had downloaded and installed chess program by directly using konsole.

That’s why before going to installation, I wanted to know about this. Because, SageMath and Stellarium are big sized softwares, due to this I don’t want to use the space of primary drive.

While I was on Windows, in installation wizard, there happens to be the option where I can manually select where installation should be carried out.

Ex- there is something like c/program files(×86)…
And I relace that with d/ new folder…

I have no experience with these, so others will have to chime in. Most Linux software expect their data to be in /home, which can be mapped to a different drive, but if these applications take up significant installation space, i.e. data not stored in /home, someone else will have to help you out. I’m assuming you’re installing these with Yay or Pacman, so until someone else comes around, you could perhaps search for results using those terms.

Can you provide me some help for this.

I had tried the ideas, but I was not able to solve it.

If I could, I would chime in under the original thread, where I see you have multiple people far more knowledgeable than me, helping you out. I’m sure you’ll see new responses there once they wake up.

Yes, It’s bit tough for me as I am newcomer in Linux, due to which I am in unknown grounds, therefore, I am loose on knowledge.

Linux doesn’t quite work like windows :wink:


To answer your question, if you compile the application yourself, you could install it to any location you want. Compiling can take time depending on your system specs and the software you’re compiling. (I obviously don’t recommend doing that for Sagemath)

Reading the pacman man page,

  -r, --root <path>
           Specify an alternative installation root (default is /). This
           should not be used as a way to install software into /usr/local
           instead of /usr.  NOTE: If database path or log file are not
           specified on either the command line or in pacman.conf(5), their
           default location will be inside this root path.  NOTE: This option
           is not suitable for performing operations on a mounted guest
           system. See --sysroot instead.

I couldn’t get this to work (certainly because I wasn’t using this right). If you can figure it out, well and good.
there is a flag that lets you specific an alternate install location. Add -r /path/to/installation/folder to pacman installation command and it should do more or less what you want to do. Even if you get it to work, application may have been programmed in a way to look for its files in /, in which case application may crash mid way.


I understand that your primary concern is your root partition filling up? In this case, an easier solution would be to extend your root partition.

1 Like

I can’t expand the root partition more as I had completely devoted the SSD(128GB) for this.

I have a comparatively bigger HDD(500GB) where I want to install these big apps.

Most Linux systems have all applications in default directories. You cannot really choose a location where to install the program. Well, you can, but it’s really not practical. So, if you use a lot of software, make sure to have a big root drive.

You can move any file wherever you want and leave in its place a symbolic link to the new location. Symbolic links are like shortcuts on windoze, but more powerful, they pretend to be the files they point to.

So, if you’re running low on space on your root partition, you may move whatever file you want to a different location (using the mv command) and replace it with a symbolic link (with the ln -s command).

3 Likes

I want to do this but I can’t.
Please check the thread which I had also posted here.
Due to that issue, I am lacking ability to try it.

Seems like quite a lot! In comparison, my old pc runs off a 50gb partition. My laptop has a larger ssd, but I have never used more than 30gb.

I believe you should look out to move other files from your ssd to your hdd. See what all files are hogging those 128gb. (You could use something like ncdu or Baobab for this). Stuff like documents, music, pictures etc don’t need to be on your ssd if you already have an hdd. Pacman config can easily let you specify other location for package cache.

Also, what @Kresimir said above, if you can figure it out. I have moved many cache directories and browser profiles from home to hdd, and symlinked it.

2 Likes

Sir, this is the issue for me.

The thread where I asked about HDD file mobility issue is causing brakes for me.

Why not?

Which thread?

What issue?

Due to aforementioned trouble, I am not able to clean up the space on HDD.