58

I keep seeing places refer to the "partner" repository as a place I can get software, how can I enable this repository? Please specify how to do this graphically and via command line.

0

7 Answers 7

57

GUI Way:

Click on the ubuntu button, then search for "Software Sources" (or "Software & Updates" on Ubuntu 16.04+) and go to the "Other Software" tab.

enter image description here

Command Line Way:

  • Open the sources.list file: gksudo gedit /etc/apt/sources.list (or with the command line editor of your choice, sudo nano /etc/apt/sources.list would use nano on the command line without a GUI)
  • Add the partner repositories by removing the # in front of the following lines (maverick is the version of your Ubuntu installation, it may differ, so use the codename of the release you are using instead of 'maverick'. If you're not sure run lsb_release -c to find out.)

    # deb http://archive.canonical.com/ubuntu maverick partner
    # deb-src http://archive.canonical.com/ubuntu maverick partner
    

Using GEdit to edit the sources.list file

  • Save and Close.
  • Resynchronize the package index files from their sources: sudo apt-get update

  • Official documentation for reference

5
  • As of Ubuntu Precise, "Software Sources" is no longer accessible via the launcher. It has to be accessed through the menu (Edit => Edit software sources).
    – Lekensteyn
    May 2, 2012 at 21:02
  • @Sid I think you're double dipping here. Your method for the GUI may make more sense, but your method for the command line is dated and the contribution by Hieu is better advice. Would you have an object to reducing this method to just the GUI method described? I don't want to downvote you for the GUI contribution. But, I do want to downvote the inferior CLI method (which isn't even really cli because you're using gedit). Nov 4, 2016 at 5:37
  • Downvoted because @ThomasWard decided to rollback the edit, and the CLI instructions are inferior and dated. Shouldn't have combined the two. Nov 7, 2016 at 21:59
  • 2
    @EvanCarroll The instructions are not necessarily inferior - the methods specified here still work, replacing "maverick" with whichever codename is relevant. You're right the GUI way to edit the CLI version is wrong - note my edits which I made indicating to use a text editor instead for the command line rather than the GUI (such as 'nano').
    – Thomas Ward
    Nov 7, 2016 at 23:05
  • 1
    @EvanCarroll There's this thing called updating via editing. It works quite well :)
    – Seth
    Nov 7, 2016 at 23:15
15

The simplest way to enable "partner" repository:

sudo sed -i.bak "/^# deb .*partner/ s/^# //" /etc/apt/sources.list
sudo apt-get update
1
  • this doesn't work with ubuntu 18.04
    – kirin
    Jan 7, 2019 at 6:46
12

CLI method

This method uses

  • lsb_release -sc to get the Ubuntu (codename) version.
  • add-apt-repository to alter the appropriate config files.

It has the advantages of working in all versions of Ubuntu.

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner"

This is from a skype tutorial

2
  • Brilliant. I'll use this from now on. Nov 4, 2016 at 3:21
  • 1
    Beware that you can run this command only once. If you do it again, you will have the problem with duplivate entries.
    – Pilot6
    Jan 31, 2017 at 14:49
5

To enable the partner repository from the command line, edit /etc/apt/sources.list:
sudoedit /etc/apt/sources.list and remove the # from the beginning of these two lines:

#deb http://archive.canonical.com/ubuntu maverick partner  
#deb-src http://archive.canonical.com/ubuntu maverick partner

So they are like this:

deb http://archive.canonical.com/ubuntu maverick partner  
deb-src http://archive.canonical.com/ubuntu maverick partner

Then update your apt cache: sudo apt-get update.

0
2

TERMINAL version, just copy and paste this commands to activate the partners repository (skype, etc):

DISTRO=`cat /etc/*-release | grep DISTRIB_CODENAME | sed 's/.*=//g'`
sudo sed -i 's/\(# \)\(deb .*ubuntu '${DISTRO}' partner\)/\2/g' /etc/apt/sources.list
sudo apt-get -y update

@ERGuille: FTFY, with a cleaner version

2
  • 1
    Parsing the configuration file is a horrible idea. Nov 7, 2016 at 22:03
  • There's really nothing wrong with parsing the sources.list file. Advisable to make a backup though (use sed -i.bak instead of just sed -i)
    – Zanna
    Nov 8, 2016 at 7:57
1

This is how I did it within shell, I took the time for a little variation to increase stability, re-usability and idempotence (and not checking for the distro):

grep -qe '^# deb[- ].* partner$' /etc/apt/sources.list \
  && sudo sed -i"~$(date -%s)" 's/^# \(deb[- ].* parnter$\)/\1/' /etc/apt/sources.list
  • grep check: change file only if it is to change.
  • sed backup: keep timestamp'ed backups so you can go back in time.
  • handle both source and non-source.
  • use the name (last field) not the distro to identify the repositories.

Alternatives here:

In the end this might need another iteration or two. I hope next to the personal note on comments this was giving some useful summary.

0
-1

TERMINAL just to make it easier, copy and paste this one command:

sed 's/\# deb http\:\/\/archive\.canonical\.com\/ubuntu natty partner/deb http\:\/\/archive\.canonical\.com\/ubuntu natty partner/' /etc/apt/sources.list | sed 's/\# deb-src http\:\/\/archive\.canonical\.com\/ubuntu natty partner/deb-src http\:\/\/archive\.canonical\.com\/ubuntu natty partner/' - > /tmp/newfile && sudo mv -f /tmp/newfile /etc/apt/sources.list

1
  • There are way easier and more elegant one-liners you could come up with. sed -i~ 's|^# *\(deb\(-src\)* http://archive\.canonical\.com/ubuntu natty partner|\1|' /etc/apt/sources.list uses a single regular expression, but creating a new file in /etc/apt/sources.list.d/ would be much better still.
    – tripleee
    May 5, 2015 at 12:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .