Menu

The QND Guide to Starting Programs at Boot

Many programs, such as CUPS, samba, Canna and the like are programs that you wish to start running when the machine boots. Most operating systems have their own way of doing this. This QND guide covers how to do it in various Linux distributions, as well as FreeBSD and NetBSD.

In a pinch, one can always add a line to their /etc/rc.d/rc.local file (sometimes /usr/local/etc/rc.d, and sometimes /etc/rc.local) giving the full path to the program. For instance, if you install cannaserver from the vanilla version we provide, (see the QND Guide to Using Japanese in *nix) you could simply add the following line to ArchLinux’s /etc/rc.local

/usr/sbin/cannaserver

However, as most distributions provide a way to more gracefully do this, it is worth learning.

RedHat

RedHat (and we are including Fedora in this) has a simple ncurses program called ntsysv. If you type

ntsysv

at a command prompt, a dialog comes up with various services. Hitting the space bar while a particular service is hightlighted will add or remove an asterisk from it, determining whether or not it should be started at boot.

They also have a little program called chkconfig. The syntax is as follows, using sendmail as an example

chkconfig --level 35 sendmail on

To stop it from running at startup simply change the on to off. The level part of the command refers to run levels–in RH level 3 is multiuser non-graphic and level 5 is graphic.

Slackware

Slackware has an /etc/rc.d/rc.M file. A sample from it goes

if [ -x /etc/rc.d/rc.sendmail]; then
. /etc/rc.d/rc.sendmail start
fi

So, one can add a program to this. Again, going back to our cannaserver program, one can simply add the lines

if [ -x /usr/sbin/cannaserver]; then
. /usr/sbin/cannaserver
fi

If one looks at the file, they can see other examples. There are other ways to do it, including echoing “Starting the cannaserver” before starting it, etc.

Gentoo

When a package is emerged in Gentoo, one can usually simply add it with the rc-update command. Canna is one of those that can be added. In this case

rc-update add canna default

ArchLinux

ArchLinux has an /etc/rc.conf file. In there is the line

DAEMONS=(!pcmcia network crond inetd)

One simply adds the daemons they want run at boot to that line. For example, if you want the sshd daemon to run at boot, change that line to read

DAEMONS=(!pcmcia network crond inetd sshd)

(Note that putting ! in front a daemon’s name disables it–for example, in the default the pcmcia daemon is prefixed with a !, meaning it will not start at boot).

FreeBSD

FreeBSD puts most programs that don’t come with the base system into either /usr/local/bin or /usr/X11R6/bin. In almost all cases, a FreeBSD port also installs a script in /usr/local/etc/rc.d. One will usually, after installing canna for example, find that a little shell script starting the daemon is in /usr/local/etc/rc.d. Continuing with our canna example, one finds that as long as it was installed from ports, there is a script in there called canna.sh.sample. If you wish canna to run at boot, simply remove the “sample” from it.

cd /usr/local/etc/rc.d
mv canna.sh.sample canna.sh

Recently, many of the /usr/local/etc/rc.d script will have commented instructions that one should add a line to /etc/rc.conf. For example, with samba, one adds

samba_enable="YES"

so one should take a quick look at the .sh script to see if this is necessary.

NetBSD

NetBSD is quite similar to FreeBSD in this respect, however the startup script is usually found in
/usr/pkg/local/rc.d

It is hoped the above will enable you to get a program to run at boot without problems.

The Quick-N-Dirty Guide to fdisk

The aim of this QND guide is to get you up and running quickly with fdisk. There will be far more how than why here.

Although most distros usually have their own graphical partitioning tools, it is good to be familiar with fdisk. One never knows when they may have to use it–sometimes graphical tools don’t work properly.

Many, if not most, distributions also now have cfdisk which is somewhat easier to use. However, there are times when cfdisk too, won’t work and fdisk will.

1.) Do you have fdisk?

You should definitely have fdisk available. If not, something is probably wrong with your system. However it is one of those commands that is run by root or with root privilege. Therefore, it might not be visible (depending upon distribution) as normal user. You may have to either log in as root or do

