430 CHAPTER 29 (Msn web hosting) INSTALLING SOFTWARE DECODING PACKAGE

March 14th, 2008

430 CHAPTER 29 INSTALLING SOFTWARE DECODING PACKAGE FILENAMES Although the filenames of packages might seem like cryptic mumbo-jumbo, they actually tell you a great deal about the file. Let s take a look at the package file of the Eye of GNOME image viewer to explain this: eog_2.12.1-0ubuntu2_i386.deb The first element of the filename is the name of the program. In this case, Eye of GNOME has been abbreviated to eog. Abbreviations like this are quite common because they decrease the length of the filename. But it s important to note that they will be consistent. For as long as Eye of GNOME is supported as a package under Ubuntu, its package filename will always begin with eog. Following the name of the package is the version number of the program in question: 2.12.1-0. This is the version number that will appear if you click Help . About when the program is running, and is the version number decided on by the developer who created the software. After the version number is the word ubuntu, which indicates that this is a package that s been created specifically for the Ubuntu distribution of Linux. Then you see the build version number of the package: 2. This is Ubuntu s own version number, indicating how many times the package has been built (created) by the Ubuntu team. Sometimes, it s necessary to release an updated build of the same version of a program in order to correct an error that was accidentally introduced in the last build version. Sometimes, the program is patched by the Ubuntu team in order to support a new function. After the version numbers is the platform on which the package will run. In this case, i386 indicates that the package will run on all x86-based processors from the 80386 upwards (the 486, Pentium, Pentium II, AMD processors, and so on). Sometimes, you might see i686, which means that the package has been optimized for Pentium Pro chips and above (Pentium II, III, IV, and AMD s Athlon range of chips). If the package is created for 64-bit desktop processors, then amd64 will appear there. Optimized versions of packages for particular processors are used only when they might bring a performance boost. For example, there are i686 versions of the Linux kernel and the libc6 library. But it s rare for ordinary programs, like OpenOffice.org, to be optimized. This means the majority of packages that are used under Ubuntu have the i386 designation. Installing from Source Back in the old days of Unix, the only way to install software was from source code, a process known as compiling. This was because most people edited the source code themselves, or at least liked to have the option of doing so. Nowadays, innovations such as the Debian package- management system make compiling all but redundant for the average user. But knowing how to compile a program from source is still a good Linux skill to have. In some cases, it s your only option for installing certain programs because you may not be able to find a packaged binary. It goes without saying that program compilation is usually handled at the command prompt. It s not the kind of thing you would do via a GUI program. Installing the Compiler Tools Before you can compile from source, you need to install several items of software: the make program, which oversees the process of creating a new program, and the GNU Compiler Collection (GCC), which does the hard work of turning the source code into a binary. In addition,

CHAPTER 29 INSTALLING SOFTWARE Querying Packages and (Web hosting rating)

March 13th, 2008

CHAPTER 29 INSTALLING SOFTWARE Querying Packages and Repositories To search the repository databases for particular software packages, use the apt-cache command: apt-cache search packagename Both descriptions and package names are searched. You can also find out about dependencies using apt-cache: apt-cache depends packagename |less Once again, it s a good idea to pipe the output into less because the dependency list may run off the screen. You can read the program description for a package file by typing the following: apt-cache show packagename |less None of these commands makes a distinction between packages that are installed or otherwise you re accessing the details held in the repository databases. Before searching for packages, it s a good idea to make sure you have the latest package lists from the databases (the equivalent of clicking the Reload button in the Synaptic Package Manager). To refresh the lists, use this command: sudo apt-get update You should see output similar to that in Figure 29-7. Figure 29-7. Before searching for new packages, use the apt-get update command to ensure your package database is up-to-date.

428 CHAPTER 29 (Zeus web server) INSTALLING SOFTWARE Note You

March 13th, 2008

428 CHAPTER 29 INSTALLING SOFTWARE Note You can specify two or more programs to be installed and/or removed at the same time. Just separate the package names with a space: apt-get install package1 package2 package3, and so on. It s a similar situation when it comes to uninstalling software. For example, suppose you tried to remove the Firefox web browser, like so: sudo apt-get remove firefox apt-get would also mark for removal gnome-app-install and yelp, two packages that depend on the browser. But before doing anything, it will tell you what it is about to do and ask you to confirm it. Similarly, if you tried to install the AbiWord word processor, like so: sudo apt-get install abiword-gnome You would be informed that two additional packages need to be installed: abiword-common and libenchantlc2. They would be automatically added to the list of packages that were to be installed. As with the Synaptic Package Manager, apt-get will also list suggested and recommended packages that will complement the software you wish to install but aren t vital. However, if you wish to install those packages, you ll need to do that later in a separate apt-get command. Tip An alternative to the command-line APT tools is aptitude. This can be used like APT tools such as apt-get, but can also take into account suggested and recommended packages. For more information, see its man page. Updating the System apt-get can also perform various types of system updates. To update all the packages on your system to the latest versions contained within the repositories, type the following: sudo apt-get upgrade This is the command-line equivalent of using the Software Updates function of the Ubuntu desktop. To upgrade the system to the latest version of Ubuntu, if there is one, type this: sudo apt-get dist-upgrade Perhaps it goes without saying that updating your system can take a long time, depending on the number and size of files to be downloaded. In addition, each package will need to configure itself during installation, and this can also take a long time.

CHAPTER 29 INSTALLING SOFTWARE Note If while

March 12th, 2008

CHAPTER 29 INSTALLING SOFTWARE Note If while using dpkg or APT you get an error message along the lines of, Can t get a lock, make sure that the Synaptic Package Manager program isn t open. Only one piece of software can access the package database at any one time. Installing and Removing Packages The most basic APT command is apt-get. You can use this command to install or remove packages contained within the repositories as follows: sudo apt-get install packagename sudo apt-get remove packagename You should specify the program name without the version number. To install the links web browser, for example, you just need to type the following command: sudo apt-get install links Figure 29-6 shows the results. As you can see, apt-get will check dependencies, download the software, and then install it. It s a much better way of working compared with dpkg. Figure 29-6. You can use apt-getto install, remove, and update packages at the command line.

426 CHAPTER 29 (Business web hosting) INSTALLING SOFTWARE Uninstalling Packages

March 11th, 2008

426 CHAPTER 29 INSTALLING SOFTWARE Uninstalling Packages To remove a package, type the following: sudo dpkg -r packagename Note that you simply need to type the name of the program, without its version number or the .i386.deb file extensions. In this case, dpkg is slightly better behaved than when installing software. If there any reverse dependencies (other packages that depend on the one you re trying to remove), you ll be stopped in your tracks with a couple of error messages. You ll need to resolve the reverse dependencies first but, of course, they might also have their own reverse dependencies . . . Welcome back to dependency hell! Note The dpkg -r command will remove the package but leave behind its configuration files. This is handy if you install the software again in future. In order to remove the configuration files in addition to the software, type sudo dpkg -P packagename. Querying Packages dpkg includes a couple of query facilities that display details about packages. You can find out if a package is installed by typing this: dpkg -l packagename If you want to find out every bit of information about an installed package, including what dependencies it has, use the following command: dpkg -s packagename |less This example pipes the output of dpkg into lessso you can read it more easily, because it s likely to fill several terminal window screens. You can also use dpkg to query an installation file you ve just downloaded: dpkg -I packagename.i386.deb |less All said, dpkg is an often undervalued tool that s capable of some handy low-level package- management tasks. Take a look at its man page to learn more. Using the APT Tools dpkg is the only option if you want to install a package file you ve just downloaded. However, if you wish to use software repositories, you ll need to use the APT tools. These still use dpkg in the background to install and remove packages, but they also feature intelligence to handle dependency management.

CHAPTER 29 (Web site hosting) INSTALLING SOFTWARE 425 You must

March 11th, 2008

