Skip to the content.

18. Text Web Browsers


People who are new to Unix-based systems tend to ask the question “Why on earth would I want a text-mode browser? I’m going to compile X and use Firefox/Falkon/Whatever!”. Those who have been around systems for a while know that when (not if) you manage to mess up your graphical browser install and you need to look up some information on the web, a console based browser will save you. Also, there are quite a few people who prefer to use one of these browsers as their primary method of browsing; either to avoid the clutter and bandwidth which accompanies images or because they may use a text-to-speech synthesizer which can read the page to them (of use for instance to partially sighted or blind users). In this chapter you will find installation instructions for two console web browsers:


Introduction to Links

Links is a text and graphics mode WWW browser. It includes support for rendering tables and frames, features background downloads, can display colors and has many other features.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Recommended

libevent-2.1.12

Optional

Graphics mode requires at least one of GPM-1.20.7 (mouse support to be used with a framebuffer-based console), SVGAlib, DirectFB , and a graphical environment

For decoding various image formats Links can utilize libpng-1.6.39, libjpeg-turbo-2.1.5.1, librsvg-2.54.5, and libtiff-4.5.0

For decompressing web pages that are compressed with Brotli, Links can utilize Brotli-1.0.9

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/LinksBrowser

Install Links by running the following commands:

./configure --prefix=/usr --mandir=/usr/share/man &&
make

This package does not come with a test suite.

Now, as the root user:

make install &&
install -v -d -m755 /usr/share/doc/links-2.28 &&
install -v -m644 doc/links_cal/* KEYS BRAILLE_HOWTO \
    /usr/share/doc/links-2.28

Command Explanations

--enable-graphics: This switch enables support for graphics mode.

Config Files

~/.links/*

Configuration Information

Links stores its configuration in per-user files in the ~/.links directory. These files are created automatically when links is run for the first time.

Contents

Installed Program: links

Installed Libraries: None

Installed Directories: /usr/share/doc/links-2.28

Short Descriptions

links is a text and graphics mode WWW browser.

18.2 Lynx-2.8.9rel.1


Introduction to Lynx

Lynx is a text based web browser.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Additional Downloads

Lynx Dependencies

Optional

GnuTLS-3.8.0 (experimental, to replace openssl), Zip-3.0, UnZip-6.0, an MTA (that provides a sendmail command), and Sharutils-4.15.2 (for the uudecode program)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/Lynx

Installation of Lynx

First, apply a patch to fix a security vulnerability:

patch -p1 -i ../lynx-2.8.9rel.1-security_fix-1.patch

Install Lynx by running the following commands:

./configure --prefix=/usr          \
            --sysconfdir=/etc/lynx \
            --datadir=/usr/share/doc/lynx-2.8.9rel.1 \
            --with-zlib            \
            --with-bzlib           \
            --with-ssl             \
            --with-screen=ncursesw \
            --enable-locale-charset &&
make

This package does not come with a test suite.

Now, as the root user:

make install-full &&
chgrp -v -R root /usr/share/doc/lynx-2.8.9rel.1/lynx_doc

Command Explanations

--sysconfdir=/etc/lynx: This parameter is used so that the configuration files are located in /etc/lynx instead of /usr/etc.

--datadir=/usr/share/doc/lynx-2.8.9rel.1: This parameter is used so that the documentation files are installed into /usr/share/doc/lynx-2.8.9rel.1 instead of /usr/share/lynx_{doc,help}.

--with-zlib: This enables support for linking libz into Lynx.

--with-bzlib: This enables support for linking libbz2 into Lynx.

--with-ssl: This enables support for linking SSL into Lynx.

--with-screen=ncursesw: This switch enables the use of advanced wide-character support present in the system NCurses library. This is needed for proper display of characters and line wrapping in multibyte locales.

--enable-locale-charset: This switch allows Lynx to deduce the proper character encoding for terminal output from the current locale. A configuration step is still needed (see below), but unlike the situation without this switch, the configuration step becomes the same for all users (without the switch one must specify the display character set explicitly). This is important for environments such as a LiveCD, where the amount of system-specific configuration steps has to be reduced to the minimum.

--enable-ipv6: This switch allows Lynx to use IPv6, along with IPv4. Use it if your ISP provides an IPv6 configuration.

--enable-nls: This switch allows Lynx to print translated messages (such as questions about cookies and SSL certificates).

--with-gnutls: This enables experimental support for linking GnuTLS into Lynx. Remove the --with-ssl switch if you want to use gnutls.

make install-full: In addition to the standard installation, this target installs the documentation and help files.

chgrp -v -R root /usr/share/doc/lynx-2.8.9rel.1/lynx_doc : This command corrects the improper group ownership of installed documentation files.

Configuring Lynx

Config Files

/etc/lynx/lynx.cfg

Configuration Information

The proper way to get the display character set is to examine the current locale. However, Lynx does not do this by default. As the root user, change this setting:

sed -e '/#LOCALE/     a LOCALE_CHARSET:TRUE'     \
    -i /etc/lynx/lynx.cfg

The built-in editor in Lynx Breaks Multibyte Characters. This issue manifests itself in multibyte locales, e.g., as the Backspace key not erasing non-ASCII characters properly, and as incorrect data being sent to the network when one edits the contents of text areas. The only solution to this problem is to configure Lynx to use an external editor (bound to the “Ctrl+X e” key combination by default). Still as the root user:

sed -e '/#DEFAULT_ED/ a DEFAULT_EDITOR:vi'       \
    -i /etc/lynx/lynx.cfg

Lynx handles the following values of the DEFAULT_EDITOR option specially by adding cursor-positioning arguments: “emacs”, “jed”, “jmacs”, “joe”, “jove”, “jpico”, “jstar”, “nano”, “pico”, “rjoe”, “vi” (but not “vim”: in order to position the cursor in Vim-9.0.1273, set this option to “vi”).

By default, Lynx doesn’t save cookies between sessions. Again as the root user, change this setting:

sed -e '/#PERSIST/    a PERSISTENT_COOKIES:TRUE' \
    -i /etc/lynx/lynx.cfg

Many other system-wide settings such as proxies can also be set in the /etc/lynx/lynx.cfg file.

Contents

Installed Program: lynx

Installed Libraries: None

Installed Directories: /etc/lynx and /usr/share/doc/lynx-2.8.9rel.1

Short Descriptions

lynx is a general purpose, text-based, distributed information browser for the World Wide Web.