How To Install shutdown-at-night on Ubuntu 20.04
Introduction
In this tutorial we learn how to install shutdown-at-night
on Ubuntu 20.04.
What is shutdown-at-night
shutdown-at-night is:
With this tool you can schedule regular shutdowns of workstations in the evening, and also wake them up every morning, using either nvram-wakeup, ACPI wakeup or wake-on-lan.
For the wake-on-lan wake-up sequence you need one awake machine on your local network / subnet. This can be a server machine or a client machine that got just previously woken up by nvram-wakeup.
The shutdown sequence will be initiated hourly after 4pm via a CRON job. However, only machines that appear inactive / unused will be shut down. Machines that are currently in use will remain up and running.
The Shutdown-at-Night tool can be activated via a config file or via membership in a NIS netgroup called shutdown-at-night-hosts.
There are three methods to install shutdown-at-night
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 shutdown-at-night Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install shutdown-at-night
using apt-get
by running the following command:
sudo apt-get -y install shutdown-at-night
Install shutdown-at-night Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install shutdown-at-night
using apt
by running the following command:
sudo apt -y install shutdown-at-night
Install shutdown-at-night 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 shutdown-at-night
using aptitude
by running the following command:
sudo aptitude -y install shutdown-at-night
How To Uninstall shutdown-at-night on Ubuntu 20.04
To uninstall only the shutdown-at-night
package we can use the following command:
sudo apt-get remove shutdown-at-night
Uninstall shutdown-at-night And Its Dependencies
To uninstall shutdown-at-night
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove shutdown-at-night
Remove shutdown-at-night Configurations and Data
To remove shutdown-at-night
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge shutdown-at-night
Remove shutdown-at-night configuration, data, and all of its dependencies
We can use the following command to remove shutdown-at-night
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge shutdown-at-night
References
Summary
In this tutorial we learn how to install shutdown-at-night
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.