How to add a repo in Terminal

How to add a Repository from your Terminal/Konsole

You need to be su -
Here is a guide on that in case you don’t know:
Become su in Terminal - HowTo

We will add packman but any repo can be added this way.

When given code to copy and paste by a forum member or from a guide…Eg:

zypper ar -f http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_12.1/ packman

Use your mouse to copy and paste in to the terminal (not your keyboard)

Note:
ar = add repo
-f - auto refresh

  • observe the space at the end of the URL and then the name ‘packman’ replace the name as appropriate for the repo…

Once the repo is added, do

zypper ref

accept the key (a) = always

And you are done

One should notice that after adding a repository, packages already installed by default will still be updated from the prior repository. Often it makes sense to switch packages already installed to the new repository - Packman is a good example, since many packages from Packman are also offered (for example) by the ‘oss’-repository.

To switch packages do:

zypper dup -r $alias_or_number_of_repo

(this is the general syntax).

zypper dup = upgrade whith possible vendor changes
-r = only use the following repo for vendor changes
$alias_or_number_of_repo can be determined with ‘zypper lr’. Note that the alias is case sensitive.

For the above example by caf4926 it should look like this:

zypper ar -f http://packman.unixheads.com/suse/11.3/ packman
zypper ref
zypper dup -r packman

Quite correct
As outlined in this guide:
Multi-media and Restricted Format Installation Guide

Maybe just a tip, keyboard also can be used. I don’t want to make it complicated, but maybe will help some one like me who use keyboard shortcuts.

To select: Shift+arrow keys
To Copy: Ctrl+c
To paste in terminal: Ctrl+Shift+v

:slight_smile:

Which is why I didn’t