su –

instead of using sudo or a simple su.

2.) Using fdisk

In this case, the easiest way to explain fdisk’s use is by example. We will assume that you have a 10 gig hard drive. 3 gigs are devoted to Windows and now you wish to install Linux on the other 7 gigs. For purposes of this example, we will create an extended partition and inside of it create 3 logical partitions. One will be swap, one will be a small /boot partition and the last will use up the remaining free space.

Although most versions of LILO and GRUB will, on modern computers, now boot beyond the 1024th disk cylinder, we’re keeping our boot partition within the first 4 gigs of the drive. (There are other reasons to keep a separate /boot partition, but it often simply depends upon personal perference. At any rate, that is beyond the scope of this guide.)

First, we see what we have

fdisk /dev/hda

This will start the fdisk program. Now, to see what is already there, type

p

The p stands for print, and will show you what exists. At present, you should only have one partition, the one that is holding Windows. (I’ve found that Windows seems to partition disks differently–with Slackware, for example, I also get a warning that the partition doesn’t end where it should–however, it hasn’t caused me problems, so, I shrug it off.)

Now, we want to refresh our memory on the commands so we type

m

(In this case, I assume it stands for manual). It will show me the possible commands.

Firstly, I want to create my swap partition. One could make a new primary partition, but I don’t find it necessary so, I type

n

I’m then asked do I want a primary partition or extended partition. I’m told to type p for primary or e for extended. I choose e for extended. Next I’m asked for a number for the partition, usually given the choice of 1-4. I pick 2 as it’s the next partition.

It will then ask for the first cylinder, showing the default, which is the next cylinder next to the already existing Windows partition. Hit enter to accept the default. Then it asks for the last cylinder–the default is the end of the drive and again I hit enter to accept it.

I then again type p to verify that I did what I wanted. Hopefully it is showing me what I asked for.

Now I type n again for a new partition. This will be my swap partition. I’m asked do I want to make a primary one or a logical one. As you might guess, I’m told to type p for primary and l for logical. I choose l, as I’m making a partition within the extended partition.

I’m then informed that the numbers will begin at 5. I’m then asked for the first cylinder–again I choose the default, which is the first cylinder available.

I’m then asked for the last cylinder–however, I’m also given the option of specifying my size in Megabytes by typing + (desired size)M. I want my swap partition to be 128 Megabytes so I type

+128M

I hit enter. One could type p again to verify that it’s going the way you want it to, that’s up to you. Doing that, I find that this 128 Meg partition is Linux native, which I don’t want, I want Linux swap. So, I then type

t

It will ask me which partition’s type do I want to change. I pick 5, which is my first logical partition. (I can also discover this with the p command–the partition will be /dev/hda5). I’m then asked for the type, and told I can type L for a list of hex codes. I already know that swap is hex code 82, so I type

82

Now, I’m making my boot partition. This can be of various sizes–RH recommends 16 Megs, so I make it 20 Megs just in case. So, I begin by typing

n

Again, I’m presented with the choice for logical or primary and choose logical. Again I’m given the default 1st cylinder, which I accept and again asked for the last cylinder, with the option to specify size in Megabytes.

I type

+20M

This gives me a 20 meg partition to use as boot. It might be slightly different, as like the fdisk found in DOS fdisk will determine cylinder boundries and adjust accordingly.

Once again I type p to see what I have. I now see one Windows partition, and one extended partition. The extended partition has one 128 meg logical partition as Linux swap and a 20 meg Linux native partition.

So, once again, we type n to create the final partition. (If you were making separate partitions for /usr, /home, etc you could make more–however, we’re keeping it simple here.

Again, I’m asked to choose between logical and primary and choose logical. I’m asked for the first cylinder, with the default being the first unused one, which I accept by pressing enter–I’m then asked for the last cylinder, with the default being the last cylinder on the disk. Once again I press enter to accept it.

Lastly, I press

w

This writes the changes to disk–there are various warnings and messages. In most cases, you’re done. In others, you might be told that you have to reboot for the changes to take place.

references

man fdisk

The Quick-N-Dirty Guide to Maildrop

Although procmail seems to be more widely used, the maildrop program is preferred by some people. The documentation can be difficult for newcomers, however, its syntax for simple filtering is straightforward.

I want to thank my friend Tillman Hodgson whose pages can be viewed here for helping me understand how simple maildrop’s syntax can be

1.) Do you have maildrop?

