Categories: Ubuntu

How to fix “sudo add-apt-repository command not found” error on Ubuntu 22.04

Ubuntu comes with packages of different applications and tools that are used in daily life for different purposes like VLC media player is used for playing music similarly, VIM text editor is used for editing files of different formats. But there are a lot of third-party applications that can be installed on Ubuntu by adding their repositories. To add such types of repositories, we mostly use the add-apt-repository command, but some of the time it generates the error of “sudo: add-apt-repository:command not found”.

In this write-up, we will explore the reasons behind the generation of this error and methods of resolving this error in Ubuntu.

How
Sponsored
to fix “sudo: add-apt-repository: command not found” error on Ubuntu

To understand the error, we will first add the repository of libreoffice in Ubuntu using the simple command:

$ sudo add-apt-repository ppa:libreoffice/ppa

 

Now to resolve this error, we have to install the package “software-properties-common”, and this package is available in the default repository of Ubuntu which can be verified by using the command:

$ sudo apt show software-properties-common

 

As we can see that the package is available, so we can install it using the command:

$ sudo apt install software-properties-common -y

 

When the above command is successfully executed, then we will again try to add the repository of libreoffice:

Sponsored
$ sudo add-apt-repository ppa:libreoffice/ppa

 

Finally, after adding the repository of LibreOffice, we will update all the packages of Ubuntu:

$ sudo apt update -y

 

Now, we are ready to install the package of LibreOffice after fixing the error of add-apt-repository:

$ sudo apt install libreoffice -y

 

Conclusion

Though Ubuntu comes with many packages by default there are still many packages that are not included in the default repository of Ubuntu. To install these packages there are different methods among which one is by adding their repositories. To add the repositories of third-party applications we use the add-apt-repository utility which sometimes displays the error of “sudo:add-apt-repository:command not found”. This error has been resolved in this article using different type of approaches..

Ubuntu Server Admin

Recent Posts

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

23 hours ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

23 hours ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

23 hours ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

2 days ago

Revolutionizing Web Page Creation: How Structured Content is Slashing Design and Development Time

Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…

3 days ago

Ubuntu Weekly Newsletter Issue 897

Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…

4 days ago