Thursday, January 10, 2013

How do you install a program on linux?

Q. I am new to linux and do not understand the file extensions, i have a tar.gz file that is the Wicd Network Manager because it doesn't work so i am trying to install it because it is not found on the system. How do i go about installing this file.

A. The file tar.gz is a compressed file, much like a .zip file so first you must uncompress it. Usually double clicking in many distros will work.
Then you will have to install it. The methods to do this depend on the linux distro (ubuntu, SUSE, mint, knoppix, red hat, DSL) you are using and the file type (.deb, .sh) that is compressed in the tar.gz file (also called a tarball).
Also, you have to understand what dependencies you need to fulfill to install the program (what libraries you need).
Search the forums for the program you wish to install for the specific linux distribution you are using.
I highly reccomend that you buy a book for your new linux distro. That is how I learned. Linux is not windows, you can't just doubleclick everything you want to install. It makes it harder to install programs but in the end provides a more stable and secure system.

Can anyone help me with installing programs on Linux?
Q. I dont have internet on the computer i have linux on, am i screwed or is there still a way?

A. Some software is distributed in "Source form". This means you download a file containing all the source code for the application you want to install, unpack it, and compile it on your system. Compiling is the process of turning the source code into an executable binary. It is a fairly straight forward process.

Typically applications you must compile from source will come as a ".tar.gz", ".tar.bz2", or ".zip" file.

You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. Downloaded your zip file containing install files to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command:


Code:
mkdir /home/username/src/
So, we have our source package in /home/username/src/.

Change to the /home/username/src/ directory with the "cd" (change directory) command like so:


Code:
cd /home/username/src/
Use the "ls" (list directory contents) command, to see the file is present:


Code:
ls

We now need to unzip the zipped file, this is done differently depending on the file extension.

for files ending in .tar.gz, use:

Code:
tar -zxvf <filename>
(replacing <filename> with the name of the file).

for files ending in .tar.bz2, use:

Code:
tar -jxvf <filename>
for files ending in .zip, use:

Code:
unzip <filename>
You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again.

Code:
ls
we now need to go into the new directory, so use the cd command:

Code:
cd <directory>



This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so:

Code:
more INSTALL
Generally, the final 3 stages are as follows:
- Configure the installation
- Compile the software
- Install the binaries

The pre-installation configuration is done by executing ./configure:

Code:
./configure
This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled.

The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries.

Code:
make

The final stage is to install these binaries, ie, copy them to a more permanent location. Typically only the "root" user can do this, so you will need to swich to the root user with the "su" command:

Code:
su
Once you are root, install the binaries using the "make" command, followed by "install", like so:

Code:
make install

How can i play downloaded games on Linux?
Q. i have downloaded a game for Linux but it is not letting me play it when i try to open it.

A. Depends what format you downloaded.

In general do this first. If you are using an RPM based distro like Fedora, Suse, Mandrive install Kyum or Gnome Yum, add the repositories for your distro. Then search for the game. Once you've added the repositories there is no easier way to install software than the Yum GUIs.

If your using a Debian based distro like Ubuntu install Synaptics add the appropriate repositories then search for the game there. Again a painless install.

To find repositories just Google your distro and either yum or syanptics depending on your disto plus repositories.

For RPM based distros if you've downloaded an RPM then from the console cd to where it was downloaded. Use this command
rpm -Uhv [name of the rpm]
If you have an rpm and a debian based distro you'll need to install and use Alien.

If you have a tarball (ends with .tgz) then use this command from the console or use a GUI file manager like krusader to extract the archive. A tarball is basically a zip file but a differnt type of compression.
From the console.
tar -xzvf [name of the tarball]
cd [name of the tarball]
You'll see one of two different things usually. There will be a binary to install or there will be a configuration file. If there's a binary run it by typing ./[name of the binary] this will either be the executable for the application which you can just create a link in your path if that is the case or it'll be an installer.

Most of the time you'll do a make config. Use this process.
./configure
./make
./make install
notice the dot in front of the slashes. This is important.

Your welcome to send me a note to which game your trying to install and what distro your using and I can give you specifics on it.




Powered by Yahoo! Answers

No comments:

Post a Comment