At a command prompt type

which maildrop

If you get an answer like /usr/bin/maildrop or /usr/local/bin/maildrop go to step 3, otherwise, go to step 2.

2.) Installing

For help with installing take a look at our QND guide to installing software. If your distribution isn’t covered, then you may have to install from source. Fear not, we have a QND guide for installing from source as well.

3.) Configuring

In our example, we will deal with two mailling lists, list1 and list2.org. We will then create another mailbox to deal with anything having linux in its subject line and then put personal email in its own box and add a line to catch everything else.

Many mailing lists will, if you hit reply when answering a post, simply send the reply to the mailing list. Other lists, (including many technical *nix lists) only reply to the original poster. Some people when replying, change this, sending it only to the group, but many people hit reply, let the To: line go to the original poster and just cc the group. In our example, list1 will be a list where replies automatically go to the entire group and list2.org will be one of those where reply would only reply to the original poster.

Using your favorite text editor, in your home directory, create a file called .mailfilter. Add the following

if (/^To: .*list1/)
        to Mail/IN-list1

if (/^(From|To|cc|bcc): .*list2\.org/)
        to Mail/IN-list2

if (/^Subject: *.linux/)
        to Mail/IN-linux

if (/^To: john/)
        to Mail/IN-personal

DEFAULT="Mail/IN-misc"

As you can see the syntax is rather simple. The first line begins with if (/^ and then the header word such as From: To: Subject: or whatever then /). The next line begins with to then the destination. If you want to handle more than one header keyword, such as To and cc then you put them in their own, second set of parentheses, separated by pipes. Periods (and other special characters) such as the one in .org are escaped with backslashes. One ends the list of rules with the DEFAULT keyword, and in this case puts the path to the default mailbox in double quotes.

Using multiples can also be used with conditions. For example, if my friend John Paul Jones has three email accounts, I could do the following

if (/^From: (.*john|.*jpjones|.*jjones24)/)
        to Mail/IN-jpjones

We take the condition, From: in this case and put the different possibilities in parentheses, again, separated by pipes then end with the usual /).

Although it’s sometimes simpler (and less prone to error) to make a few entries, one can make various combinations. Taking our earlier example, let’s say list2 can also be addressed as 2list. (For example, the FreeBSD-questions list will work as freebsd-questions or questions@freebsd.org)

if (/^(From|To|cc|bcc): (.*list2\.org|.*2list\.org)/)
        to Mail/IN-list2

As you see, the pattern is actually rather simple.

if (/^(thing1|thing2): (otherthing1|otherthing2)/)

(Note that the ^ before the group thing1 means the expression begins with thing1 or thing2–that’s why we use a .* in case From or whatever doesn’t actually begin with the letters thing. Also note the colon after test2 is for header lines like From, To, cc and the like). You could make separate entries for list2 and 2list or do it as shown above, combining it into one expression.

Now that we’ve created our .mailfilter, we only want the owner to have permissions on the file. So do a chmod

chmod 600 .mailfilter 

4.) Testing maildrop

Run your MTA (Mail Transfer Agent). If you use something like getmail run it once with the verbose flag

getmail -v

This will catch some, though not all, syntax errors, as well as other problems (such as allowing group or world permissions on your .mailfilter file). You can start by sending an email to yourself, then run your MTA. If you’ve followed these instructions, then the email should go into your IN-personal mailbox. (Gentoo and some others use .maildir rather than Mail–in that case, of course you would change your .mailfilter accordingly.) With the Maildir format, you may have to add a trailing slash to your rules, such as

if (/^To: john/)
        to .maildir/IN-personal/

If you use SpamAssassin, you can add this rule at the top of your .mailfilter file. (Assuming you wished to move everything that had a score of 4 and above to a spam folder to be checked later)

