====== Installing Applications ====== **During the initial installation it is often best *not* to install too many applications along with the base-system. This document explains how programs can be installed as they are needed.** ===== What should be installed during the initial install? ===== During the first run of the installation you should install (of course) the base-system, the editor of your choice (or, if you don't know yet which one, you should be safe with vi, emacs and pico), and X11 along with a desktop environment (KDE or Gnome). While X11 and the desktop environment might not be strictly neccessary, there are systems that preconfigure those two components very well during the initial install, but might give new linux users a hard time if the configuration should be done after. ===== What should be installed later? ===== Well, just about everything else. The reason for this is that you get a running system quickly and install components as you need them. Your system will stay slim (hopefully :). So, the office-suite, the big browser, games and the like are perfect for a later run of the installer. After some installations, you get to know the distributions better and get a feeling about what to install first and what to install later. ===== Packages ===== Your distribution has a preferred way of packing all files needed for a program together to make it easy to install software. These packages usually include information on what other programs are needed to run the software you want to install. For example, the xclock package (which shows a clock in an X11-window) needs X11 to work. While this is still obvious, this technique is also used to break large projects into manageable chunks. KDE for example needs the kde-base package, but does not need kde-games, although people can choose to install those, too. This makes it possible to download and install only what you want. * The **RPM** (Redhat Package Manager) is used by many distributions (RedHat, Suse, Mandrake, ...). * **DEB** is the DEBian package format, which is used for all distributions that are based on Debian. * **.tgz** is the extension on Slackware packages. This should not be confused with the tarballs used for source code. A Slackware package contains binaries just as the RPM or DEB packages do. Since .tgz is a generic extension for zipped tar-archives, this extension is not as 'secure' as .rpm and .deb is. anyfile.tgz could also contain backups or sourcecode or just about anything that can be tarred an zipped. But then again, anyfile.rpm can also contain RealPlayer Media :) * **Tarballs**, archive files that are created with tar, are probably the oldest packages for software and are used by LinuxFromScratch or in order to have distribution-independant packages available. Tarballs usually carry the source-code of the software, so that they can often be used on other systems like Solaris or MacOS-X, too. * There is also the **ports-collection**. While ports are usually associated with BSD (a free variant of UNIX), some linux-distributions (like Gentoo) have adopted it. ===== Use the package manager! ===== Whenever possible, use the package-manager that comes with your distribution and packages that are made for this distribution. The package manager will do many things for you, like detecting and resolving dependencies and conflicts. It will help you to install, update and remove software. But it can only do so, if its database is current, that means the package manager "knows what is installed". So, use the regular probrams that come with your distributions (Yast for Suse, drake for Mandrake, dselect for Debian, ...). They are set up so that they access your CD/DVD or the source you have used for the install. Other sources can also be configured. If these front-ends are not what you want to use (maybe you have downloaded a whole bunch of RPMs and want to install them with one command), then use the appropriate command-line tool. Check the manpages for details on how to use "rpm", "dselect", "apt-get" and others ===== Installing binaries: RPM ===== To install a RPM that you have downloaded, you can do so by typing "rpm -i package.rpm" on the command line. Any unmet dependencies and conflicts are reported and have to be fixed before this will work successfully. See "man rpm" for more commands and details ===== Installing binaries: DEB ===== To find the package you want, use "apt-cache search whatever". Apt will search all sources specified in /etc/apt/sources.list and give you the exact name. Then a "apt-get install whatever" will download the package and install it. Apt will also offer to resolve all dependencies and conflicts for you. Works very nicely. See "man dselect" and "man apt-get" for more commands and details. If you have your Debian system on a slow Internet connection and find you have a large download needed for something like an upgrade, you can use apt-zip to get those files using a different computer that has a faster connection. See more on [[apt-zip]]. A signature check is done with apt-get. Explanation of how it works is here in Section 7.4 "Package signing in Debian": http://www.debian.org/doc/manuals/securing-debian-howto/ch7.en.html ===== Installing binaries: Slackware ===== * Locate and get the package. It might be on your Slackware installation CDROM. If not, then you might find it at [[http://linuxpackages.net/|linuxpackages.net]] or [[http://slackcare.com/|slackcare.com]]. If you can't find a Slackware package for your version of Slackware, then you may need to use the source code. Be sure to use **checkinstall** to install it if you do. * Package management - the basic tool here is **pkgtool**. Run that on the command line and you will get a menu. It allows you to install and remove packages and to view the list of installed packages. It also lets you run the config scripts that are done during installation. * Other tools for managing packages: * **installpkg** - If you don't have the package installed yet, run: \\ '' installpkg '' * **removepkg** - Remove an installed package \\ '' removepkg '' * **upgradepkg** - You already have a version and want to upgrade: \\ '' upgradepkg '' * View package listings the fast way: \\ '' ls /var/log/packages/ '' ===== Installing from source: Tarballs ===== **When installing tarballs, you leave the well-charted streets of your package-management**. So what comes in this section is mainly for those who "want to know what's going on inside". Anita has put together [[installing_applications#installing_from_source_using_checkinstall_and_the_package_manager|some fine instructions]] on using **checkinstall** in order to convert tarballs into packages that can be installed with the regular package-manager. James has put up a [[Installing WindowMaker|tutorial on how to install WindowMaker]] (which is one of the fancier Windowmanager for X11) . It is a nice example of the real steps neccesary for installing real applications. Tarball collections of files that are put together into one file using tar. Most of them are compressed using either **zip** or **bzip2**. So the possible file-extensions include * .tar.gz (tar'ed and gzipped) * .tar.bz2 (tar'ed and bzip2'ed) Both compression algorithms are included in the tar-binary, so extracting can be done with one command. * tar xfz tarball.tar.gz * tar xfj tarball.tar.bz2 After unpacking, enter the directory that has been created ("cd tarball") and read all available README or INSTALLING files that are relevant for your system. Follow the instructions in those files. Usually, these instructions boil down to - ./configure --with_options --depending --on_your_system \\ This configures the software and is the most important step. If you get the options wrong, your application will not work as expected. So read the documentation that comes along with the tarball! This step can be done as mere user. - make \\ This "builds" the program. Usually the source is compiled and linked. This step can be done as mere user. - su \\ The next step is usually done by root. - make install \\ This copies the fresh binaries into the directories where they are expected to be. Since this is usually something like /usr/bin or the like, only root can do this. **You can also install the software inside your home-directory if you do not have root-privileges on the machine. But then you need to tell ./configure in step one.** ===== Installing from source using checkinstall and the package manager ===== Installing packages using the package manager for your distribution of Linux is a very good idea. Your database of packages will stay up to date that way. If you don't keep the database up to date, you can find yourself trying to install something with the package manager and having it not install due to missing dependencies - programs you know are installed, but the package manager does not know! It also makes it much easier to find the files of programs or remove programs later. Package managers give you information on programs that you will not have it they have not been installed through that means. So, first be sure your distribution of Linux doesn't have the package. If you can't find the package, you can still use your package manager to install the program by using **checkinstall** to install from the source code. ===== Finding programs: ===== If you don't find the program you want on your chosen distro's homepage or cdrom check out our [[links:apps:start|Application Links]]. My favorite is Freshmeat.net. ===== Getting and installing 'checkinstall': ===== Get the stable source code or binary if you wish at http://asic-linux.com.mx/~izto/checkinstall/ You may find the program on your installation CDROM, but it is only a 88Kb download. I found it in Slackware on CDROM #3 under the "extra" directory. There are some notes there about using it with Slackware. Read the INSTALL file for how to install. That's very easy. /etc/checkinstall/checkinstallrc holds the configuration. That is where the type of package is set to S, D, or R for Slackware, Debian, or RPM. ===== Install programs using checkinstall: ===== * The README file in the source code for //checkinstall// gives you the detailed instructions on using it. Basically it is as follows: * Download source - usually in the form of a tarball with extension ".tgz" or some other extension indicating that it is zipped. * Unpack the tarball. This can be done in your user directory or in a special directory you have for this purpose. Make a separate directory for the package just in case the zip does not produce its own directory. Most of them will, but when you get one that does not, you can have files strewn about your directory mixed in with other files and deleting them is a pain. * If you have a ".tgz" or ".tar.gz" file use: \\ '' tar xzvf filename.tgz '' * If you have a ".bz2" file use:\\ ''tar xjvf filename.bz2'' * Compile * Read README or INSTALL. One of these should contain the instructions for compiling. This can be done by mere user. No need to be root for this. * The usual instructions are:\\ '' ./configure\\ make '' * Do not do ''make install'' because you are going to do the installation with your package manager via //checkinstall//. * Use //checkinstall// * ///bin/su// to get root privilege for the installation * //checkinstall// - this needs to be done while you are still in the source code directory where you compiled. * You will be asked a few questions like the name you want to give the package. Then the package will be made, deposited in the source code directory, and installed. You can save just the package - I keep mine in /var in a special directory I have for such things - and then you can delete the source code directory and the original tarball. ---- Created by stwaidele