| by Arround The Web | No comments

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

“In Linux, the “apt-add-repository” command is used to add a new repository to a system for installing any or all the packages belonging to that repository. This command adds the repository into the /etc/apt/sources.list file or 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. Let’s see why your system returns this error and how to fix it in Debian 11.”

Reason for “apt-add-repository” Command Not Found” Error

On Debian-based Linux OS, you can install most of the packages using the default repositories. APT is used to add, remove and update the packages from these repositories. To install the packages that are not available in the default repositories, you are required to add external repositories. The apt-add-repository command is used to add and remove a repository in Debian-based systems. However, in some cases, it returns 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.

How to Fix the “apt-add-repository” Command Not Found Issue on Debian 11

To fix the error “apt-add-repository command not found” issue on Debian 11, perform the following steps:

1. Update Repository Index
First, update the repository index in your Debian system using the command below:

$ sudo apt update

Provide your password to update the repository index.

2. Install the Software-Properties-Common Package on Your Debian 11 System
The apt-add-repository command belongs to the software-properties-common package. Therefore, in order to make the apt-add-repository command work, you must install the software-properties-common package. You can install this package using the apt command as follows:

$ sudo apt install software-properties-common

It will install the software-properties-common, including the apt-add-repository command to your Debian 11 system. Use the command below to confirm it:

$ dpkg --listfiles software-properties-common | grep apt-add-repository

In the following output, you can see that the apt-add-repository is a part of the software-properties-common package.

Now you can easily add any repository to your system without any issue.

Conclusion

After following the procedure explained in this article, you should be able to fix the “apt-add-repository command not found” error and add any repository of your choice to your Debian 11 system. Besides Debian 11, you can use this fix for other Debian-based distributions as well.

Share Button

Source: linuxhint.com

Leave a Reply