• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

[Guide] Installing Programs In Linux

mohaas05

New Member
This tutorial is a basics to installing programs on Linux. Unlike Windows, installing programs under Linux is not as simple as launching an executable, but it is not all too complicated either.

Firstly, you should be operating as the root user. Otherwise, you will run into permission issues. Do this by either logging in as root or preferably, running this command from the terminal:

To use this guide, look for the section that pertains to the distribution that is yours or is the parent of yours.

Installing from Source

If you obtain a program in a .tar.gz or a tar.bz2 file, it most likely is in source code format and must be compiled. This method is favorable in that it works on all Linux distributions. It will also work on most Unix distributions like FreeBSD, however you should substitute "make" with "gmake" instead.

1.Navigate to the directory of the tarball and unpack it.

If it is a tar.gz file:
tar -xv <filename>

If it is a tar.bz2 file, add the -j argument:
tar -xvj <filename>

2. Enter the newly decompressed directory
cd <name of directory-most likely same name as tar file>

3. In there should be a file called "configure". This script checks to ensure that you have all the dependencies required for the program, then creates a makefile.

So execute the script:
./configure

If all goes well, the script should create a new file called "makefile"

4. Execute this to compile your program:


5. Finally, install the program:
make install


From RPMs

RPM (RedHat Package Manager or RPM Package Manager) is another popular way to distribute programs. They occurr in .rpm files.

NOTE: Make sure you do not download a .src.rpm file. This is different from a normal RPM file.


RPMs a simple to install, simply run this command
rpm -i <rpmfilename>

If you are upgrading a previously installed package, use the -U modifier instead:
rpm -U <rpmfilename>

To remove a package, use the -r modifier:
rpm -r <package>

if all dependencies are present, it should finish without error.

If there are dependencies, it will display a message similar to this:
<dependency> is needed by <package>

In that case, you will need to obtain those packages and install them before continuing.

Sometimes, you will also obtain two packages that depend on each other. When that happens, simply specify both rpms in your command:
rpm -i <rpmpackage1> <rpmpackage2>

Yum

Yum (Yellowdog Updater, Modified) is perhaps the easiest and best way to obtain packages. Not only is it easy, it also automatically downloads and resolves dependencies, something the other two methods do not do. There are programs similar to yum on some distros (such as apt-get) which may function differently but most aspects should apply. Unlike the first two methods, Yum requires an internet connection, so make sure your linux box is connected.

To install a program with yum, simply specify the name of it:
yum install <packagename>

For example, to install the program Firefox, type:
yum install firefox

If you are unsure of the correct name of the package you want, you can perform a search of the yum repository:
yum search <keyword>

Some programs, like XFCE, come in multiple packages. Rather than install them all individually, you can install all of those packages together with the groupinstall command:
yum groupinstall XFCE

To remove a package:
yum remove <packagename>

and for groupinstalled packages:
yum groupremove <package>


Note: You can also use package manager GUI frontends such as PackageKit, but in my opinion its easier and faster to just do it through the terminal.


up2date/Red Hat Network

This is an alternative package manager included with CentOS and older versions of RHEL and Fedora. In RHEL, it downloads packages from the Red Hat Network, a subscription based service that you normally get when you purchase RHEL. In CentOS, it merely downloads packages from yum repositories.

NOTE: As of Red Hat Enterprise Linux 5 and Fedora Core 5, up2date is no longer avaliable and is superseded by yum.

To install a package with up2date:
up2date -i <packagename>

To download a package without installing it:
up2date -d <packagename>

DEB files

The Debian software package format is another popular method of obtaining packages. Files packaged for it will have the .deb extension.

.Deb files install in much the same way as RPMs do.

To install:
dpkg -i <debfilename>

To remove:
dpkg -remove <package>


APT

The Debian cousin of yum, APT (Advanced Packaging Tool) is another powerful installer that also automatically resolves dependencies. It also works in much the same way as yum

To install a package:
apt-get install <package>

To remove a package:
apt-get remove <package>

If you are on Ubuntu, apt-get also allows to upgrade to the latest revision.

To update to the latest revision in Ubuntu:

NOTE: Before you perform this command, you need to replace your current Ubuntu revision's repository with the one of the version of Ubuntu you are updating to. The repository file is located in /etc/apt/sources.list
apt-get dist-upgrade

YaST

YaST (Yet Another Setup Tool) is another package management tool used by SuSE and OpenSuSE.

To install:
yast2 --install <package>


Emerge

Portage/Emerge is the package tool of Gentoo-based distributions.

To install a program:
emerge <package>

To remove a package:
emerge --unmerge <package>


To update your system:
emerge --update --ask world

and the best code ever...
Updating your entire system
emerge --update --deep world

Credits: Vanden for the YaST and Emerge portion.
 

Seth

MD Party Room
OR just you your local package manger...
 

Hardrive

Contributor
It's important to note that the RPM and yum parts will only work in Red Hat/Fedora based distros. Compiling from source should work on any Linux distro as long as the development tools are installed.
 

mohaas05

New Member
Yes I'm aware of that. I don't have any experience with other methods so it would be great if people could add on to this:
 

Hardrive

Contributor
I know that you knew that, I just thought it would be important for a first time Ubuntu user to understand this ;)

I'll add a Debian/Ubuntu guide and maybe a Arch Linux guide tomorrow.
 

mohaas05

New Member
Hardrive said:
I know that you knew that, I just thought it would be important for a first time Ubuntu user to understand this ;)

I'll add a Debian/Ubuntu guide and maybe a Arch Linux guide tomorrow.
Alrighty, added that in red bold font at the top. Maybe if Vanden wants to incorporate this into his guide after more stuff is added into his guide that would be cool too.
 

Seth

MD Party Room
IF you feel like it...


YaST(Yet another Setup Tool.)

yast2 --install <package>

Emerge
To install a program
emerge <package>

To remove a package:

emerge --unmerge <package>


Updating your system

emerge --update --ask world

and the best code ever...
Updating your entire system
emerge --update --deep world

I really like emerge the best...
 
Top