If you’ve installed Ubuntu from scratch, you may have noticed that the add-apt-repository command is not available by default. This is because the add-apt-repository command is in the python-software-properties package, which is not installed by default. Fortunately, it’s easy to install the python-software-properties package and make the add-apt-repository command available.
Contents
How to Fix ‘Add-apt-repository’ Command not Found
What is the ‘add-apt-repository’ command?
The ‘add-apt-repository’ command is used to add new repositories to your Ubuntu system. This is useful if you want to install new software that is not available in the default Ubuntu repositories. For example, if you want to install the latest version of a certain software program, you can use this command to add a repository that contains that program.
To use this command, you will need to specify the repository that you want to add. This can be done by using the ‘-r’ option followed by the repository URL. For example, to add the Ubuntu Extra repository, you would use the following command:
add-apt-repository -r http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/
Once you have added the repository, you can then install the software by using the ‘apt’ command. For example, to install the ‘wget’ program, you would use the following command:
apt install wget
If you want to remove a repository that you have added, you can use the ‘remove-apt-repository’ command. For example, to remove the Ubuntu Extra repository, you would use the following command:
remove-apt-repository -r http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/
Why is this command not working?
There are a number of reasons why the “add-apt-repository” command might not be working on your system. Here are a few potential causes:
1. You might not have the “software-properties-common” package installed. This package provides the “add-apt-repository” command. Try running “sudo apt-get install software-properties-common” to install it.
2. You might be using an older version of Ubuntu that doesn’t have this command. The “add-apt-repository” command was first introduced in Ubuntu 9.10. If you’re using an older version of Ubuntu, you can either upgrade to a newer version, or use an alternative method for adding repositories.
3. There might be a problem with the repository that you’re trying to add. If you’re encountering an error when running the “add-apt-repository” command, it’s likely that there’s a problem with the repository itself. Try adding the repository using a different method, or contact the repository maintainer for help.
How to fix the ‘add-apt-repository’ command not working
If you’ve come across the ‘add-apt-repository’ command not working in Ubuntu error, it usually means that the software repository isn’t set up correctly on your system. Here’s how you can go about fixing the problem.
First, you need to add the repository that you want to install the software from. To do this, open up a terminal and type in the following command:
sudo add-apt-repository ppa: Replace ‘ sudo add-apt-repository ppa:software-center/ppa Once the repository has been added, you can then install the software by running the following command: sudo apt-get install Replace ‘ sudo apt-get install software-center If you still get the ‘add-apt-repository’ command not working in Ubuntu error, it’s likely that the repository you’re trying to add doesn’t exist. Make sure you’re using the correct repository name and PPA name. If you’re trying to use the add-apt-repository command and you get the “command not found” error, it’s most likely because you don’t have the apt-add-repository package installed. You can install this package with the command: sudo apt-get install apt-add-repository.Conclusion