How to Uninstall and Install policy-rcd-declarative on Ubuntu 22.04

Updated: September 7, 2022

Debian policy states that packages providing system services need to start those services by default, and that the starting of the service should be done by way of the /usr/sbin/invoke-rc.d script. This script will execute a program /usr/sbin/policy-rc.d if it exists, allowing the local system administrator to override behaviour if wanted by creating a policy script accordin to the interface specified and installing it under the correct name. This interface is however somewhat problematic, as explained in https://bugs.debian.org/911290. In this guide, I will show you how to install policy-rcd-declarative on Ubuntu 22.04.

Requirements to install

  • Operating system: Ubuntu 22.04 or older Ubuntu versions
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install policy-rcd-declarative on Ubuntu 22.04

Install policy-rcd-declarative Ubuntu 22.04

policy-rcd-declarative is one of the popular ways on Ubuntu now so that this tutorial will show you some ways to install it. Choose the one that you think is easy and you can follow.

Install policy-rcd-declarative using APT

This is one of the most popular methods for installing Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these steps to get policy-rcd-declarative on your Ubuntu.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt -y update

Step 2: Start installing the packages on Ubuntu 22.04. After updating, you can install policy-rcd-declarative Ubuntu by executing this command in the terminal.

sudo apt-get install policy-rcd-declarative

Install policy-rcd-declarative using Aptitude

If you didn’t install Aptitude on Ubuntu, you need to install it by executing this command.

sudo apt-get install aptitude

Then, you can now install policy-rcd-declarative, just following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating, you can install policy-rcd-declarative Ubuntu by pasting this command into the terminal and pressing Enter.

sudo aptitude -y install policy-rcd-declarative

Uninstall policy-rcd-declarative on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu is difficult? You are mistaken; Anyone can easily uninstall any program, not just policy-rcd-declarative.

This command can be used to uninstall policy-rcd-declarative from Ubuntu 22.04 if it was installed using APT or Aptitude.

sudo apt remove --auto-remove policy-rcd-declarative

To uninstall policy-rcd-declarative and remove its data and dependencies, you can also use the following command:

sudo apt autoremove --purge policy-rcd-declarative

Summary

In this tutorial, I showed you ways to install policy-rcd-declarative on Ubuntu 22.04 and some ways to uninstall policy-rcd-declarative too. Please do not hesitate to contact me if you require any assistance. I’m delighted to respond to them.