Score:1

Any reason not to store AppImage files in /usr/local/bin?

in flag

I've seen in a few places the recommendation to store AppImage files in ~/.local/bin.

I have always stored local executable files in /usr/local/bin. Should I treat AppImages differently? For example, will parking an AppImage in /usr/local/bin keep it from being updated by the provider or cause problems do to /usr/local/bin needing sudo to access?

mook765 avatar
cn flag
Needing sudo to access is not really correct, write-access needs sudo, read-access does not (assuming standard umask).
G.W. avatar
in flag
My post captures my lack of understanding about what is needed. Perhaps the AppImage provider needs write access to update the AppImage and being at /usr/local/bin would prevent this? Again, interested to know if it is inadvisable to store AppImage at /usr/local/bin and why exactly
mook765 avatar
cn flag
I've never seen an appimage which is somehow self-updated, I always had to download the new appimage to replace the older one. But of course, I don't know all existing appimages. In doubt you'd have to do the update manually. In fact, it doesn't matter where you save your appimages, it's a question of taste.
G.W. avatar
in flag
The AppImages I'm planning to use all autoupdate.
Uri Herrera avatar
us flag
@G.W. Could you link to an AppImage file with this feature?
cn flag
Not specific to appimages but the difference between `/usr/local/bin` and `~/.local/bin` is the amount of users that use it. If single user `~/.local/bin` should be preferred. If multiple users use the same binary `/usr/local/bin` -could- be preffered.
Score:1
cn flag

Appimages will run fine anywhere they are placed on the file system. When they are placed in a directory that is in the PATH, such as /usr/local/bin, they can be run just by typing the file name at the terminal.

There will be no side effects except for what you indicate yourself: /usr/local/bin is a system directory, so tools to auto-update an app-image will not be able to perform the update.

Still, there is no good reason to place your appimage there, unless you rename the appimage to a simple name that conveniently can be typed from the command line. But then the version information in the file name is gone.

Better practice

Place your appimages in a dedicated directory, anywhere.

Then link the appimage to a directory that is in your path. Rename the link to an easy name:

  • If you are the only one needing to run the appimage, link it into ~/.local/bin.
  • If all users should have access, place it in a system directory and link it into /usr/local/bin.

For example, if Joplin-2.9.17.AppImage is in ~/.appimage, following command will link it into /usr/local/bin with an easier name.

sudo ln -s ~/.appimage/Joplin-2.9.17.AppImage /usr/local/bin/joplin
  • Rather than typing Joplin-2.9.17.AppImage, you will type joplin to start the program
  • You continue to easily see which version you are running
  • If you upgrade to Joplin-2.9.18, you can replace the symbolic link by one linking to the new version. You could keep the old appimage around a bit in case there are issues with the new version.
cn flag
I slightly disagree: /usr/local/bin is used for binaries that are for multiple users. Installing a binary for 100 users in each ~/.local/bin is bad practise.
vanadium avatar
cn flag
@Rinzwind you may have misread - I stated that ~/.local/bin is when only the user needs access.
mook765 avatar
cn flag
For a link in `/usr/local/bin` the the permission of the home-directory are relevant. The home directory might be 750, thus a link to a file in this home direcory might not work for other users without adding them to the according group. With 755 premissions it should be ok though.
vanadium avatar
cn flag
@mook765 Indeed, permissions must be set to allow all users to execute the file. I changed the answer slightly not to suggest that the systemwide AppImage is also in the users home directory (although it can provided permissions on the executable and the path to it allow it).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.