Installing packages via APT

Overview

OSMC is based on Debian. Debian uses a packaging system called APT (Advanced Packaging Tool) to retrieve and install packages. OSMC includes all upstream Debian packages, giving you access to over 40,000 packages to install quickly and easily. APT can be invoked via the command line.

Updating your sources

APT needs a way to keep track of the packages that are available for installation, as well as any packages on your device that can be upgraded. This is kept track of via a ‘sources’ file. If you are planning on installing a new package, you should always run the following command first:

sudo apt-get update

Installing packages

You can install a package by executing the following command:

sudo apt-get install PACKAGENAME

For example, to install the Apache2 web server, one would run

sudo apt-get install apache2

Removing packages

Any package that has been installed via APT can be removed by running the following command:

sudo apt-get remove PACKAGENAME

For example, to uninstall the Apache2 web server, you can run the following command:

sudo apt-get remove apache2

Removing old dependencies

When you installed a package, you may have noticed that several others were installed. This means that the package you installed needed other packages to run on your system. This is known as a dependency. When you uninstall a package, these old dependencies are left on your system. They can be cleaned up safely by running the following command after package removal:

sudo apt-get autoremove

See also

  • You can learn more about keeping OSMC and other packages up to date here.
  • You can learn more about apt-get here

The ‘Removing old dependencies’ command is wrong, the correct one is
sudo apt-get autoremove
Without the hyphen symbol in the middle.

Regards

Thanks, I have corrected it