xfilter "usr/local/bin/spamassassin"
if (/^X-Spam-Level: \*\*\*\*/)
        to Mail/IN-Spam

We use xfilter to run a command in .mailfilter. For example, I sometimes use a despammed.com address. If I do, it puts [despammed] in the subject line. I use xfilter to send a command to sed

xfilter "sed -e '^Subject:.*\[despammed\]/s/\[despammed\]//g'"

Congratulations, you’re done.

References

This QND guide gives a very simple setup. For more complex filtering rules see
man maildrop
man 5 maildropfilter
man5 maildropex
A page of mine about mutt which covers using maildrop with mutt

The Quick-N-Dirty Guide to Getmail

(As of 20 October 2004, this particular guide is listed in
FreeBSD’s /usr/ports/UPDATING as a reference.)

The aim of this QND guide is to get you up and running quickly with getmail. There will be far more how than why here.

Getmail is aimed to be a replacement for fetchmail. Many people consider it faster and more secure than fetchmail. My personal experience has been that it seems to at least be a little faster.

Getmail will require that python is installed. Most distributions have python so it is rare that this will be problem.

Note that this page is about getmail version 4.x. Debian and some others, as of October 2004 are still using version 3.x For information about 3.x please see my getmail 3.x page.

1.) Do you have getmail?

As fetchmail is still far better known, the chances are that you don’t have getmail installed. However, it never hurts to check. At a command line type

which getmail

If you get a response like /usr/bin/getmail or /usr/local/bin/getmail, you can skip to step 3. Otherwise, continue with step 2.

2.) Installing getmail

First follow the instructions in the QND software guide for information on getting and installing getmail. If it’s not included with your distribution (while it is in Gentoo’s portage and FreeBSD’s ports, it doesn’t seem to be on any of the RedHat 8.0 CD’s) then go to the getmail homepage. They have both a tar.gz file and an rpm. I haven’t used the rpm–the tar.gz file will work with RedHat.

FreeBSD’s ports or Gentoo’s portage will install getmail for you. If you’ve downloaded the tarball then untar it somewhere and cd to the directory that is created. Using version 4.2.2 as an example

tar xzf getmail-4.2.2.tar.gz
cd getmail-4.2.2
python setup.py build
python setup.py install

4.) Configuring getmail

