How to Uninstall and Install needrestart on Ubuntu 22.04

Updated: September 7, 2022

needrestart checks which daemons need to be restarted after library upgrades. It is inspired by checkrestart from the debian-goodies package. In this tutorial, I will show you ways to install needrestart Ubuntu 22.04.

Prerequisites to install

  • Operating system: Ubuntu 22.04 or older versions with more than 2GB RAM
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install needrestart on Ubuntu 22.04

Install needrestart Ubuntu 22.04

needrestart is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one that you think is easy and you can follow.

Install needrestart using APT

This is a popular method for installing any Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these steps to install needrestart 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 download new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install needrestart Ubuntu by pasting this command into the terminal and pressing Enter.

sudo apt-get -y install needrestart

Install needrestart using Aptitude

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

sudo apt -y install aptitude

After that, you can now install needrestart, just following these steps:

Step 1: Update the APT database to download new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install needrestart Ubuntu by executing this command in the terminal.

sudo aptitude -y install needrestart

Uninstall needrestart on Ubuntu 22.04

Have you ever considered how challenging it might be to uninstall an application from Ubuntu? You’re wrong, anyone can easily uninstall any program, not just a needrestart.

If you installed needrestart using APT or Aptitude, you could uninstall needrestart on Ubuntu by running this command

sudo apt remove --auto-remove needrestart

If you want to uninstall needrestart and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge needrestart

Conclusion

In this guide, I showed you ways to install needrestart on Ubuntu 22.04 and some ways to uninstall needrestart too. Please contact me if you require any assistance. I’d be delighted to respond.