Fixing the ‘add-apt-repository: command not found’ error on Ubuntu is a common issue that can be quickly resolved. This error message typically appears when trying to add a new software repository to your system but the required package is missing. Within a few moments, you can solve this problem by installing the necessary package and continue with your software installation smoothly.
Step by Step Tutorial to Fix ‘add-apt-repository: command not found’ Error on Ubuntu
Before diving into the steps, it’s important to understand that this process will install the software-properties-common package, which contains the ‘add-apt-repository’ command. Once installed, you will be able to add new repositories to your system without any errors.
Step 1: Update the Package List
Update the package list to make sure you install the latest version of the required package.
Updating the package list ensures that you have the latest information on the available packages and their versions before you start the installation process. This can help prevent potential conflicts and ensure a smooth installation.
Step 2: Install software-properties-common Package
Install the software-properties-common package using the apt-get install command.
This step is the crux of the solution. The software-properties-common package is what includes the ‘add-apt-repository’ command. Installing it will resolve the error and enable you to move forward with adding your new repository.
After completing these steps, the ‘add-apt-repository’ command will be available on your system, and you should be able to add new repositories without encountering the error message.
Tips for Fixing ‘add-apt-repository: command not found’ Error on Ubuntu
- Make sure you have a stable internet connection before starting the process to avoid any interruptions.
- If you’re running a version of Ubuntu older than 16.04, you may need to use ‘apt-get’ instead of ‘apt’ in the commands.
- Always use ‘sudo’ before the commands to ensure you have the necessary permissions.
- After installing the package, it’s a good idea to run ‘sudo apt-get update’ to refresh the package list.
- Check for typos in the commands to avoid running into other errors.
Frequently Asked Questions
What is ‘add-apt-repository’ used for?
‘add-apt-repository’ is a command used to add new software repositories to the Ubuntu package manager, allowing you to install and update software from these repositories.
Can I use ‘add-apt-repository’ without installing software-properties-common?
No, the ‘add-apt-repository’ command is part of the software-properties-common package, so it must be installed to use the command.
What if I encounter errors during the package installation?
If you encounter errors during the installation, try running ‘sudo apt-get update’ and then rerun the install command. If the problem persists, check your internet connection and the Ubuntu forums for support.
Do I need to reboot my system after installing the package?
No, you do not need to reboot your system after installing the software-properties-common package.
Can I remove the software-properties-common package after I’ve added the repository?
Yes, you can remove the package, but this will also remove the ‘add-apt-repository’ command, which may be required for future repository additions.
Summary
- Update the package list.
- Install the software-properties-common package.
Conclusion
Facing an ‘add-apt-repository: command not found’ error on Ubuntu can be a little frustrating, especially if you’re in the middle of setting up your system with new software. However, as we’ve seen, it’s a pretty straightforward issue to fix. By following the outlined steps, you’re not just resolving the error but also equipping your system with a tool that will make future software additions a breeze. Remember, the key is to ensure that your system package list is updated and that you have the necessary package installed. Beyond this fix, always consider the additional tips provided to avoid common pitfalls and ensure an even smoother experience with Ubuntu. Whether you’re a seasoned Linux user or just getting started, knowing how to navigate these common errors is an invaluable skill that will save you time and enhance your overall experience with this powerful operating system. Now that you’re equipped with this knowledge, you’re ready to add repositories and expand your system’s capabilities without a hitch!

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.