How to resolve “add-apt-repository: command not found” error in Ubuntu 12.10

As we all know, add-apt-repository is a command that can be used to add a new repository in the Ubuntu/Debian apt sources list. This command will automatically download the public key of the repository and registers it.

Lately, I got an error “add-apt-repository: command not found error” when I am trying to add a new repository in Unbuntu 12.10 server edition.
ostechnix@server:~$ sudo add-apt-repository ppa:cherokee-webserver
[sudo] password for ostechnix: 
sudo: add-apt-repository: command not found
I googled and found a solution. Here it is how I solved it myself. Like the previous versions of Ubuntu, this command ‘add-apt-repository’ is not the part of the package ‘python-software-properties’. But it is available in ‘software-properties-common’ package.
In order to use the command ‘add-apt-repository’ we should install ‘software-properties-common’ as shown below.
ostechnix@server:~$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  python3-software-properties unattended-upgrades
Suggested packages:
  bsd-mailx mail-transport-agent
The following NEW packages will be installed:
  python3-software-properties software-properties-common unattended-upgrades
0 upgraded, 3 newly installed, 0 to remove and 61 not upgraded.
Need to get 55.3 kB of archives.
After this operation, 543 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Next update software sources list.
ostechnix@server:~$ sudo apt-get update
Now you will be able to add a new repository using the command ‘add-apt-repository’.
ostechnix@server:~$ sudo add-apt-repository ppa:cherokee-webserver
You are about to add the following PPA to your system:
 Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Load balancing, Apache compatible log files, and much more.
 More info: https://launchpad.net/~cherokee-webserver/+archive/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp55xlve/secring.gpg' created
gpg: keyring `/tmp/tmp55xlve/pubring.gpg' created
gpg: requesting key EBA7BD49 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp55xlve/trustdb.gpg: trustdb created
gpg: key EBA7BD49: public key "Launchpad PPA for Cherokee Web Server" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
Again update the software source list and install the software you want.
ostechnix@server:~$ sudo apt-get update

That’s it. Enjoy.

You may also like...

  • thanx!

  • Leonardo

    nice

  • J. Ernesto

    thank you!