How To Install libcatalyst-plugin-smarturi-perl on Ubuntu 18.04

In this tutorial we learn how to install libcatalyst-plugin-smarturi-perl on Ubuntu 18.04. libcatalyst-plugin-smarturi-perl is module providing configurable URIs for Catalyst

Introduction

In this tutorial we learn how to install libcatalyst-plugin-smarturi-perl on Ubuntu 18.04.

What is libcatalyst-plugin-smarturi-perl

libcatalyst-plugin-smarturi-perl is:

Configure whether $c->uri_for and $c->req->uri_with return absolute, hostless or relative URIs, or URIs based on the ‘Host’ header. Also allows configuring which URI class to use. Works on application-wide or per-request basis.

Catalyst::Plugin::SmartURI is useful in situations where you’re for example, redirecting to a lighttpd from a firewall rule, instead of a real proxy, and you want your links and redirects to still work correctly.

To use your own URI class, just subclass URI::SmartURI and set uri_class, or write a class that follows the same interface.

This plugin installs a custom $c->request_class, however it does so in a way that won’t break if you’ve already set $c->request_class yourself, ie. by using Catalyst::Action::REST (thanks mst!).

There are three methods to install libcatalyst-plugin-smarturi-perl 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 libcatalyst-plugin-smarturi-perl Using apt-get

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

sudo apt-get update

After updating apt database, We can install libcatalyst-plugin-smarturi-perl using apt-get by running the following command:

sudo apt-get -y install libcatalyst-plugin-smarturi-perl

Install libcatalyst-plugin-smarturi-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libcatalyst-plugin-smarturi-perl using apt by running the following command:

sudo apt -y install libcatalyst-plugin-smarturi-perl

Install libcatalyst-plugin-smarturi-perl 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 libcatalyst-plugin-smarturi-perl using aptitude by running the following command:

sudo aptitude -y install libcatalyst-plugin-smarturi-perl

How To Uninstall libcatalyst-plugin-smarturi-perl on Ubuntu 18.04

To uninstall only the libcatalyst-plugin-smarturi-perl package we can use the following command:

sudo apt-get remove libcatalyst-plugin-smarturi-perl

Uninstall libcatalyst-plugin-smarturi-perl And Its Dependencies

To uninstall libcatalyst-plugin-smarturi-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libcatalyst-plugin-smarturi-perl

Remove libcatalyst-plugin-smarturi-perl Configurations and Data

To remove libcatalyst-plugin-smarturi-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libcatalyst-plugin-smarturi-perl

Remove libcatalyst-plugin-smarturi-perl configuration, data, and all of its dependencies

We can use the following command to remove libcatalyst-plugin-smarturi-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libcatalyst-plugin-smarturi-perl

References

Summary

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