CHAPTER 29 INSTALLING SOFTWARE 425 You must specify the entire filename, rather than just the name of the program. dpkg is quick and dirty, and although it will warn you about any dependency issues, it will still go ahead and install the package. After installation, it will run the package s configuration scripts. But if there are missing dependencies, it won t be able to configure the program to work on your system, because it probably won t be in a usable state, as shown in the example in Figure 29-5. Figure 29-5. dpkg will warn about missing dependencies but will still install the package. If this situation arises, it s up to you to install the dependencies that dpkg lists. Of course, some of these will have their own dependencies, which will also need to be installed. This cascade situation is informally known as dependency hell and is the main reason why the APT system was invented. As you ll see in the next section, APT effortlessly handles dependency issues like this. If the dependencies aren t met after a dpkg installation, whenever you run the Synaptic Package Manager or attempt to use the APT tools, you ll be told of broken packages or unmet dependencies. APT will refuse to install any other software until the problem is fixed. Tip Within the Synaptic Package Manager, you can click the Custom button at the bottom left and then click the Broken entry in the filter list in order to see any packages that have unmet dependencies. To repair the damage, click the check box of the package in question and then click Mark of Reinstallation. At the console, you can type sudo apt-get -f install. This will install all of the missing dependencies on the system.

424 CHAPTER 29 INSTALLING SOFTWARE Removing Software (Free web servers)

March 9th, 2008

424 CHAPTER 29 INSTALLING SOFTWARE Removing Software To remove a piece of software, search for it by name, then click the check box alongside it, and then select Mark for Removal. This will remove the software but leave behind any configuration files it created. This means you can install it again in the future, and it will function as it did before removal. However, you can also select Mark for Complete Removal, which will remove the configuration files. As with installing software, the Synaptic Package Manager will attempt to manage depen dencies when you remove software, but in this case, it will enforce the removal of any software that explicitly relies on that software. This isn t an issue most of the time, but unfortunately, some packages have major reverse dependencies. For example, if you decide that you ve had enough of the Base database program and want to remove it, you ll find that you ll also need to remove the entire OpenOffice.org suite, as well as the ubuntu-desktop metapackage. Sometimes, packages have what seem like weird dependencies. For example, if you try to remove the Firefox web browser, you ll see that you need to remove the seemingly unrelated gnome-app-install package, as well as yelp, the GNOME online help system. The reason for this is that both these packages use a component of Firefox in some way and simply can t func tion without it. There isn t a hard-and-fast solution for situations like this. However, in many cases, you might simply choose to not remove the software and leave it on your system. Package Management from the Command Prompt Synaptic is one of the best examples of package-management programs around, and there s little reason to shun it and choose to install packages from the command line. However, you may find occasions to use dpkg or the APT tools. For example, if you re already working at the command line, then this method is quicker than starting up the Synaptic Package Manager. Using dpkg The most basic package-manipulation command is dpkg. dpkg allows you to perform a lot of package-related tasks, such as build packages from scratch. Here, we ll look at just simple package installation, removal, and query functions. Note dpkg requires superuser powers to install or remove software, so must be preceded with sudo. But it can be run without superuser powers if you simply wish to query the package database. The same is true of the APT tools discussed later. Installing Packages dpkgis useful when you ve already downloaded a specific .deb package and would like to install it. Here is the command: sudo dpkg -i packagename.i386.deb

CHAPTER 29 INSTALLING SOFTWARE Figure 29-4. Before

March 8th, 2008

CHAPTER 29 INSTALLING SOFTWARE Figure 29-4. Before any software is installed by the Synaptic Package Manager, you ll be told what it is and asked to confirm the choice. METAPACKAGES Software such as the GNOME desktop actually consists of a number of programs and system libraries, rather than one single piece of software. Therefore, you might be wondering how, as just one example, you might install the KDE desktop under Ubuntu 5.10. Is it necessary to install each component s package manually? In theory, dependency management should be able to help, and you should be able to select one key part of the KDE desktop system, such as the Konqueror file browser, and have the Synaptic Package Manager take care of the rest. After all, Konqueror will be dependent on other KDE packages. Alas, this rarely works in reality. Installing Konqueror in this way will indeed install much of the KDE desktop suite, but not everything. Konqueror isn t reliant on Kate, for example, which is the default text editor under KDE. Perhaps more important, although the packages will be installed, there s no guarantee that they ll be configured to work correctly as a desktop environment. Metapackages provide the solution. These are packages that contain configuration files to ensure the full range of software is installed and configured correctly, and they also have extensive lists of dependencies that include the complete set of packages for the software in question. (For what it s worth, the metapackage for KDE is kdebase.) Alongside desktop suites, other examples of Ubuntu metapackages include the OpenOffice.org office suite, where the metapackage ensures all the components of the suite can be easily installed, and the X.org graphical subsystem. To see what metapackages are available, simply search for metapackage using the Synaptic Package Manager.

