xautolock command not found

In this troubleshooting guide we learn how to fix xautolock command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

xautolock: command not found

or when using sudo you get the following error message

sudo: xautolock: command not found

Solutions to xautolock: command not found

How To Fix xautolock: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu xautolock is provided by xautolock package.

xautolock is:

Xautolock monitors input devices under the X Window System, and launches a program of your choice if there is no activity after a user-configurable period of time. You can use this to automatically start up a screen locker if you have left your computer unattended for some period of time. The program launched need not be a screen locker such as xlock.

To fix this problem, we can install more using the command below.

sudo apt-get -y install xautolock

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install xautolock.

sudo apt -y install xautolock

Or if you have aptitude installed you can use the following command.

sudo aptitude install xautolock

Summary

In this tutorial we learn how to fix xautolock command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.