While installing software on Ubuntu using the command line, you might have noticed the word "repository" often used in the output. If you're new to the whole Linux universe, then this might be a new term for you. What does it mean, and why does your system need these repositories?

This article will introduce you to the concept of repositories in Ubuntu, along with a brief description of the various types of repositories available to use.

An Introduction to Repositories

Person sitting and typing at their laptop

Generally speaking, a repository is a collection of multiple items stored together in enormous quantities. On Ubuntu and other Unix-based operating systems, a repository refers to a ginormous collection of software and packages that you can install on your system.

Unlike Windows and macOS, Linux provides software to its users in a well-packaged format, which is different across different distributions. For example, Debian-based distributions rely on DEB packages. Similarly, you will find RPM packages on Fedora, CentOS, and other RHEL-based distros.

Related: Things That Ubuntu Does Better Than Windows

Since repositories are a collection of such packages, users can refer to these repositories to find and download the package they need. You can find almost every tool you need in them.

Also, different Linux distros have their own set of repositories. On Ubuntu, the default ones will belong to Ubuntu itself. Apart from these, users can also add any of their choice by using the add-apt-repository command.

The recommended way to install packages on Ubuntu is using the official repositories. This is because the packages you find in these repositories are specially developed for Ubuntu. Also, regular updates pushed by the developers ensure that the software works properly.

Types of Repositories in Ubuntu

Person working on their laptop from a rooftop

Ubuntu ships with four different types of repositories. Namely, these are Main, Restricted, Universe, and Multiverse. Some, like Main, are open by default. But for others, you have to enable universe and multiverse before you can start fetching packages from them.

1. Main

Main includes software and packages that are fully supported by the Ubuntu team. If you've installed software from the main repository, Ubuntu will regularly provide you with security updates and bug fixes for those packages.

This repository consists of open-source packages that are free to use and redistribute. Also, you'll find that Ubuntu comes with most of the packages in the main repository as they are important utilities required by the system as well as the user.

2. Restricted

Although you can use the software available in Restricted repositories without any charge under a free license, you can't redistribute these packages. The restricted repository includes tools and drivers that are necessary for the proper working of the operating system.

The Ubuntu team doesn't provide support for such programs as they belong to another author. Also, Canonical, the company responsible for managing Ubuntu, can't modify the package as most of the software included in the Restricted repository is proprietary.

3. Universe

As the name suggests, Universe contains every open-source package developed for the Linux operating system. These packages aren't directly managed by the Ubuntu team. The community of developers working on a package is solely responsible for pushing updates and security fixes.

However, Ubuntu can move the package from Universe to Main if the developers agree to follow the specific standards set by them.

4. Multiverse

While the repositories mentioned above contain packages that are either free to use or open-source, multiverse includes software that isn't available for free. Proprietary programs with no license or legal issues are also included in Multiverse.

Installing packages from this repository is not recommended because the risk associated with these programs is significant.

Working With Repositories and Packages

Linux gives you complete control over which repository to choose while installing packages. You can either go for the trusted Ubuntu repositories if you want to be on the safe side, or you can download Linux software from the universe or multiverse repository. But that's only suggested if you know what you're doing.

Every Linux distribution comes with a default package manager responsible for installing, updating, and upgrading packages on the system. For example, Ubuntu comes with APT and dpkg, and Fedora Linux uses DNF for managing packages. On Arch Linux, you can install and remove software using pacman, which is the default package manager that ships with the OS.