FreeBSD and Gentoo both include a getmailrc-example file. In FreeBSD it’s in /usr/local/share/examples/getmail/getmailrc-examples. In Gentoo, the last time I looked, it was in /usr/share/examples/getmail/getmailrc-examples. By default, getmail looks for a .getmail/getmailrc file in the user’s home directory. So, as the user who will be using getmail (for this example, we’ll assume that the getmailrc-example is in /usr/local/share/getmail

cd
mkdir .getmail
cp /usr/local/share/examples/getmail/getmailrc-examples .getmail/getmailrc

Now we will edit our new getmailrc file. This example is for FreeBSD which has maildrop in /usr/local/bin. Some Linux distributions will have maildrop in /usr/bin. If that’s the case then change the /usr/local/bin/maildrop to /usr/bin/maildrop.

(I use maildrop as my example because it’s what I use–many others use procmail.)

For user john, with an email address of john@isp.com, email user name john, a password of 1234, and an ISP whose pop server name is pserver.isp.com, we would like our getmailrc to look like this.

[options]
verbose = 0
delete = True

[retriever]
type = SimplePOP3Retriever
server = pserver.isp.com
username = john
password = 1234



[destination]
type = MDA_external
path = /usr/local/bin/maildrop
unixfrom = True

Note the line for maildrop. The above is for a FreeBSD machine, where maildrop is in /usr/local/bin. If you are using Linux, then it may be in /usr/bin. To find out simply type at a command prompt

which maildrop

and adjust your getmailrc accordingly. (The same holds for procmail, or any other external MDA)

As gmail becomes more and more popular, folks are often making use of its pop download feature, enabling you to receive gmail email on your normal client.

As gmail uses SSL the above configuration would work save for the SimplePop3Retriever line. For a gmail account, you want, assuming your gmail account is john@gmail.com with a password of 1234

[options]
verbose = 0
delete = True

[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = john
password = 1234

[destination]
type = MDA_external
path = /usr/local/bin/maildrop
unixfrom = True

If one examines the docs, (/usr/local/share/doc/getmail/configuration.txt or configuration.html in FreeBSD) one finds that the default for the unixfrom line is false. However, some MDA’s expect it. Both maildrop and procmail need it.

5.) Testing Getmail

To test getmail simply type at a command prompt

getmail -v

If all is set up successfully, you should see it polling your pop server and retrieving your mail. Unlike fetchmail, getmail doesn’t have a daemon option, so if you want it to poll your server at regular intervals, you will have to add a crontab entry. The man 5 crontab page explains things rather clearly, but a quick example.

On most systems, a user can edit his own crontab. So as user john you would do

crontab -e


This will open up your default text editor. Type in

*/5 * * * * /usr/local/bin/getmail

That will set getmail to run every 5 minutes. If you wish to change the interval you want to change the 5 to however many minutes you wish.

If for some reason, you aren’t able to edit your own crontab then as root or with root privilege

crontab -eu john
*/5 * * * * /usr/local/bin/getmail

One quick note of warning. If you wanted the job to run every two hours and made a crontab like this

* */2 * * * 

it would be running every minute. The correct way to specify the job to run every two hours would be

0 */2 * * *

With FreeBSD 5.1 and 5.2, I ran into an issue where getmail would either not run at all, or I would get a permission denied from crontab. This is mentioned on getmail’s home page. The problem is that crontab has a shorter $PATH. The file (in FreeBSD) /usr/local/bin/getmail is simply a shell script. The top line read

#!/usr/bin/env python2.3 

I had to change that to reflect the complete path to python

#!/usr/bin/env /usr/local/bin/python2.3 

This solved that problem.

(As of late October, in FreeBSD that has been fixed. The first line gives the path to python and needs no modification.)

As of December, 2004, in FreeBSD 5.3 at least, if you have the most recent versions of both getmail and python, a DeprecationWarning regarding use of the “strict” keyword gets printed. If you have sendmail or another MTA sending you system messages, this will send you a message each time getmail retrieves mail.

To avoid this warning you can edit your crontab to read

*/5 * * * * /usr/local/bin/getmail > /dev/null 2>&1

With getmail 4.x each account will need a separate getmailrc file. If, for instance, one gets their home and work mail, create a getmailrc-home and getmailrc-work rc file. Put both of them in your .getmail directory and then, call getmail with

getmail -rgetmailrc-home -rgetmailrc-work

Note that getmail is going to look in ~/.getmail for the rcfiles, so as long as both files are in that directory, you don’t need to specify their full path. They don’t have to be called getmailrc-home, etc, you can simply call them home and work. If you don’t specify the rcfile name, getmail looks for a ~/.getmail/getmailrc file. Therefore, whether you call it getmailrc-home or just home, you’ll get an error unless you specify the rcfile as shown above.

If there is a non-fatal error, it will retrieve the mail but not delete it from the server. This is probably a Good Thing.(TM) For example, in ArchLinux, where I don’t have spamassassin, I used my .mailfilter file from my BSD box, where I do have it. Getmail noted that there was no spamassissin and it went to STDERR. The message was retrieved, but remained on the server.

Another time, back when I used procmail, the issue was a simple mistype in my rc.lists, having put a capital letter o instead of the numeral zero in one of my rules. Procmail noted this, wrote to STDERR and getmail would retrieve the messages, but not delete them from the server, retrieving them each time it polled for mail.

In each case, once I fixed the error in my MDA’s configuration file getmail deleted messages from the server as I wished.

References

Getmail home page
A more detailed page of mine
My getmail-3.x page
man crontab
man 5 crontab

The Quick-N-Dirty Guide to Installing from Source

1.) Do you have tar, bunzip2 and gunzip?

In a command shell type

which tar bunzip2 gunzip

