Showing posts with label repository. Show all posts
Showing posts with label repository. Show all posts

Monday, September 24, 2012

How to remove all repositories using zypper

If you need to remove all repositories, use this command:

zypper repos | grep Yes | cut -f3 -d '|' | sed -e "s/ //" | awk '{print "zypper rr " $1}' | bash

I would suggest first to try to see the output of the command without the last bash:

zypper repos | grep Yes | cut -f3 -d '|' | sed -e "s/ //" | awk '{print "zypper rr " $1}'

Monday, September 17, 2012

Export or import list of repositories in Linux for yast2

If you need to migrate your linux yast2 repositories from one machine to another, you can do the following:

Export list of yast2 repositories into a text file:

zypper lr –export

By default it saves the list of repositories in xport.repo file

On machine 2 you may import the list created by the command above, into the system by importing the list of repositories:

zypper ar -r xport.repo

"ar" stands for "Add Repository", whereas "lr" stands for "list repositories"