Do you use a Linux PC without a desktop environment and do you need to look for something on Google? Without using a smartphone or tablet, you can use a browser directly from the terminal. In particular, in the next lines we will explain how to use Lynx to surf the Web from a Linux terminal in an easy and immediate way.
Lynx: what it is
Lynx is the most popular solution for surfing the Internet on the Linux terminal. This is a text-based navigation program that works on all UNIX- like OS’s as well as on the MS-DOS command line.
In addition to this, it is a software that is 26 years old and is currently the oldest web browser still under development. Although Lynx seems useless and obsolete, it is actually useful when, for example, you work on a remote Linux server and you don’t have access to the desktop environment to download a file or search for something on the Internet.
How to install Lynx on Linux
Unfortunately, the Web browser is not included in any Linux distribution present at this time in the square, so it will be necessary to proceed with the installation and configuration via the terminal. You simply need to follow the directions below.
sudo apt install lynx
sudo apt-get install lynx
sudo pacman -S lynx
sudo dnf install lynx
sudo zypper install lynx
Other Linux distributions
If you can’t find Lynx in the software sources of the Linux distro used, then you can create it from the origin by following specific instructions.
First, use the Wget tool to download the source code of the web browser by running the command wget https://invisible-mirror.net/archives/lynx/tarballs/lynx2.8.9rel.un.tar.bz2 inside the terminal.
Having done this, extract the source code with tar xvjf lynx2.8.9rel.un.tar.bz2 and then move the session into the lynx2.8.9rel.un folder with cd lynx2.8.9rel.un / . Now, configure the source code using the command ./configure –prefix = / usr and compile Lynx with make. Complete the operation by installing the browser on your operating system using make install-full.
To stay up to date on the latest releases published by the Lynx developers, we recommend you follow this page by simply replacing the link next to Wget with that of the available version. Furthermore, we suggest that you install only stable releases (marked with rel ) and not development releases (marked with dev) as they may present problems.
How to use Lynx to browse the web from a Linux terminal
Since the Lynx browser is command line based, web pages can only be opened by specifying a URL. For example, if you want to visit Wikipedia, you’ll need to use the command lynx https://www.wikipedia.org/.
From the message proposed below (always inside the terminal), you will have to press the A key on the keyboard to accept all cookies permanently since the single acceptance could take a long time. Once this is done, the Lynx Web browser should show all site information in text mode.
Lynx provides several keyboard shortcuts for quick and easy use. For example, if you want to exit the Web site visited to log on to a new one, press G. To return to the previous page, press the left arrow key. To open a link on the page shown, position yourself on it and press the right arrow key. Scrolling inside the browser is very similar to other modern navigation apps. It is enough, in fact, to press the down arrow key of the keyboard to navigate downwards or arrow up to move up.
To view the complete Lynx manual inside the terminal, you’ll need to use man lynx. Alternatively, you can export the manual to a text file to read it more comfortably using the man lynx >> ~/Documents/manual-lynx.txt command.
Doubts or problems? We help you!
If you still have any doubt or suggestions related to this article then feel free to leave a comment in the box below or contact us via our dedicated page.