Where to install apps not available in the software store? Home? /usr/local? other?

Hello,

I have a basic question which is arising now that I am trying to save my home directory, which is becoming too huge, using Deja Dup.

First, I have been following this article when I want to install apps.

So far, the apps not available in the software manager have been been installed at the first level in my home directory (except Google Chrome).

Thus, my home directory looks something like:

  • anaconda3
  • Desktop
  • Documents
  • Downloads
  • MathWorks
  • Matlab
  • Music
  • Pictures
  • Pi-hole
  • PlayOnLinux's virtual drives
  • snap
  • spark
  • Videos
  • Virtual Box VM

Question:
When I install apps (not available in the sofware manager) in which folder should them be installed?

I am the only home using the computer (no guest, nor other users).

Those are configuration files that programs will create under each user's home directory (even when there's only one). The idea being that each user may use the same program but have different settings.

The actual binary should be in /usr/bin or /usr/sbin. Occasionally, you can find them under ~/.local/bin but normally this location is normally used explicitly by the user, for example when compiling from source. Package managers, .deb files, tarballs, etc, will use the the standard file system hierarchy for the respective OS (there's no definitive standard, some distributions will use slightly different locations).

You can save these files for your own benefit when restoring your own saved bookmarks and other configuration that you may have for any of them. But don't save the binaries and rather re-installed them again as needed.

Yes, thank you.

In fact, I have started the following topic I need advice for my full backup procedure

It is just that I fell that my home directory is becoming disorganized and I do not like much how it is starting to look. Maybe a solution would be:

  • Desktop
  • Downloads
  • Documents
  • etc
  • Softwares (and here I would put all those apps)

But first I need to know whether it make sense to have those apps installed there and not somewhere else.

I thought the configuration where inside folders starting with a . , and the general .config folder.

My home directory is becoming disorganized and I do not like much how it is starting to look. Maybe a solution would be:

  • Desktop
  • Downloads
  • Documents
  • etc
  • Softwares (and here I would put all those apps)

So, is it totally normal to have those software installed at the root of home?
Is it possible to installed them somewhere else like for the ones in the software manager package that do not appear in the home directory as a folder?

It very much depends on the program, but yes typically they'd prefix that directory with . or place them inside .config. You need to identify what is a binary or executable file, and what is a configuration. Then, for each program, decide if you need to keep the configuration file at all. Do not backup the binaries and just download and install them again as needed.

Maybe. This is entirely up to you as everyone's workflow is different and so is their backup solution. What works for me doesn't necessarily work for you and vice-versa.

I have a dedicated directory called Programs where I put things like AppImages, scripts, and similar executable files that I didn't properly install the system. I also don't backup anything in my desktop, as I use as playground and therefore I consider anything there to be disposable. Same thing with the Downloads folder.

But inevitably you will have anywhere between 20~50 or more files and directories in your home directory at some point. You can hide those files starting with . from the settings menu so that only the "main" ones are visible.

Can't respond to that other topic as it is now closed (over 3 months old). Personally, I would always use Rescuezilla for complete system backup. Bear in mind your Desktop will have the kernel using different drivers for different hardware to what you have in your Notebook. anon mentioned you may have to format to Ext4 for Timeshift snapshots ... it's not may it is a MUST! I know from personal experience! I also usually just backup the /home folder but ensure hidden files are shown, if not showing press Ctrl+ H to show then Ctrl+ A to select everything, Ctrl+ C to copy and Ctrl+ V to paste into the folder you created on your external drive. Do take note of all the other instructions that anon posted in his extensive well laid out response. Also remember that your hard drive in your notebook should be of the same storage size as the one in your desktop.

I tending to do something similar.

Yes, thank you. I did show them just to make the screenshot.

I look great for a manul complete backup solution.

That's what I would like to do. But it says that I do not have enough space on my 250GB External drive. Which is weird. That lead me to my first question. Where to install apps? In the home directory? somewhere else?

Yeah, great.

image
I think it is right, isn't?

Your last image shows you have 114.4 Gb free on your external drive. how much in your /home folder?

It's 204 GB so I have enough if I empty the Hardrive.

Sorry, I think I made the mistake to talk about the Backups, so the post is tending toward that, but the main question is the following one.

Where to install apps (not available in the software manager)?
In the Home folder? In usr/local? other?

Why when I installed an app it does create a folder there?
Could they be installed in a folder similar to the ones when using the software manager?

In the vast majority of cases, you shouldn't have to worry about this at all. Which begs the question, what type of apps are we talking about? Can you give an example?

As mentioned by @Turtle11 and my post above this is for configuration-related files. It varies wildly from one program to another.

Let's take the following example. AstroImageJ (AIJ) - ImageJ for Astronomy

I put in bold the important points.

  1. Download the latest installation files into a convenient directory.
  • AstroImageJ_v5.0.0.00_linux_x64_java17.tar.gz (provides AstroImageJ)
  • AstroImageJ_script.tar.gz (provides a startup script for AstroImageJ)
  1. As root user, e.g with "su" or "sudo"
  • cp AstroImageJ_v5.0.0.00_linux_x64_java17.tar.gz /usr/local/
  • cp AstroImageJ_script.tar.gz /usr/local/bin/
  • cd /usr/local
  1. Continuing as root user, if you already have an AstroImageJ installed in /usr/local change it to a backup name such as AstroImageJ_old using
  • mv AstroImageJ AstroImageJ_old
  1. As root user untar the archives into /usr/local/ and clean up with commands like these
  • tar xvf AstroImageJ_v5.0.0.00_linux_x64_java17.tar.gz
  • rm AstroImageJ_v5.0.0.00_linux_x64_java17.tar.gz
  1. As root user you can check that AstroImageJ has been created in /usr/local with
  • ls -l /usr/local/AstroImageJ
  1. If you want ownership so that you alone can do the updates, then change the owner of the AstroImageJ directory to your own user name. If you leave it with root ownership, you will have to run as root to do routine updates and this is not recommended. You may assign ownership to any user and run it as another user. This change is for software maintenance.
  • chown -R myname.users AstroImageJ
  1. As root user go to /usr/local/bin, untar the scripts, add a convenient soft link, and clean up
  • cd /usr/local/bin
  • tar xvf AstroImageJ_script.tar.gz
  • ln -s astroimagej aij
  • rm AstroImageJ_script.tar.gz
  1. You may return to being a normal user now and try out AstroImageJ. Assuming /usr/local/bin is in your search path
  • aij or astroimagej commands will start the software
  1. If there is a problem, try using the full path /usr/local/bin/aij to see if the software is working. The command echo $PATH will show the default path for your system. You may need to add /usr/local/bin/ if you are using a system that has only the basic software packages and is not yet set up for customization.

Below, the main points:

  • into a convenient directory
  • cp AstroImageJ_v5.0.0.00_linux_x64_java17.tar.gz /usr/local/
  • untar the archives into /usr/local/

Here, the installation is putting the folder of the installation in /usr/local/ and not in the Home folder. In the home folder, there is just the configuration folder with the dot
image

Let's generalise the case of that installation process.

  1. I download a tar file into my Downloads folders.
  2. I copy it into /usr/local/
  3. I untar the archives into /usr/local/

My questions is:

  • Is that generalise process the most convenient way to install software not in the app store manager?

Yes, that's about right. The reason to place the executable in /usr/local is the same as placing it in /usr/bin: so that it will be picked up by the $PATH variable and you can run the command from any directory. The configuration files related to that program are stored in your home directory. This is typically done so that you can back them up and restore easily, but also in case there are multiple users in the system each can have their own settings for this program.

1 Like

Thank you.
Maybe something about this can be added here

#software-in-targz-source-archives

I don't think that's really a good idea, since this same process will vary from one program to the next. If you are not using the package manager or software store, you should follow the instructions provided.

Ah, thank you for the clarification. I thought that the majority of the programs in tar sould be installed there...

Well, there's nothing written in stone. But you never know if something in how the program is written is hard coded to use one particular location.

In short, no matter how you install something, either software store, package manger, etc: don't try to randomly guess yourself where to place files your system. Follow the instructions or even better, let the package manager handle this for you.

2 Likes

Thank you for the help :slight_smile:

1 Like

Many applications install to /usr/local, /usr/share, /usr/bin and /opt. Compiling from source allows you to place them wherever, but that location would have to be added to $PATH of it doesn't exist already in $PATH.