Handleing non-installed programs

C

clockshell

Guest
Hi!

I just wondered how you guys handle non-installed programs. Just to make myself clear: I mean, for example Zotero. I downloaded a tarball from the official homepage and extracted the content to ~/bin.

I used to cd into ~/bin/Zotero_linux-x86_64 and run ./zotero to start the standalone program. Today I added the following lines into my .profile
Code:
# Zotero
if [ -d "$HOME/bin/Zotero_linux-x86_64" ] ; then
    PATH=$HOME/bin:$PATH"
fi
and voila, I can start Zotero with 'zotero' from everywhere on my system - I am proud of myself :3
Code:
whereis zotero
although just gives 'zotero:' as output so I asked myself wether it is technically 'installed' or just running independently...?

Actually I asked myself this question many times and did not stumble over an answer so far. I hope somebody can help me get smarter :)
 


If you are referring to a program you have downloaded as say a tar.bz file like Seamonkey and Firefox and you extract said program to a directory then said program is not installed I run them from /opt eg.

Firefox 24esr.tar.bz I extract to /opt/firefox.
 
Dude, this makes so much sense, I think I am having an epiphany :D

I am using Linux for about a year straight now and even before I wondered why I couldn't run the extracted programs I put into /usr/. There is a huge knot getting lose in my head, thanks a lot :)

I'll just put this together for myself and anyone who also had problems with finding the standard: besides of the golden rule of choice which says I can do whatever I want, a good guideline is to put installations into /usr/local, automatically with a package manager or using --prefix=/usr/local/ or whatever during configuration of compiling. This folder is good for small scripts since it has its own /bin /lib /whatever structure. Any program which is large enough to have its own directory tree is preferibly put into /opt. After all anybody has to find their way. I think I'll try my best with using /opt for programs I put on my machine with tar/cp/rm and /usr/local for programs I can compile and install with ./configure/make/sudo make install or a package manager...

Here are my sources. They helped me understand the differences between /opt and /usr/local a little better. Have fun finding your way :)

http://www.unix.com/unix-for-dummie.../160458-difference-between-opt-usr-local.html
http://www.linuxjournal.com/magazine/pointcounterpoint-opt-vs-usrlocal?page=0,1

edit: Hm... it did not work out how I intended it to. I am going to stick to my $HOME/bin folder for it works. Nevertheless can somebody explain to me what went wrong?

I put two programs into /opt, Tor and Zotero:
Code:
florian@clockwork:/opt$ ls
tor-browser_de  Zotero_linux-x86_64
and added the following lines into my .profile
Code:
# include opt in PATH
if [ -d "/opt" ] ; then
    PATH="/opt:$PATH"
fi

# Zotero
if [ -d "/opt/Zotero_linux-x86_64" ] ; then
    PATH="/opt:$PATH"
fi

# Tor Browser
if [ -d "/opt/tor-browser_de/Browser" ] ; then
    PATH="/opt:$PATH"
fi
Can't start one of the programs with 'zotero' or 'start-tor-browser'. Same works when I put them into my $HOME/bin and add
Code:
# Zotero
if [ -d "$HOME/bin/Zotero_linux-x86_64" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# Tor Browser
if [ -d "$HOME/bin/tor-browser_de/Browser" ] ; then
    PATH="$HOME/bin:$PATH"
fi
Mission #1 is a working system. Yet I am curious of what went wrong, can somebody help me?

edit: Ok... I realised I got it all wrong along. I also edited my .profile wrong. I went through the tutorial at http://www.cyberciti.biz/faq/unix-linux-adding-path/ and now everything seems to work again.
 
Last edited:
I would just use symlinks.
Code:
ln -s /opt/tor-browser_de /usr/bin/tor-browser
Code:
ln -s /opt/Zotero_linux-x86_64 /usr/bin/zotero

Then you can make desktop launchers should you need them:
http://standards.freedesktop.org/desktop-entry-spec/latest/
and place them in /usr/share/applications

for example:
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=Tor-Browser
Exec=/usr/bin/tor-browser
Icon=/usr/share/pixmaps/tor-browser.png
Categories=Network;
Comment=Tor Browser
 
Hm, I see. It looks cleaner than editing .profile or .bash_profile. Just to correct:
Code:
ln -s /opt/tor-browser_de/Browser/start-tor-browser /usr/bin/tor-browser
for start-tor-browser is the actual executable binary file.

Nice :) Thanks mate, this has been helpful :)
 
Opt often is used by Puppy Linux users who want to run programs on say an older version of Puppy but don't want to update system files such as gtk and glibc to run that program and instead put them with the program in opt so it doesn't use the Systems libraries, but is statically linked to those libraries running from opt.

I
 
Sorry for the late post but since I set up my Antergos machine today I stumbled over it again and I hope I learn it myself when I share it myself.

Had some problems with symlinking Zotero since xulrunner-stab caused problems (look here: https://forums.zotero.org/discussio...mlink-in-linux-could-not-read-applicationini/). They also provide a solution making a start-zotero.sh in the Zotero folder with simply
Code:
#!/bin/sh
exec "/path/to/zotero"
chmod +x it and symlink this file :)

Have a nice day!
 

Staff online

Members online


Top