Tuesday, 22 September 2009

Linux Basics - Download and Run Files

In general most advanced distributions of Linux are far more sensible about software installation than windows. Instead of having programs scattered far and wide across the interweb, they are usually collected together in a collection, or repository of files.

Sometime software will depend to some extent on other pieces of software. In windows this can manifest itself in the need for visual basic runtimes, or .net installations. You download a useful looking bit of software, install it, and run it only to find you need to download a FURTHER application 10 times the size just to get the sod to work.

No difference in Linux, except, as I say with more advanced distributions. What is important about the repositories is that not only is all the software in the same place BUT each bit of software knows what OTHER bits of software from the same repository it needs to run. So when you install the software it automatically downloads and installs all the other software it needs to function.

However, sometimes you do want to install some software from outside the standard repositories. If you try to do this in the windows way (right click link, save to disk, double click resulting icon, you are fucked. But it will not tell you what has gone wrong.

What you need to do is tell Linux it can run, or execute the program you have just downloaded. You can do this using most file managers by right clicking, looking for 'permissions'. There should then be an option, probably a checkbox, to turn on the 'execute' permission for the file. Alternatively you can do this on the command line by running the command:
chmod +x /path/to/nameoffile
This [ch]anges the [mod]e of the file [nameoffile] in the directory [/path/to] by [+]adding the e[x]ecute permission, but only for the current user. This means that if you have any other user accounts on the system, they will not be able to execute the file, which may be fine by you. To allow [a]ll users to execute the file, put an 'a' before the '+' sign, so it looks like this:
chmod a+x /path/to/nameoffile
By way of example, here is how you download and install Adobe's 'air' application:
wget http://airdownload.adobe.com/air/lin/download/1.5/AdobeAIRInstaller.bin
chmod +x AdobeAIRInstaller.bin
You can just copy and paste all three of those commands into a terminal window and it will install. You do not need to open your browser. The first command goes to a file on the [w]eb and [get]s it for you. It downloads the file to the directory you run the command from. We should now know what the second command does. The third command executes the file from [./] the current directory.

No comments:

Post a Comment