How to add a repository on OpenSUSE "Tumbleweed"

Endrit Qerreti

Endrit Qerreti

Repositories are sources from where your system downloads packages. For example, you may need a software that is not available on the main repository of OpenSUSE, but it is available on another repository. Now, to be able to install this package on your system, you need to add this repository to your system first, and then use it to download the package.

The process of adding a repository is quite simple, and it can be done via two ways, by using YaST software management and by using the terminal.

In this tutorial, you will learn how to add a repository on OpenSUSE, via two different methods. Whether you are a terminal fan, or GUI fan, in this tutorial we are going to cover both methods of doing this.

Add repository with YaST software management on OpenSUSE

Launch YaST software management

Next, you will be asked to enter your sudo password, in order to be able to use YaST software management.

Once you have entered sudo password. YaST software management GUI will load.

Now you need to click to 'Configuration'

Next, choose 'Repositories'

This will open the repositories window. In this window, we can add a repository. To add a repository, click to 'Add' button

Next, you need to select the type of repository that you want to add. In this tutorial, we are going to add an URL repository, so we need to go with 'Specify URL' option.

Now, you need to enter the repository name, and the repository URL. Click 'Next' once done.

In the image below, we are adding the main OSS repository to our system.

Once you add the repository, you will see the license agreement window. Simply check the 'I agree to the license terms' box, and click 'Next' to continue.

After accepting the license agreement. You will see the main GUI, now you need to click the 'Ok' button so the new repository gets added into your system.

Next, system will download the new repository and update the repository cache. Once this task completes, you are good to go and use the new repository.

Add repository with Terminal on OpenSUSE

To add a repository on OpenSUSE using the terminal only, is possible by using the addrepo command.

The syntax to add a repository is as below

sudo zypper addrepo -f url alias

For example, to add a repository called oss with the source url

you need to run this command

sudo zypper addrepo -f oss

addrepo - the command to add the repo

-f - adds the autorefresh option to the new repo that you add - repo url


As you can see now the repository oss has been added in our system.

Next, you need to refresh the repositories, to do this simply run the command below

sudo zypper refresh

After refreshing the repositories, you can proceed to update your system


By now you should know how to ad a repository on OpenSUSE, using the terminal and using GUI.