This should return the path to these programs , probably /usr/bin/tar, etc. (In FreeBSD probably /usr/local/bin/tar). If it finds it, go to step 3. If it doesn’t, there is probably something seriously wrong with your installation that is beyond the scope of this guide. However, you can go to step 2 and see if the instructions there help. (Some distributions, such as Debian, don’t install all of these by default, so the instructions in step 2 can quite possibly help).

2.) Installing

Go to the QND software guide for information about getting and installing tar, gunzip and bunzip2. We’ll wait. If it turns out that they’re not included with your particular flavor of Linux then as mentioned above, there is probably something seriously wrong with your installation and you will need more than this guide.

3.)Using tar to install from source

For this example, we will assume that you downloaded fetchmail-5.9.tar.gz. I prefer to make a separate directory for these things, but the first step here can be skipped without disaster. However, let us assume that you downloaded fetchmail into a directory you’ve made in /tmp called downloads. Therefore, at present, your fetchmail tarball is in /tmp/downloads It’s always a good idea to examine the contents of the tarball first

tar -ztf /tmp/downloads/fetchmail-5.9.tar.gz

That will tell us the contents of the tarball. Now, we decompress and untar it.

mkdir /usr/local/src/fetchmail
tar -zxvf /tmp/downloads/fetchmail-5.9.tar.gz

At this point, you will see the tarball being decompressed and extracted. Various things will flash across your screen. Assuming it completes with no errors, you will now see that you have a directory inside your /usr/local/src/fetchmail directory called fetchmail-5.9

cd fetchmail-5.9
ls

You should see a file in there called README. Read it.

less README

Depending upon the program, it may have installation instructions or may tell you to read another file called INSTALL for directions on installation. If so, then read that one.

less INSTALL

In most cases, the instructions will give the following sequence. (NOTE: Notice that I said MOST–not ALL. Skipping the above steps of reading the README and INSTALL can sometimes result in needless difficulty)

./configure
make
make install

The instructions for installing a tar.bz2 file are almost identical. The difference is in the options passed to the tar command–for a gunzip it was tar -zxvf. For a bz2 it’s usually

tar -jxvf fetchmail-5.9.tar.bz2

On rare occasions, you’ll receive the error message that j is an unknown option. If you get such a message than try

tar -yxvf fetchmail-5.9.tar.bz2

If neither works, then you can always try

bunzip2 fetchmail-5.9.tar.bz2 && tar -xvf fetchmail.tar

4.) Odd and ends

Keep in mind that the above instructions are for tarballs. Sometimes, files are simply compressed (but not tarred.) In that case, they would have, rather than tar.bz2, etc just .bz2. If you get a file called file.bz2 and try tar -jxvf file.bz2 you’ll get an error message to the effect that it’s an inappropriate file format. If you have such a file, simply decompress it, e.g

bunzip2 file.bz2

(If it’s a file called file.gz substitute gunzip for bunzip2.)

There is also a compressing format that just has a .Z extension. If you run into it, use the uncompress command. For example, if your file was called file.Z

uncompress file.Z

If you run across a tarball with it then just do

ucompress file.tar.Z && tar -xvf file.tar

You may come across files with .tgz and .tbz extensions, for example, FreeBSD distfiles. These are simply abbreviations for tar.gz and tar.bz2, so you can treat a .tgz file as if were called .tar.gz and .tbz files as if they were .tar.bz2 files.

From time to time, you might come across a file with a .zip extension, compressed with the Microsoft format. Most Linux distributions have a zip and unzip command, or have it readily available. In FreeBSD the two are available in /usr/ports/archivers. If you install /usr/ports/archivers/zip I believe it installs unzip as a dependency, but I wouldn’t swear to that, nor am I sure if the reverse is true.

If you are using an RPM based distro, and want to install an rpm, the command is (assuming it was fetchmail-5.9.rpm)

rpm -Uvh fetchmail-5.9.rpm

One may also wish to create their own tarfiles. If you had a directory of good bash scripts called bashscripts and wished to tar and compress them to send to a friend, the command would be (I am using the j option for bz2 format-if you wish gz format substitute z for j)

