Home Page
Linux Basics Debian Linux Installation Using Debian Packages Linux Modem Setup Setting Up A Network Setting Up DNS Servers Linux Internet Servers Linux LAN Servers Linux Database Server Linux Syslog Server Linux Fax Server Linux Web Cam Servers Linux Proxy/NAT Servers Linux Firewall Servers Linux Security Compiling Linux Programs Home Automation What Now?


Using Debian Linux Packages


"Packages" are software. A package can be a workstation-type program (mozilla Web browser, gimp graphics editor, etc.), a server-type program (Apache Web server, Sendmail e-mail server, etc.), a utility (apcupsd for APC UPSs, taper backup utility), programming libraries, or OS components (GUIs, language modules, even kernel patches). You can download and install software which isn't "packaged". It's just that when software is put into a package it makes it easier to install because programs are already compiled (binary), directories are created if necessary, and all files (binary executables, text configuration files, man pages, etc.) are put into the proper directories. Some packages even have configuration scripts that are run near the end of the package installation to help you initially configure the software.

A "package manager" is used to search for, install, remove, etc. packages. Red Hat's package manager uses .rpm files. Debian's package manager uses .deb files. As you will see below, a package manager isn't always a single program but several utilities used to perform the various package-related functions (search, install, etc).

Note:  The software in one package may need software from another package to work properly. One of the best things about Debian's package architecture is "automatic dependency resolution", i.e it will automatically load any packages that selected packages may depend on. It may also remove other packages that could cause conflicts. This is why the number of installed packages may be greater than the number of packages you select to install.

If you've ever tried installing packages using Red Hat Package Manager (RPM) you've likely found it a frustrating experience due to the "failed dependencies" errors commonly encountered when trying to install an RPM package. This is because Red Hat's package manager doesn't automatically take care of dependencies like Debian's package manager does.
Working with packages in Debian uses three main utilities:


You may recall being prompted to insert all the discs during the installation so that they could be scanned for available packages. This scan process builds a library of available (on the discs) packages which is used by these package utilities. When you install or remove a package this library is referenced and updated.

The library tells the system what packages are available but not where they're available from. For that we have the /etc/apt/sources.list file which lists the locations of package files. These locations include the DVDs you inventoried (scanned) during the installation routine and also has entries for various Internet servers from which you can retreive updates.
NOTE:  By default the sources.list file enables an Internet server for updating our package library with version information. However, since we installed Debian using DVDs we do't want that version information updated yet. (We show you how to properly update and upgrade packages on the Security page.) We have to comment out this default statement to temporarily disable the use of the Internet server. Open the sources.list file using the nano text editor with the command:

nano /etc/apt/sources.list

Look further down the file for the line that starts out with:

deb http://security.debian.org/

and type a # character at the beginning of this line to comment it out so it looks like this:

#deb http://security.debian.org/

If there's a similar line below it that starts out with deb-src you can comment that one out too. Exit the text editor and save the changes by pressing Ctrl-X, y, and then Enter.

Now let's sync our package library database with updated sources file with the command:

apt-get update

A complete list of the current "stable" Debian packages (including free and non-free) can be found at:

packages.debian.org/stable/

apt and dpkg are useful if you have some idea of what you're looking for. For example, apt has a search utility where you can search for software by its given name such as 'apache' or you can search for all available packages containing software offering specific functionality such as 'sniffer', 'dns', etc.

Because Debian comes with so many packages, it's often a good idea to just browse through all of the available packages to see what software you can install and play around with. To get a full listing of packages and their installation status we use dselect. As mentioned, dselect is more of a front-end, user interface tool because when you select a menu item in dselect you are simply running one of the apt or dpkg utilities with a specific set of command-line switches.

Although useful for browsing all available packages, dselect will not be your primary package management tool. You can search for, and install, packages much faster using the apt utilities. However, we wanted to show you how to use dselect because half the fun of playing around with Debian is playing around with some of the tens of thousands of packages that comes with it.

Using dselect Top of page

dselect has a 7-step menu (numbered 0 through 6) and it will walk you through the steps. There are two different "modes" that you can use when retreiving packages. One is "Access" mode where additional .deb files are retreived and added to your library. "Update" mode is where no new packages are retreived but any updates to existing packages (newer versions of whats already in your library) are etreived. dselect doesn't get installed automatically in later versions so make sure it's installed with the command:

apt-get install dselect

You may see a few errors about UDF-fs but you can disregard those. They typically apply to the type of media used for manually-burned DVDs. If the version of Debian you're using installed it automatically you'll see a message saying it's already installed.

To use dselect:

Type in dselect at the shell prompt and the menu screen will be displayed. The possible selections are:


Try out the software you just installed. Back at the shell prompt, type in:

cpuid | more

to display information, including register contents, about the CPU chip in your system. The | more part of the command just pauses the displayed output of the command at each 25 lines with --More-- at the bottom of the screen. Press the Space Bar to see the next screen.

dselect showed you what packages were installed on your system during the install routine but there's another way. You can use the command:

dpkg -l | more

That's a lower-case L for "list" and rather than grouping the installed packages in functional areas it lists them alphabetically. apt and dpkg have a lot of command-line options and viewing the man pages for them will provide you with more information.




Using the apt Utilities Top of page

The apt utilities (there are several such as apt-get, apt-cache, etc.) can retreive packages from DVDs or the Internet via http or ftp. You can update your entire system via an Internet connection which is why it's beneficial for your system to have some means of accessing the Internet. This is especially true for Internet server systems as you will want to regularly apply security updates (we'll show you how to do this later in this page).

The apt utilities are command line utilities and, as you saw above with the dselect installation, installing a package is very easy provided you know the exact package name. Most of the time you don't. But there is an apt utility that will help with that too.

Lets say you want to set your system up as an FTP server. How do you find out what packages are included with Debian that would allow you to do that and what the package name is? You can use the apt-cache command with the search option like so:

apt-cache search secure ftp server

When the listing is complete the shell prompt will reappear and in the list you'll see

vsftpd - lightweight, efficient FTP server written for security

which looks like what we want. (The 'd' at the end of the package names stands for daemon.) We can get more information about this package with the command:

apt-cache show vsftpd | more

Now that we know that this is the program we're looking for and we know the name of the package, we can use a simple apt command to install it. apt will automatically install any dependency packages also. To install it just type in:

apt-get install vsftpd

to start the package installation. The command will display the packages it will install. This will include the package you specified in the command plus any "dependencies" (other packages that the package you specified depends on to work). It will also display how much hard-drive space will be used and prompt you if you want to continue. Note that at the end of the prompt is an uppercase 'Y' and lowercase 'n' to let you know that 'Y' is the default answer.

You will be prompted to put DVD #1 in the drive and (wait a few seconds for the disc to mount) and press Enter and the package will be installed.

Again, the same prompt reappears but look closely because it may not be the same prompt. After a few of the packages have been installed notice that a reappearing prompt is actually asking you to insert a different disc. That's because the packages listed for installation aren't all on the same disc.
NOTE:  When you install a package and it calls for multiple discs your installation may end with 'dpkg' errors. However, if you look a little further up in the text you'll see that most of these errors are reporting that a package was already installed from one of the earlier discs.
Don't be concerned about ssl-cert, etc. errors at this point.

Your system is now an FTP server! Because this installed the FTP server daemon, it'll start automatically every time you boot your system.

If your Debian server is on a network (and provided you can ping other systems on the network) it's easy to check out. Just go to another system (Linux or Windows) on the same network and at a command prompt enter (assuming the IP address of your Debian system is 192.168.10.10):

ftp 192.168.10.10

You'll be prompted for a username. You can't FTP using the root account. That's because with the FTP protocol everything, including the username and password you enter, is sent over the wire as clear text. Enter the username and password of the account you set up during the Debian installation and you'll see a message that the user is logged in. (You'll also see some info pop up on your Debian PC's screen indicating someone logged in.) By default, vsftpd drops you into the home directory of the user you logged in as. For now just type in quit to close the FTP session.

So what if you don't really want your system to be an FTP server? The command:

apt-get remove vsftpd

