Fix add-apt-repository command not found error in Ubuntu

Try this guide with our instant dedicated server for as low as 40 Euros

add-apt-repository command not found

While it is very infrequent, you can encounter the add-apt-repository command not found error on Ubuntu. This error stems from the situation where the add-apt-repository script is absent on your system. 

In this comprehensive tutorial, we will present a detailed solution to this issue by helping you go through the process of installing the software-properties-common package and restoring the functionality of the add-apt-repository command. 

Table Of Contents

  1. Resolve the add-apt-repository command not found Error in Ubuntu and Debian
    1. The Prerequisites
    2. Step #1: Update Local Ubuntu Repositories
    3. Step #2: Set up the software-properties-common package
  2. How to Add a Repository in Ubuntu and Debian
  3. What is a Repository in Ubuntu
  4. Conclusion
  5. FAQs

Resolve the add-apt-repository command not found Error in Ubuntu and Debian

Let’s look at the prerequisites before we go into the details of the process.

The Prerequisites

Here are the prerequisites you need to have on hand before you go ahead with trying the fix:

  • A system running Ubuntu or any other Debian-based distribution
  • A user account with root or sudo permissions

Step #1: Update Local Ubuntu Repositories

Run the following command to update the local repository index on your Ubuntu machine:

# sudo apt update

sudo apt update

During the process, the system verifies that the list of software repositories on your machine is updated to the latest or most stable versions available in the Ubuntu repositories.

Step #2: Set up the software-properties-common package

The add-apt-repository script cannot be directly installed using apt on Ubuntu LTS or Debian as it is not a standalone package. Since this script is actually part of the software-properties-common package, you need to install the package with the following command:

# sudo apt install software-properties-common

sudo apt install software-properties-common

Next, refresh the system repository index by executing the following command:

# sudo apt update

 

How to Add a Repository in Ubuntu and Debian

Some software packages are not available in the standard repositories. 

Developers established their repositories to sidestep this problem. If you wish to install packages from these repositories, we recommend using the add-apt repository command.

Software packages may have additional licensing restrictions that can prevent their inclusion in the standard distribution repository. In such instances, using the add-apt repository command is essential for obtaining access to the desired software for installation.

Let’s consider Wine as an example of this idea. 

In almost all major Linux distributions, it is used to run non-Linux applications on a Linux environment. However, its most recent version is not accessible via the standard repositories.

So, to get the most recent version of Wine on your Ubuntu system, start by activating the standard wine repository:

# sudo apt-add-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main’

What is a Repository in Ubuntu

A software package is a standard Linux term for a program or application. Sometimes, a package relies on additional packages, known as dependencies, for its operation.

The role of a package manager is to facilitate the installation of your desired software package. It also takes care of installing any necessary dependencies. Beyond installation, a package manager maintains a record of all software installations and manages updates automatically.

Package managers operate alongside software repositories, which are extensive databases containing a variety of software packages. Typically, each Linux distribution provides access to a selection of standard, default repositories.

In Ubuntu, the standard repositories include:

  • Main: Open-source software provided by Ubuntu contributors.
  • Universe: Open-source software from the broader Linux community.
  • Restricted: Hardware drivers and software packages that are subject to manufacturer licenses.
  • Multiverse: Software under copyright or other legal constraints.

For Debian, the standard repositories are:

  • Main: Software that is freely licensed.
  • Contrib: Free software reliant on proprietary licensed software.
  • Non-free: Software with usage and distribution limitations.

Conclusion

This extensive tutorial addresses the add-apt-repository not found error on Ubuntu or Debian by installing the software-properties-common package.

Understanding the role of this command is pivotal, especially when encountering issues related to repository access. 

For high-traffic server needs, explore RedSwitches’ 10Gbps servers to optimize performance and reliability. Elevate your hosting experience with powerful servers designed for robust, high-speed data processing. Check out RedSwitches for 10Gbps high-traffic servers and enhance your server capabilities.

FAQs

Q. What does it mean when Ubuntu shows ‘add-apt-repository command not found’ error?

This error indicates that the “add-apt-repository” command is not available on your Ubuntu or Debian-based system, which prevents you from adding new apt repositories.

Q. How do I resolve the ‘add-apt-repository command not found’ error on Ubuntu?

Resolve this error by installing the “software-properties-common” package that includes the “add-apt-repository” command. To install, execute: sudo apt install software-properties-common.

Q. What is the function of the “add-apt-repository” command in Ubuntu?

The “add-apt-repository” command is used for easily adding new apt repositories to your Ubuntu or Debian system, facilitating the addition of software packages not present in the default repositories.

Q. Why does the ‘add-apt-repository command not found’ error occur when adding a repository?

This error typically occurs when the “add-apt-repository” command is missing from the system, often seen in new installations or systems not configured for adding extra repositories.

Q. How do I fix the ‘add-apt-repository command not found’ error when installing software?

Fix this error by installing the “software-properties-common” package, which includes the “add-apt-repository” command. Install it using: sudo apt install software-properties-common.

Q. Is it possible to get the ‘add-apt-repository command not found’ error in Docker containers?

Yes, this error can occur in Docker containers when attempting to add new repositories. To fix it, ensure the necessary packages are installed in the Docker container.

Q. What should I do if I get an ‘add-apt-repository command not found’ error?

If this error appears, it means the “add-apt-repository” command is missing from your system. Install the “software-properties-common” package to resolve it.

Q. How can I learn to rectify the ‘add-apt-repository command not found’ error in Ubuntu or Debian?

Learn to rectify this error by installing the “software-properties-common” package, enabling you to add new apt repositories to your system.

Q. Why does the system mention upgrades and additional disk space after fixing the ‘add-apt-repository command not found’ error?

Post installing the “software-properties-common” package to fix the error, the system might indicate upgrades and additional disk space usage as part of the standard package installation and upgrade process.

Q. Does the ‘add-apt-repository command not found’ error imply problems with apt repositories?

No, this error doesn’t suggest issues with apt repositories but indicates the absence of the required command for managing them. Installing the “software-properties-common” package allows for apt repository management.

Try this guide with our instant dedicated server for as low as 40 Euros