How to Resolve add-apt-repository: command not found Error on Ubuntu Linux

This tutorial instructs how to fix ‘sudo: add-apt-repository: command not found’ error in Ubuntu 18.04 | 16.04, common in Ubuntu’s minimal server version. The ‘add-apt-repository’ command doesn’t come installed in the minimal version. To resolve this, ‘software-properties-common’ needs to be installed enabling the user to add a PPA repository.

This brief tutorial shows students and new users how to quickly and easily fix the sudo: add-apt-repository: command not found error when using Ubuntu 18.04 | 16.04.

Most Ubuntu users tend to install the Ubuntu minimal server version. With the minimal version of Ubuntu, you get a limited set of tools and packages, which are just enough to operate the server in most environments.

Because of the limited tools available, you may run into situations where some needed tools are not installed out of the box.

For example, if you want to add a new PPA repository, use the add-apt-repository command. But with the Ubuntu server minimal version, the command is not installed by default. You’ll need to install it before using it.

Resolve add-apt-repository: command not found

Fixing the add-apt-repository: command not found an error in Ubuntu is simple. The add-apt-repository command depends on software-properties-common, and it doesn’t come installed.

Run the commands below to install software-properties-common.

sudo apt update
sudo apt install software-properties-common

Then, update Ubuntu and try to add a PPA repository using the add-apt-repository.

sudo apt update

Now you can add your PPA as shown below:

Example:

sudo add-apt-repository ppa:nginx/development

That’s it!

Conclusion:

This post shows you how to quickly and efficiently resolve the add-apt-repository: command not found error on Ubuntu 18.04 | 16.04 systems. If you find any error above, please use the form below to report it.

Thanks,

You may also like the post below:

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *