How To Install adduser on Debian 12

Learn how to install adduser on Debian 12 with this tutorial. adduser is add and remove users and groups

Introduction

In this tutorial we learn how to install adduser on Debian 12.

What is adduser

adduser is:

This package includes the ‘adduser’ and ‘deluser’ commands for creating and removing users.

  • ‘adduser’ creates new users and groups and adds existing users to existing groups;
  • ‘deluser’ removes users and groups and removes users from a given group.

Adding users with ‘adduser’ is much easier than adding them manually. ‘Adduser’ will choose UID and GID values that conform to Debian policy, create a home directory, copy skeletal user configuration, and automate setting initial values for the user’s password, real name and so on.

‘Deluser’ can back up and remove users’ home directories and mail spool or all the files they own on the system.

A custom script can be executed after each of the commands.

‘Adduser’ and ‘Deluser’ are intended to be used by the local administrator in lieu of the tools from the ‘useradd’ suite, and they provide support for easy use from Debian package maintainer scripts, functioning as kind of a policy layer to make those scripts easier and more stable to write and maintain.

There are three methods to install adduser on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install adduser Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install adduser

Install adduser Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install adduser using apt by running the following command:

sudo apt -y install adduser

Install adduser 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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install adduser using aptitude by running the following command:

sudo aptitude -y install adduser

How To Uninstall adduser on Debian 12

To uninstall only the adduser package we can use the following command:

sudo apt-get remove adduser

Uninstall adduser And Its Dependencies

To uninstall adduser and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove adduser

Remove adduser Configurations and Data

To remove adduser configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge adduser

Remove adduser configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge adduser

Dependencies

adduser have the following dependencies:

References

Summary

In this tutorial we learn how to install adduser package on Debian 12 using different package management tools: apt, apt-get and aptitude.