Best Way – Fix apt add repository Command Not Found on Debian 11

In this guide, we intend to teach you How To Fix apt add repository Command Not Found on Debian 11.

add-apt-repository is a Python script that allows you to add an APT repository to either /etc/apt/sources. list or to a separate file in the /etc/apt/sources. list. d directory.

However, after running the “apt-add-repository” command for the first time in your Debian 11 system, you may receive the “apt-add-repository command not found” error.

This error appears because the package “software-properties-common” to which the “apt-add-repository” command belongs is missing from your system.

Fix apt add repository Command Not Found on Debian 11

Now follow the steps below to fix this error.

Resolve the “apt-add-repository” Command Not Found on Debian 11

The first step is to update your Debian system repository with the following command:

sudo apt update

Install Software-Properties-Common Package on Debian 11

This software provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.

This package contains the common files for software properties like the apt-add-repository.

You can easily install the Software-Properties-Common Package by running the command below:

sudo apt install software-properties-common
Output
...
etting up software-properties-common (0.96.20.2-2.1) ...
Processing triggers for libc-bin (2.31-13) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-2) ...

Then, update the repository again with:

sudo apt update

Confirm apt-add-repository is available on Debian 11

At this point, you can verify that apt-add-repository is available on your server by running the command below:

dpkg --listfiles software-properties-common | grep apt-add-repository
Output
/usr/bin/apt-add-repository
/usr/share/man/man1/apt-add-repository.1.gz

As you can see from the output, the apt-add-repository is a part of the software-properties-common package.

That’s it you are done.

Conclusion

At this point, you have learned to Fix the “apt-add-repository” Command Not Found on Debian 11.

Hope you enjoy it.

You may be like these articles on the OrcaCore website:

How To Install LAMP Stack on Debian 10

Secure Apache with Let’s Encrypt on Debian 10

Install and Configure Mattermost on Debian 11

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!