xdg-desktop-icon command not found

In this troubleshooting guide we learn how to fix xdg-desktop-icon command not found error message

Introduction

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

xdg-desktop-icon: command not found

or when using sudo you get the following error message

sudo: xdg-desktop-icon: command not found

Solutions to xdg-desktop-icon: command not found

How To Fix xdg-desktop-icon: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu xdg-desktop-icon is provided by xdg-utils package.

xdg-utils is:

xdg-utils contains utilities for integrating applications with the desktop environment, regardless of which desktop environment is used.

The following utilities are included:

  • xdg-desktop-menu - Install desktop menu items
  • xdg-desktop-icon - Install icons on the user’s desktop
  • xdg-email - Compose a new email in the user’s preferred email client, potentially with subject and other info filled in
  • xdg-icon-resource - Install icon resources
  • xdg-mime - Query and install MIME types and associations
  • xdg-open - Open a URI in the user’s preferred application that handles the respective URI or file type
  • xdg-screensaver - Enable, disable, or suspend the screensaver
  • xdg-settings - Get or set the default web browser and URI handlers

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

sudo apt-get -y install xdg-utils

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

You can also use apt command to install xdg-utils.

sudo apt -y install xdg-utils

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

sudo aptitude install xdg-utils

Summary

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