How To Install w3c-linkchecker on Ubuntu 18.04

In this tutorial we learn how to install w3c-linkchecker on Ubuntu 18.04. w3c-linkchecker is tool to verify the links in a web page are still valid

Introduction

In this tutorial we learn how to install w3c-linkchecker on Ubuntu 18.04.

What is w3c-linkchecker

w3c-linkchecker is:

The checklink tool is a program that reads an HTML or XHTML document, extracts a list of anchors and links and checks that no anchor is defined twice and that all the links are dereferenceable, including the fragments. It warns about HTTP redirects, including directory redirects, and can check recursively a part of a web site. The program can be used either as a command line tool or as a CGI script. The official site is available as http://validator.w3.org/checklink.

There are three methods to install w3c-linkchecker on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install w3c-linkchecker Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install w3c-linkchecker using apt-get by running the following command:

sudo apt-get -y install w3c-linkchecker

Install w3c-linkchecker Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install w3c-linkchecker using apt by running the following command:

sudo apt -y install w3c-linkchecker

Install w3c-linkchecker Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install w3c-linkchecker using aptitude by running the following command:

sudo aptitude -y install w3c-linkchecker

How To Uninstall w3c-linkchecker on Ubuntu 18.04

To uninstall only the w3c-linkchecker package we can use the following command:

sudo apt-get remove w3c-linkchecker

Uninstall w3c-linkchecker And Its Dependencies

To uninstall w3c-linkchecker and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove w3c-linkchecker

Remove w3c-linkchecker Configurations and Data

To remove w3c-linkchecker configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge w3c-linkchecker

Remove w3c-linkchecker configuration, data, and all of its dependencies

We can use the following command to remove w3c-linkchecker configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge w3c-linkchecker

References

Summary

In this tutorial we learn how to install w3c-linkchecker package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.