422 CHAPTER 29 INSTALLING SOFTWARE One use (Crystaltech web hosting)

March 7th, 2008

422 CHAPTER 29 INSTALLING SOFTWARE One use of filtering is to remove the check alongside Installed so that you can remove from the search list any packages that might be already on your system. By clicking the Section tab, you can opt to search for only certain types of programs, such as those that are categorized as graphics programs or those that are categorized as communications packages (hold down the Ctrl key to search more than one package at once). Note Filtering can help reduce the number of search results if you use a generic search term, but don t forget to deactivate it when you ve finished. Click All at the top of the filters list, or simply click the Search button at the bottom left, to deactivate the filters. Installing Software When you click the check box next to a piece of software in the search results and select Mark for Installation, you ll be informed of any uninstalled dependencies that the program needs and asked to confirm their addition to the list of packages to be installed. If you right-click the file and selecting Mark Suggested for Installation or Mark Recommended for Installation, you ll see a list of programs that, although not essential to the running of the program in question, will enhance its features to some degree. For example, if you choose to install the mutt e-mail program, it s also recommended that you install locales and mime-support, so Mutt will have multiple language support and will be able to better handle file attachments. You don t have to install these recommended programs; the software will run fine without them. But it can often be rewarding if you do so. Note If the software in the recommended and suggested lists is grayed out, that means it s already installed. This happens frequently because recommended or suggested software is often required by other packages. After you ve made your selection of software (bear in mind that you can install more than one piece of software at once), click the Apply button on the toolbar. You ll see the Summary dialog box, as shown in Figure 29-4. Here, you re once again asked to confirm what needs to be installed. If any software needs to be removed in order to meet dependency issues, you ll be told about this, too. Additionally, you ll be shown the total size of the files that will be downloaded, as well as the anticipated impact on your hard disk in terms of size after the programs are installed. At the very bottom of the Summary dialog box, you ll see a check box marked Download Package Files Only. As it suggests, this will download but not install the packages. If you then select the package for installation again in the future, you won t need to download it, and installation will be instantaneous (unless a newer version of the package has been released; in which case, the newer version will be downloaded and installed).

Cheapest web hosting - CHAPTER 29 INSTALLING SOFTWARE minutes on a

March 7th, 2008

CHAPTER 29 INSTALLING SOFTWARE minutes on a slow connection, but it ensures that you have access to the latest software within the repositories. To search for software, you can click any entry in the list of packages and simply start typing. This will match what you type against the package names in the list. Alternatively, you can click the Search button the toolbar. By default, this searches through both package names and the descriptions, for a higher chance of a match. You can either type the specific program name or a keyword that may be within the description. For example, if you were looking for graphics drivers for your ATI Radeon card, but you didn t know the name of the package that contains them, you could type radeon. Tip You don t need to type whole words in the search field. You can type part of a word or, more commonly, the word in a shortened or alternate form. For example, if you re looking for an e-mail client, it might be more fruitful to simply type mail client, or even just mail. This will then return results containing e-mail, mail, mailing, and so on. By clicking the Settings . Filters button, you can enhance your search by filtering out any packages that don t meet your requirements. It s advisable to click the New button to create your own filter before starting, as shown in Figure 29-3, rather than editing one that s already there. To apply a filter to search results, click the Custom button at the bottom left and then click the name of your filter in the list. Figure 29-3. Filters can be used to trim the list of search results according to certain criteria.