The server version of Ubuntu does not have the add-apt-repository
command. How can I add a Personal Package Archive (PPA) to the server without this command?
The server version of Ubuntu does not have the add-apt-repository
command. How can I add a Personal Package Archive (PPA) to the server without this command?
You can simply add the
add-apt-repository
command. In 13.10 and later, you also need to run this command:Side note: in 11.04 they added a symlink to
add-apt-repository
so it can be run asapt-add-repository
which totally makes more sense to me. Everything else apt starts with "apt".NOTE: It's part of the
python-software-properties
package (before 13.10):Let me teach you how to fish.
apt-file
enables you to find out which package provides a given file.dpkg -S
does the same thing, but only for installed packages.apt-file
works whether or not the package has been installed.So, first you install apt-file:
sudo apt-get install apt-file
. You then need to update its information, just as you have to with apt-get:sudo apt-file update
. Now it's ready for use:So, in this case the next thing to do would be to install python-software-properties.
It is not necessarily the best answer, but this will function:
The old-fashioned way (pre Ubuntu 9.10, they call it) of editing
/etc/apt/sources.list
still works. You will also need to get the GPG key on the system manually.On older (pre 9.10) Ubuntu systems:
Step 1: Visit the PPA's overview page in Launchpad. Look for the heading that reads Adding this PPA to your system and click the Technical details about this PPA link.
Step 2: Use the Display sources.list entries drop-down box to select the version of Ubuntu you're using.
Step 3: You'll see that the text-box directly below reads something like this:
Copy those lines.
Step 4: Open a terminal and type:
This will open a text editor containing the list of archives that your system is currently using. Scroll to the bottom of the file and paste the lines you copied in the step above.
Save the file and exit the text editor.
Step 5: Back on the PPA's overview page, look for the Signing key heading. You'll see something like:
1024R/72D340A3 (What is this?)
Copy the portion after the slash but not including the help link; e.g. just 72D340A3.
Step 6: Now you need to add that key to your system so Ubuntu can verify the packages from the PPA. In your terminal, enter:
(Replace 72D340A3 with whatever you copied in the step 5.)
This will now pull down the PPA's key and add it to your system.
Step 7: Now, as a one-off, you should tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added:
Now you're ready to start installing software from the PPA!
add-apt-repository
is provided by the packagepython-software-properties
.Thus if you should install via
Run this command:
And then you can add your repository running:
Renember to replace
[REPOSITORY]
with the repository name you want to add.I had a debate with a colleague about this a few weeks ago. Give
a try. Doesn't need any other packages. Note that apt appears before add. Order does matter because add-apt-repository needs to be installed.
For those naysayers out there. Give this Vagrant file a try. Note, I'm starting from a fresh trusty image, and adding the ppa right out of the box.
Update: Just to clarify, it looks like the cloud images for ubuntu precise and up have the correct package already installed. So whether we are talking cloud-init scripts or a vagrant file, apt-add-repository is present. Since add-apt-repository is in the same package that should work as well.