How To Install libjs-modernizr on Ubuntu 18.04

In this tutorial we learn how to install libjs-modernizr on Ubuntu 18.04. libjs-modernizr is JavaScript library to detect HTML5 and CSS3 features in the users browser

Introduction

In this tutorial we learn how to install libjs-modernizr on Ubuntu 18.04.

What is libjs-modernizr

libjs-modernizr is:

Modernizr is a JavaScript library allowing you to use HTML5 & CSS3 while maintaining control over unsupported browsers.

Modernizr tests which native CSS3 and HTML5 features are available in the current user agent and makes the results available to you in two ways, as properties on a global Modernizr object, and as classes on the <html> element. This information allows you to progressively enhance your pages with a granular level of control over the experience.

There are three methods to install libjs-modernizr 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 libjs-modernizr Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libjs-modernizr

Install libjs-modernizr Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libjs-modernizr

Install libjs-modernizr 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 libjs-modernizr using aptitude by running the following command:

sudo aptitude -y install libjs-modernizr

How To Uninstall libjs-modernizr on Ubuntu 18.04

To uninstall only the libjs-modernizr package we can use the following command:

sudo apt-get remove libjs-modernizr

Uninstall libjs-modernizr And Its Dependencies

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

sudo apt-get -y autoremove libjs-modernizr

Remove libjs-modernizr Configurations and Data

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

sudo apt-get -y purge libjs-modernizr

Remove libjs-modernizr configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libjs-modernizr

References

Summary

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