How to Fix ‘Add-apt-repository’ Command not Found

Some folks using Debian, Ubuntu or Ubuntu-based distributions like Linux Mint get the error ‘add-apt-repository not found’ while trying to add a PPA (Personal Package Archive) or another repository link to their apt sources. This error is usually caused by not having the “add-repository” package installed on their systems.

add-apt Repository Not Found

Now, to get you started, we are going to have a look at what actually add-repository package is in Ubuntu.

What is the APT and add-repository package in Ubuntu?

Well, APT or Aptitude is a package manager developed for Debian and it is the package manager used in Ubuntu and other Debian based distributions. Linux Mint also uses the Aptitude package manager because it is based on Ubuntu.  A package manager in Linux Distributions is a software that is used for handling all the packages that you install in your computer thus making it an easier approach to handle all the software installed on your system and not messing them up.

Since Ubuntu is based on Debian, it also has the add-repository package which provides you the option to add a repository or a PPA from your terminal. This package or software allows you to easily add a PPA right from your terminal without needing to change the system files yourself i.e you don’t have to manually edit the sources of apt and add repositories manually.

What causes the “add-apt-repository-command not found” Error Message?

As we have mentioned earlier, this error is mainly caused because you are missing the package called add-repository on your Ubuntu or Linux Mint systems. You can find a more detailed explanation down below:

  • Missing add-repository Package: What the add-apt-repository command does is that it automates the process of adding a repository to your sources.list in Debian based Operating Systems. If you don’t use this command, then you have to fall back to the old way of editing your apt sources.list from the terminal and adding your repository there. Hence, it’s a pretty useful tool developed for just one purpose i.e to add your needed repositories and install software from them.

Let’s say if you want to add a PPA to your Ubuntu system, usually, the command you are going to use is:

sudo add-apt-repository ppa:nameofppa

But when you don’t have this package installed on your system. You will get the following output:

add-apt-repository command not found

Installing the add-repository Package

The solution here is really simple. All you have to do is to install the package called “add-repository” in your Ubuntu or Linux Mint system. Here’s how to do it:

  1. Open up a Terminal.
  2. Afterward, enter the following commands:
    sudo apt update && sudo apt-upgrade
    sudo apt install add-repository
    sudo apt update && sudo apt-upgrade
    sudo apt-get install add-repository
    Updating the Distro
  3. If you get the error that “add-repository package not found”, then you might have outdated mirrors on your system and you need to fix them first.
  4. The best way to do it on Ubuntu (versions above 12.04) is to run the following command from the terminal:
    sudo software-properties-gtk
  5. A window of software settings and sources will open. There you need to change the download server location which is found on the Software tab (first tab) and select the best server.
  6. To do that, click on the Download from the drop-down menu and select “Other”.
    Choosing a Server Location
  7. Then, you need to click on “Select Best Server”. Now, Ubuntu will take some time choosing the best and updated mirror for you. After that, you can exit the software.
  8. There you are, your mirrors should have been fixed by doing that.
  9. Finally, you need to run the above commands again and hopefully, you will be able to install the “add-repository” package.
  10. After it is installed, you won’t get the error “add-repository command not found” anymore.

Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.