tar -jcf bashscripts.tar.bz2 bashscripts

Now that you understand using tarballs, you can go back to the QND guide you were reading, and continue with what is usually step 3.

The Quick-N-Dirty Guide to Finding and Installing Software

As you will have noted from our other QND guides, they start with asking if you have the particular program, and have you start by typing

which <program_name>

As each distribution has its own way of installing software, this guide is intended as a pointer to installing software in the distributions with which we are familiar.

1.) RedHat Linux

RedHat Linux developed the now common RPM system. (RPM actually stands for RedHat Package Manager) Most of the software mentioned in these QND guides will be found on one of the CDs. A typical RedHat distribution consists of 3 or 4 CDs. Most software will have to be installed as root.

So, insert the CD. (Unless mentioned otherwise in a QND guide, you might as well start with the first one.)

Login as root, or do an su.

mount /dev/cdrom
cd /mnt/cdrom/RedHat/RPMS
ls <program_name*>

For example, if you were searching for fetchmail, you would type, after cd’ing to the RPMS directory

ls fetchmail*

If it’s not on the first CD that you tried then

cd
umount /dev/cdrom

Then repeat the procedure with the next CD. Once you’ve found the program, which will be the program name with a version number, for example fetchmail-5.9.11.rpm then

rpm -Uvh fetchmail-5.9.11.rpm

You’ll see some information as it’s being installed. When done, umount and eject the CDROM as above.

(We’ll continue to use fetchmail as our example package)

2.) Mandrake Linux

Mandrake also uses the RPM format. The procedure is actually, at least last time any of us tried it, identical since Mandrake still keeps its RPMS in a folder called RedHat/RPMS.

3.) Gentoo Linux

Gentoo uses the portage system. Again packages usually have to be installed as root. To find out if it’s available in portage

emerge -s fetchmail

You’ll get a result like

* net-mail/fetchmail
Latest version Available: 5.9.11

It will usually also give the homepage and a brief description.

So, assuming the package is available in portage then

emerge fetchmail

(You may first want to do

emerge -p fetchmail

to see what other packages may be installed as dependencies.)

5.) Debian

Debian’s apt system is well known for its ease of use. To search for a program one types

apt-cache search fetchmail

To install it, one usually only need type

apt-get install fetchmail

4.) ArchLinux

Arch Linux is a relatively little-known distro, though it deserves more notice. It is one of the easiest, as far as installing software. To see if a package is available do

pacman -Ss fetchmail

You will then find the name of the package. Usually, when installing, you don’t need the version number and can simply then do

pacman -Sy fetchmail

You will then see it download and install fetchmail.

5.) FreeBSD

FreeBSD uses the ports system. Most software mentioned in these guides will be available in their ports. So,

cd /usr/ports
whereis fetchmail

In this case you’ll get the answer of /usr/ports/mail/fetchmail.

Another, probably better way to do it is

make search name=fetchmail
cd /usr/ports/mail/fetchmail
make install

Again this must be done as root.

6. NetBSD

NetBSD is almost identical to FreeBSD save that rather than /usr/ports it is in /usr/pkgsrc. So

cd /usr/pkgsrc/mail/fetchmail; make install

The QND guides give the link to a program’s home page. If the program is not available with your distribution, the home page will almost always have information about getting the program, often having the source code and/or rpms available.

If you’re not familiar with installing source code then fear not–we also have a QND guide for it.

Now repeat step one of the QND guide that you were reading. For example, if it was the fetchmail guide then

which fetchmail

If Step 1 still fails, then something subtle is probably wrong. Try emailing your local Linux Users Group or other Linux mailing list to which you subscribe. (We know that you are member of one or the other) something like

“I am trying to install fetchmail on (your distribution, version included). I am using the following method (include the commands that you ran to install it). However, I run ‘which fetchmail’ and it isn’t found. Does anyone have any idea what I’m doing wrong? Thanks in advance.”

Now that you’re done with this, you can go back to the QND guide that you were reading and continue with what is usually step 3.

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!