How To Install libnss-resolve on Ubuntu 20.04
Introduction
In this tutorial we learn how to install libnss-resolve on Ubuntu 20.04.
What is libnss-resolve
libnss-resolve is:
nss-resolve is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing DNS and LLMNR resolution to programs via the systemd-resolved daemon (provided in the systemd package).
Installing this package automatically adds resolve to /etc/nsswitch.conf.
Package: libnss-resolve Architecture: amd64 Version: 245.4-4ubuntu3 Multi-Arch: same Priority: optional Section: universe/admin Source: systemd Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian systemd Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 473 Depends: libc6 (>= 2.30), systemd (= 245.4-4ubuntu3) Filename: pool/universe/s/systemd/libnss-resolve_245.4-4ubuntu3_amd64.deb Size: 128948 MD5sum: 4b7df3c81468df520363581fa01b7314 SHA1: 8f075ad95d073ba8329c7ccb87c3893342dc9556 SHA256: 022b19d1f44583f37898abba2731f263a8ced4b0bf2debe3a72fceb1ac8f108b Homepage: https://www.freedesktop.org/wiki/Software/systemd Description-en: nss module to resolve names via systemd-resolved nss-resolve is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing DNS and LLMNR resolution to programs via the systemd-resolved daemon (provided in the systemd package).
Installing this package automatically adds resolve to /etc/nsswitch.conf.
There are three methods to install libnss-resolve on Ubuntu 20.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 libnss-resolve Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install libnss-resolve using apt-get by running the following command:
sudo apt-get -y install libnss-resolve
Install libnss-resolve Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install libnss-resolve using apt by running the following command:
sudo apt -y install libnss-resolve
Install libnss-resolve 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 libnss-resolve using aptitude by running the following command:
sudo aptitude -y install libnss-resolve
How To Uninstall libnss-resolve on Ubuntu 20.04
To uninstall only the libnss-resolve package we can use the following command:
sudo apt-get remove libnss-resolve
Uninstall libnss-resolve And Its Dependencies
To uninstall libnss-resolve and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove libnss-resolve
Remove libnss-resolve Configurations and Data
To remove libnss-resolve configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge libnss-resolve
Remove libnss-resolve configuration, data, and all of its dependencies
We can use the following command to remove libnss-resolve configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge libnss-resolve
References
Summary
In this tutorial we learn how to install libnss-resolve package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.