This 'Howto' page demonstrates how to setup the great console newsreader slrn under Ubuntu Linux and deals with the 'release' version slrn 0.9.9. Setting up slrn requires a little preparation as it deals with not just slrn but a few 'companion' programs as well.
But first some preparation work:
Set a FQDN
For the best setup you should have an unique Fully Qualified Domain Name (FQDN) set to your system. Check this with the following command:
If this is not set you will need to alter your /etc/hosts file to reflect your FQDN. The default Ubuntu /etc/hosts file tends to look something like this:
Alter this to something like:
(Thanks to PJR for the information above). For your own, unique FQDN you have 3 good choices:
127.0.1.1 desktop.your.domain desktop
- If you own your own Domain Name use this in conjunction with a subdomain and the hostname of your computer.
- Use a service such as dyndns.org which will give you a domain name for free.
- Use the news service individual.net which will give you a free FQDN.
A word of warning: an incorrect or false FQDN might expose you to merciless flaming so spend a little time getting this set correctly. Next we set up the text editor vim and the then Mail Transport Agent (MTA) msmtp:
Getting Acquainted with vim
slrn does not come with a built-in editor and the best editor to use with slrn is vim, although many will argue this point. A version of vim comes as part of the default Ubuntu installation but before launching into this reasonably complex program I would advise you to run through vim's tutorial program which can be launched with the following command:
A skill with vim is not the mandatory part of a Linux experience that it once was but you will find skills in vim will be very useful to you in other areas. Next to set up our MTA:
Setting up an MTA
To reply by email to a news posting sendmail or a substitute is required and in this 'Howto' msmtp will be used. To reply by email rather than post directly to the newsgroup is not often appropriate but it has its uses. The following command downloads and installs msmtp + a certs pack:
This very simple program needs a single configuration file to be created, a logfile to be created, an addition made to the ~/.slrnrc file, and then it will happily send email from within slrn:
$ sudo apt-get install msmtp ca-certificates
Below is the required configuration for a Gmail server:
$ touch $HOME/.msmtprc
$ touch $HOME/.msmtp.log
$ chmod 0600 $HOME/.msmtprc
With both vim and msmtp setup it is time to move on to slrn itself:
Times have changed with the new release of slrn and finally users of Jaunty Jackalope can get a perfectly usable version direct from the Ubuntu repository:
Previous versions of Ubuntu are not so fortunate but Thomas Wiegner has been good enough to make Ubuntu packages of the latest slrn available from his site: slrn patches and ubuntu repository/packages. These packages can either be downloaded and installed directly from his site or can be accessed by adding either of the following lines to /etc/apt/sources.list:
$ sudo apt-get install slrn
deb http://www.foory.de/thw/slrn/ gutsy/
deb http://www.foory.de/thw/slrn/ hardy/
Use of the repositories should guarantee that slrn will be kept up to date via the Ubuntu package management system.
deb http://www.foory.de/thw/slrn/ intrepid/
But now to setup the file ~/.slrnrc:
slrn requires the creation of a personal configuration file: ~/.slrnrc. The following commands transfer a sample file from the slrn website to its correct location and opens it for editing:
May I suggest a very few basic settings to make your early days a little easier?
$ wget http://slrn.sourceforge.net/downloads/slrn.rc -O $HOME/.slrnrc
$ vim $HOME/.slrnrc
Some Suggested ~./slrnrc Settings
There are 11 sections, not all of which need to be altered simply to get slrn successfully online. You can see that this file uses the figure % to create a comment, simply remove the % to allow slrn to see and perform the command.
Section 1: Tell slrn about your identity. These following fields will usually need to be un-commented and set:
Don't forget to create the signature as follows:
% Basic identification information which creates:
% From: Skywalker <email@example.com>
set username "luke"
set hostname "deathstar.invalid"
set realname "Skywalker"
% Also create a real email address that is less likely
% to be spammed, use gmail anyway to be sure:
set replyto "firstname.lastname@example.org"
% Set the location of your signature:
set signature ".signature"
Be prepared observe a little netiquette with your signature file or you will meet some serious flame action. You do not have to add the usual signature delineator "-- " as slrn will do this for you automatically.
Section 3: Which external programs do you want to use? It is in this section that we will set vim as the default editor with the following line:
This also sets the messages to be 72 characters wide which will save you from the wrath of other newsgroup readers. While you are here you may as well set Firefox as your default browser:
% Sets vim to edit with 72 character width.
set editor_command "vim '+set tw=72' +%d '%s'
If you are keen to really come to grips with the console you could download the w3m browser and set it in your ~/.slrnrc file as well. Don't forget that you can call up URLs from within your news messages by typing in "U".
% Sets Firefox as default browser.
set Xbrowser "firefox '%s' &"
Next for the appropriate lines to tell slrn to use our MTA msmtp:
So now you can forward messages to outside addresses by typing in "F" and reply to the given email addresses of newsgroup posters by typing "r". Don't forget to observe a little netiquette: it is almost always better to reply to the group rather than email the poster directly.
% Sets msmtp rather than sendmail.
set sendmail_command "/usr/bin/msmtp -t"
Section 8: Some preferences for the article pager. Since you have gone to some trouble to set up a decent news reader it is nice to see newsreader other people are using. Un-comment the following line and add in User-Agent:
Remember when you you are reading messages you can toggle full headers and the shorter listing by pressing a lower case "t". For the sake of completion you should add X-Newsreader, X-Mailer and X-Posting-Agent as well as User-Agent.
% Sets the default headers you see above messages.
Section 9: Display / color settings. Don't alter these settings yet until you have had a look at the default slrn colours but come back later and alter the colours in the section marked:
There will be 2 colours set for most elements, the first is foreground the second is background. You can add a third option to the right of these values: bold, blink, underline and reverse. Experiment a little. You can also ask for "default" which will use the default settings of your Terminal program. A basic guide for these colors that can be placed in your ./slrnrc file for easy reference is:
% These settings are used for color terminals:
This completes the basic setup of your ~/.slrnrc file but I am sure you will be back to make many, many changes. If you are interested there are a couple of extra settings at the base of this page. The next task is to setup the news server in your computer's environment variables:
%--- normal --------- bold ---------
% 0 black 8 gray
% 1 red 9 brightred
% 2 green 10 brightgreen
% 3 brown 11 yellow
% 4 blue 12 brightblue
% 5 magenta 13 brightmagenta
% 6 cyan 14 brightcyan
% 7 lightgray 15 white
Setting the NNTP Environment Variable
slrn needs to know where your news server is. To do this you will need to set set the environment variable "NNTPSERVER" to the hostname of your preferred newsserver. Open the file ~/.bashrc as follows:
and add the following lines, substituting 'your news server' with the actual address of your news server, leaving the apostrophes in place:
A few more steps and then slrn can be run for the first time:
# Sets the News Server Environment as required by slrn
NNTPSERVER='my.news.server' && export NNTPSERVER
Running the program
slrn needs to download a list of newsgroups from your news server, setup the file ~/.jnewsrc and optionally download a list of newsgroup descriptions. Open a Terminal window and type the following:
Congratulate yourself a little and type the next simple command into a Terminal window: slrn and yes, you have successfully installed slrn. The program has already subscribed you to a few newsgroups, navigate these by using the arrow keys and enter each group with the space bar. If and when you get stuck in the early stages press the "?" key and a list of basic commands will be revealed. Can I suggest a little time on alt.test before venturing on to other groups?
$ slrn --create
$ slrn -d
And in conclusion
Be prepared for a steep learning curve but when you have mastered the basics of the program I predict you will never return to a GUI newsreader. If you get tangled up a little: close the program down, have a cup of tea, and read the slrn manual online. Perhaps you would like to use the NNTP proxy server Leafnode-2 with slrn as I do? Try another guide I have written on these forums: [Howto] Setup and use Leafnode-2 with the newsreader slrn.
April 13th, 2009