would remove the program files from your system, but it would leave the configuration files. In order to remove everything associated with it you need to use the command

apt-get --purge autoremove vsftpd

You'll want to keep vsftpd installed however, so we can transfer files to and from your server. If you are going to set up a system as an Internet server that does offer FTP services, be sure to use the /etc/vsftpd.conf file to increase the security of your FTP services.

We also want to be able to telnet into the system so we have to install the telnet server daemon. Enter the following command:

apt-get install telnetd

You should be able to telnet into your system now. You can verify that but opening a command prompt on a Windows system and entering the telnet command followed by a space the IP address of your new Debian system. Example:

telnet 192.168.10.50

You should get a Linux login prompt. Simply press Ctrl-C to close the connection without logging in.
Note:  The apt-get command has a lot of options for checking packages, resolving dependencies, etc. that we don't cover here. It would be worth your while to check out the man page or Web references to learn more about all this command can do.
You're going to get good at installing packages because we do that a lot on our guide pages. Now that you know how you can move on and start setting up your Debian system with server applications.




Did you find this page helpful ?
If so, please help keep this site operating
by using our DVD or book pages.



Site, content, documents, original images   Copyright © 2003-2016   Keith Parkansky   All rights reserved
Duplication of any portion of this site or the material contained herein without
the express written consent of Keith Parkansky, USA is strictly prohibited.

This site is in no way affiliated with the Debian Project, the debian.org Web site, or
Software In The Public Interest, Inc. No endorsement of this site by the Debian Project
or Software In the Public Interest is expressed or implied. Debian and the Debian logo
are registered trademarks of Software In The Public Interest, Inc. Linux is a registered
trademark of Linus Torvalds. The Tux penguin graphic is the creation of Larry Ewing.

LIABILITY

IN NO EVENT WILL KEITH PARKANSKY OR BLUEHOST INCORPORATED OR ANY OF ITS' SUBSIDIARIES BE LIABLE TO ANY PARTY (i) FOR ANY DIRECT, INDIRECT, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF PROGRAMS OR INFORMATION, AND THE LIKE), OR ANY OTHER DAMAGES ARISING IN ANY WAY OUT OF THE AVAILABILITY, USE, RELIANCE ON, OR INABILITY TO USE THE INFORMATION, METHODS, HTML OR COMPUTER CODE, OR "KNOWLEDGE" PROVIDED ON OR THROUGH THIS WEBSITE, COMMONLY REFERRED TO AS THE "ABOUT DEBIAN" WEBSITE, OR ANY OF ITS' ASSOCIATED DOCUMENTS, DIAGRAMS, IMAGES, REPRODUCTIONS, COMPUTER EXECUTED CODE, OR ELECTRONICALLY STORED OR TRANSMITTED FILES OR GENERATED COMMUNICATIONS OR DATA EVEN IF KEITH PARKANSKY OR BLUEHOST INCORPORATED OR ANY OF ITS' SUBSIDIARIES SHALL HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT, OR OTHERWISE; OR (ii) FOR ANY CLAIM ATTRIBUTABLE TO ERRORS, OMISSIONS, OR OTHER INACCURACIES IN, OR DESTRUCTIVE PROPERTIES OF ANY INFORMATION, METHODS, HTML OR COMPUTER CODE, OR "KNOWLEDGE" PROVIDED ON OR THROUGH THIS WEBSITE, COMMONLY REFERRED TO AS THE "ABOUT DEBIAN" WEBSITE, OR ANY OF ITS' ASSOCIATED DOCUMENTS, DIAGRAMS, IMAGES, REPRODUCTIONS, COMPUTER EXECUTED CODE, OR ELECTRONICALLY STORED, TRANSMITTED, OR GENERATED FILES, COMMUNICATIONS, OR DATA. ALL INFORMATION, METHODS, HTML OR COMPUTER CODE IS PROVIDED STRICTLY "AS IS" WITH NO GUARANTY OF ACCURACY AND/OR COMPLETENESS. USE OF THIS SITE CONSTITUTES ACCEPTANCE OF ALL STATED TERMS AND CONDITIONS.