gnome-session command not found

In this troubleshooting guide we learn how to fix gnome-session command not found error message

Introduction

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

gnome-session: command not found

or when using sudo you get the following error message

sudo: gnome-session: command not found

Solutions to gnome-session: command not found

How To Fix gnome-session: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu gnome-session is provided by gnome-session-bin package.

gnome-session-bin is:

The GNOME Session Manager is in charge of starting the core components of the GNOME desktop, and applications that should be launched at login time. It also features a way to save and restore currently running applications.

This package contains the binaries for the GNOME Session Manager, but no startup scripts. It is meant for those willing to start gnome-session by hand with the components of their choice, and for applications such as GDM that use gnome-session internally.

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

sudo apt-get -y install gnome-session-bin

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

You can also use apt command to install gnome-session-bin.

sudo apt -y install gnome-session-bin

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

sudo aptitude install gnome-session-bin

Summary

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