How To Install policyrcd-script-zg2 on Ubuntu 18.04

In this tutorial we learn how to install policyrcd-script-zg2 on Ubuntu 18.04. policyrcd-script-zg2 is policy-compliant interface from invoke-rc.d to local config files

Introduction

In this tutorial we learn how to install policyrcd-script-zg2 on Ubuntu 18.04.

What is policyrcd-script-zg2

policyrcd-script-zg2 is:

This package contains a script which is linked via the alternatives subsystem to /usr/sbin/policy-rc.d. This script looks for a local policy-rc.d script in /usr/local and /etc, providing a policy- and FHS-compliant way to interface invoke-rc.d with a local script.

Without this package, a local admin wanting to cleanly interface with invoke-rc.d is forced to drop a local binary to /usr/sbin and/or manually interface with the alternatives system. Both ways of doing this are clumsy and error-prone, so this package offers a clean way of interfacing with sysvrc and file-rc.

Since there are at least two packages containing their own version of invoke-rc.d, having a search path policy for policy-rc.d can be messy and is prone to be unstructured and uncoordinated.

Hence, having a dedicated package is the clean way of doing things.

This package has its upstream sources maintained in the Debian project, so there is no upstream URL.

There are three methods to install policyrcd-script-zg2 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 policyrcd-script-zg2 Using apt-get

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

sudo apt-get update

After updating apt database, We can install policyrcd-script-zg2 using apt-get by running the following command:

sudo apt-get -y install policyrcd-script-zg2

Install policyrcd-script-zg2 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install policyrcd-script-zg2 using apt by running the following command:

sudo apt -y install policyrcd-script-zg2

Install policyrcd-script-zg2 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 policyrcd-script-zg2 using aptitude by running the following command:

sudo aptitude -y install policyrcd-script-zg2

How To Uninstall policyrcd-script-zg2 on Ubuntu 18.04

To uninstall only the policyrcd-script-zg2 package we can use the following command:

sudo apt-get remove policyrcd-script-zg2

Uninstall policyrcd-script-zg2 And Its Dependencies

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

sudo apt-get -y autoremove policyrcd-script-zg2

Remove policyrcd-script-zg2 Configurations and Data

To remove policyrcd-script-zg2 configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge policyrcd-script-zg2

Remove policyrcd-script-zg2 configuration, data, and all of its dependencies

We can use the following command to remove policyrcd-script-zg2 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge policyrcd-script-zg2

References

Summary

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