Thursday, March 5, 2009

Installing slackware packages

Slackware packages are usually .tgz files containing pre-built binaries. To install software in slackware you will need to find and download the .tgz package manually beforehand. If you are looking for a slackware package for a piece of software and have not found it yet, search Linux Packages for it.

Ok, once we have our package, lets install it. To install slackware packages, ensure you are the root user using the su command:

Now run the following command to install the package:
installpkg packagename.tgz

Uninstalling a package is also quite simple:
removepkg packagename

Also worth noting about slackware packages, is a utility called pkgtool which will allow you to install, remove and list packages on your system. To use pkgtool, run:
and follow onscreen prompts.

Lastly, if you are having trouble locating a slackware package, but have been able to find a equivilent RPM, you can "convert" that RPM to a slackware package which you can use with the installpkg and removepkg commands. To convert your RPM to .tgz, use the command:
rpm2tgz packagename.rpm

Installing with fedora / yum

Most of the same commands used with Debian's apt-get are used with yum, such as

yum install
yum remove
yum update

Installing Binary Files and Scripts (.BIN/.SH)

For BIN files:

1. Make sure the file is set to "executable" by running this command:
chmod +x filename.bin

2. Run the file like this:

NOTE: If the installer requires access to directories outside of your /home/ directory, you may need to log in as root before you can execute these commands successfully. That can be accomplished with the su command, followed by your root (Administrator) password. Ubuntu users will use sudo and their regular user password instead.

For .SH files:

1. Make sure the file is executable by following Step 1 above.
2. Run the file either with the same command as the previous Step 2, or like this:

Direct installation using apt-get

APT (Advance Packaging Tool) is a wonderful package management system. It consists of different tools, which names usually begins with "apt-" : apt-get, apt-cache, apt-cdrom, etc. Unlike RPM, which equivalent in a Debian system would probably be DPKG, apt-get handles dependencies resolution and takes care of downloading the software for you (much like YUM in a Red Hat system).

Aptitude is a terminal-based apt frontend with a number of useful features, including: a mutt-like syntax for matching packages in a flexible manner, dselect-like persistence of user actions, the ability to retrieve and display the Debian changelog of most packages, and a command-line mode similar to that of apt-get. One should use aptitude to install meta-packages because aptitude keeps log of all packages that are part of meta-package. Its easy to remove/un-install meta-package if one go with aptitude.

One must have root privileges to execute apt-get or aptitude commands. Execute 'su' or add prefix 'sudo' to gain root privileges.

Installating a binary package is done in one single step :
apt-get install package //Exact package name will be required

Uninstalling a package is done like this :
apt-get remove package

Or if you wish to remove the package along with all of its configuration files (essentially doing a clean uninstall):
apt-get remove --purge package

Note: A word of caution : apt-get handles dependencies in a very strict manner. If you try to uninstall a piece of software that other pieces of software depends on, apt-get will also want to uninstall them (not before warning you about the situation).

There are many other features of apt command, it comes with a built in tool package for building, compiling e.t.c.Just have a look. Once the user has a sources.list adapted to his/her needs, the local list of packages needs to be updated :
apt-get update

Only then can the repositories be browsed with apt-cache.
To search a package from its text description :
apt-cache search something

To know more about a package and its description (dependencies, functionnalities, maintainer's identity, etc.) :
apt-cache show package

Another neat feature of apt-get : it allows to build and install a source package. Minimally, two steps are needed in order to do that. First install the package dependencies :
apt-get build-dep package

Secondly tell apt-get to build and install the package itself :
apt-get source -b package