Today, we have lots of web browsers, available across multiple operating systems. However, there once was a time when we didn’t have that many choices. Although the Internet Explorer from Windows changed the entire landscape for web browsers, Lynx was the go-to choice for many Linux users before that. It did not use a GUI but rather offered a text-based interface.
Even today, there are some cases where we require a text-based/command-line web browser, especially if you are running a low-end machine, or running the browser on a remote server. Today, we are writing this article to inform our readers how to install Lynx on different Linux distributions.
What is Lynx?
Lynx, arguably one of the oldest web browsers still being maintained, is a text-based web browser that can work in the terminal. Despite being a text-based browser, it is customizable enough to offer significant services to users, especially for running on cursor-addressable character cell terminals.
Started back in 1992, Lynx is a popular web browser for Linux systems. It showcases ASCII text but doesn’t display images or any multimedia content. It doesn’t run JavaScript. However, you can load web pages directly at the terminal. Since it doesn’t load images of JavaScript, it is very fast. Yes, it might be redundant in today’s digital atmosphere, but still, some users prefer Lynx.
Properties of Lynx Browser:
- Text-based web browsing
- Very customizable
- Works in terminal
- Oldest web browser
- Supports HTML
- Can run on low-end hardware
Prerequisites
Prerequisites Before proceeding with the installation of Lynx on your Linux system, there are several important factors to consider. Lynx is a highly respected text-based web browser, ideal for use in command-line environments and by users requiring a lightweight browsing solution.
However, Lynx’s simplicity also means that it may not support all modern web technologies or graphical content as graphical browsers do. Thus, users who need to access websites that rely heavily on JavaScript or other advanced functionalities might face limitations.
To ensure a smooth installation and operation of Lynx, please confirm the following prerequisites:
- Linux Operating System (or its distros)
- Terminal Access
- Package Manager
- Superuser Privileges
- Internet Connection
How to Install Lynx?
There are several ways one can install Lynx on a Linux system. All you have to do is follow the solutions provided below:
Solution 1. Via Beyond Linux From Scratch (BLFS)
First, we can try the solution provided in BLFS. It is an open-source Linux documentation project that allows users to build their Linux systems in pieces by providing instructions regarding installing and configuring different application packages. BLFS is the extension of the official LFS book that offers a step-by-step guide for manual installations.
Step 1. First, apply a security patch:
patch -p1 -i ../lynx-2.8.9rel.1-security_fix-1.patch
Step 2. Then, install Lynx by running the following commands:
./configure --prefix=/usr \
--sysconfdir=/etc/lynx \
--with-zlib \
--with-bzlib \
--with-ssl \
--with-screen=ncursesw \
--enable-locale-charset \
--datadir=/usr/share/doc/lynx-2.8.9rel.1
make
sudo make install-full
chgrp -v -R root /usr/share/doc/lynx-2.8.9rel.1/lynx_doc
Solution 2. On AWS Machines:
You can also run it on AWS machines, as intended, all you have to do is:
Step 1. Enable the optional channels
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
Step 2. Then, use the YUM command for installation:
sudo yum install lynx
Solution 3. On Various Linux Distributions
You can install Lynx via the native Linux repositories. We have listed all the possible flavors of Linux here that you can install Lynx on:
Debian/Ubuntu
Step 1. You have to update the package index first:
sudo apt update
Step 2. Now, you can install Lynx simply by using the APT command:
sudo apt install lynx
CentOS/RHEL
Next, we have CentOS or RHEL systems that support the YUM repo. Here’s how to install Lynx.
Step 1. First, you need to install EPEL Repository
sudo yum install epel-release
Step 2. Finally, you can install Lynx after enabling the EPEL repository using the YUM command:
sudo yum install lynx
Fedora
Similarly, you can run Lynx on Fedora.
Step 1. Update the DNF repo and use it to install Lynx.
sudo dnf update
sudo dnf install lynx
Arch Linux
Next up, is Arch Linux:
sudo pacman -Syu
sudo pacman -S lynx
Gentoo
You can also run Lynx on Gentoo by following the steps below:
Step 1. Sync the repo to the latest version:
sudo emerge --sync
Step 2. Then, install Lynx:
sudo emerge lynx
OpenSUSE
Step 1. Similarly, install Lynx on OpenSUSE by:
sudo zypper install lynx
Linux Mint 20
apt update
apt install lynx -y
Rocky Linux
Step 1. First, install the necessary DNF plugins:
sudo dnf install dnf-plugins-core
Step 2. Then, install EPEL:
sudo dnf -y install epel-release
Step 3. Next, enable the PowerTools repository on Rocky Linux 8
sudo dnf config-manager --set-enabled powertools
Step 4. After that, update the DNF repository:
sudo dnf -y update
Step 5. And lastly, install Lynx:
sudo dnf -y install lynx
Solution 4. Compiling From Source
You can always build Lynx from the source using the official package available on the Lynx website. Here, we are using the APT repo for Ubuntu/Debian systems. However, you can run it on other distros too.
Step 1. Download the TAR package, via the official website:
wget https://invisible-mirror.net/archives/lynx/tarballs/lynx<VERSION>.tar.gz
Step 2. Then, extract the source code package
tar -xzvf lynx<VERSION>.tar.gz
Step 3. Now install the required dependencies. These dependencies differ from system to system. For example, on Debian/Ubuntu:
sudo apt-get install build-essential
sudo apt-get install libncurses5-dev
For CentOS/Fedora:
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel
Step 4. For the next step, configure the package correctly. First, navigate to the directory where you extracted the package and then use the CONFIGURE command.
cd lynx<VERSION>
./configure
Step 5. Now compile the package by running the MAKE command:
make
Step 6. Finally install Lynx
sudo make install
Solution 5. Slackware
Lastly, you can run Slackware and use it to install Lynx:
Step 1. Start by installing sbopkg
sudo sbopkg -r
Step 2. Now, open the sbopkg interface:
sudo sbopkg
Finally, search for Lynx and download it using the GUI.