How can I search for installed repostiries, add and delete them with yum python API (under fedora 17). I've searched tons of websites and I have found how to manage packages (like here: http://phacker.org/2008/06/20/yum-python-api/), but I have not found anywhere how to handle repositories).
I want for example to be able to get with python yum API the same result as:
yum repolist
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm`
(the last is simmilar to yum-config-manager --add-repo; yum-config-manager --enable
)
etc.
Run command yum repolist and it will show you all repositories configured under YUM and enabled for use on that server. To view, disabled repositories or all repositories refer below section in this article. In the above output, you can see the repo list with repo id, repo name, and status.
You can temporarily remove/disable a yum repo by adding the --disablerepo=(repo name) to your yum line.
To disable a particular repository or repositories, run the following command as the root user: yum-config-manager --disable repository… Alternatively, you can use a global regular expression to disable all matching Yum repositories: yum-config-manager --disable glob_expression…
To enable all repositories run "yum-config-manager --enable \*". --disable Disable the specified repos (automatically saves). To disable all repositories run "yum-config-manager --disable \*". --add-repo=ADDREPO Add (and enable) the repo from the specified file or url.
you can use eulfedora
eulfedora.api provides complete access to the Fedora API, primarily making use of Fedora's REST API. This low-level interface is wrapped by eulfedora.server.Repository and eulfedora.models.DigitalObject, which provide a more abstract, object-oriented, and Pythonic way of interacting with a Fedora Repository or with individual objects and datastreams.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With