1

I'm trying to install software I downloaded from the internet and I am trying to figure out how to do it.

I found this link to help me install it but what I want to know is why I do these things and what do each of these things do to allow me to setup the software?

I probably should clarify a little more: Why should I change the permissions of the folder? Why do I need to copy that particular text to the file in step 4? Why do I need to make those particular files?

I hate being told what to do and not know why I'm doing it; any help would be nice.

Thank you in advance!

P.S.: Sorry for my nick-picky-ness, I'm just trying to understand this all fully.

Example commands... enter image description here

2 Answers2

3

Starting at Step 2.

tar xvf is used to decompress your compressed tarball file which contains your eclipse install files

Step 3.

mv is used to move files or directories

cd is to change directories that you're in

chown changes the ownership of a file or directory, in this case you're making root:root the owner of the eclipse folder

chmod changes the permissions on folders or files, here you're adding read rights to everyone

Step 4.

touch updates the timestamp of when a file was accessed or modified, if the file doesn't exist, it will create it

chmod 755 gives everyone read and execute permissions to the file, leaving write access left to the user

nano is a basic text editor (your pasting the script contents into the file you're editing)

Step 5.

This will create a desktop icon for eclipse in gnome

  • I probably should clarify a little more: Why should I change the permissions of the folder, why do I need to copy that particular text to the file in step 4? – Cameron Wetzel Jun 09 '16 at 14:55
  • When you extract eclipse, it's assuming you are a regular user, it's expecting you to be root, and for root to own it. So that's why the command is issued, to change the ownership / make sure it's what it's expecting it will be. Step 4, that is the script that starts eclipse, it exports the variable ECLIPSE_HOME which then can be used in other programs. –  Jun 09 '16 at 15:03
1

I'd be wary of installing packages that you've downloaded from the internet, though I'm assuming you got it from the Oracle page, so should be safe. The recommended way to install Eclipse is to use the Software Centre, or if you need a different version of Eclipse to the one in the Ubuntu repositories (3.8.1-8 for Xenial), to add a PPA. Using the official repositories or a PPA will ensure that you get relevant updates.

That said, I'll attempt to answer what each of the steps do.

  1. Downloads a .tar.gz file, a gzipped tar archive. Like a zip file with a structure of directories and files within.
  2. Unzip and extract the tar archive using a tar command, the options are -x for extract, -z for unzip (actually gunzip), -v for verbose to tell you what it's doing. This will unzip the Eclipse files into whichever directory you're in at the time.
  3. sudo mv eclipse /opt/ - moves the eclipse directory and all contents into the /opt/ directory, the place where all external packages should be installed. sudo cd /opt/ - move into /opt/. sudo chown -R root:root eclipse - make all files and directories inside /opt/eclipse owned by the user and group of root. sudo chmod -R +r eclipse - make all the eclipse files and directories readable to user, groups and others.
  4. Create the file in /usr/bin/ to launch eclipse from /opt. Essentially this file is a Bash script which sets and exports the path to eclipse as the variable ECLIPSE_HOME. The actual binary, or program is stored in the file /opt/eclipse/eclipse, so when you call that bash script, you are saying, launch eclipse from the path /opt/eclipse/eclipse. The $* means that you pass it any command line arguments as they're passed to the shell script. This script is given octal permissions 755, so that everyone can use the shell script, but only root (or a sudo user) can rewrite the script.
  5. The final step creates a desktop file to launch the shell script, and by extension launch eclipse.

You shouldn't really be using an outdated tutorial for Ubuntu 11.04, but I understand wanting to know what the steps are that this tutorial is telling you. I'd advise using one of th approaches in this question instead.

Arronical
  • 19,653
  • 18
  • 73
  • 128