i'm forwarding answers to some zypper question as they seem to be FAQ. I'll put some of them to man page/wiki, but some point to issues that need to be fixed. Frank Sundermeyer wrote:
Hi Jan,
I am maintaining the zypper chapter for the openSUSE 11.0 manual. There are some things I haven't fully understood and I hope you can help me.
sure :O)
I am using 11.0 Alpha 3+ with zypper 0.10.5.
If I add
http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/ (Main Repository (OSS))
with _YaST_ (via Software Repositories -> Community Repositories) it shows up like this (shortened the URl):
bourbaki:~ # zypper repos # | Ena | Ref |Type | Alias | Name --+-----+-----+-------+--------------------------+-------------------- 1 | Yes | Yes | yast2 | openSUSE-DVD 11.0 | openSUSE-DVD 11.0 2 | Yes | Yes | yast2 | http://.../inst-source/ | Main Repository (OSS)
1. Question: What exactly is the "Name"? Why is the URl listed under Alias?
Alias is both a shorthand for Name and a unique identifier of the repository. While Alias is not exposed to the user by YaST (there's no need to), it is used in zypper in the repository handling commands and in --repo option as one way to specify the repository (the other two way are by number in the 'zypper repos' list and by URI. YaST currently internally uses URI as the Alias which is a bit unfortunate and creates confusion for zypper newbies. I'll ask YaST folks to use something different instead (e.g. "repoX" where X would be a unique number).
If I delete this very repository by URl
bourbaki:~ # zypper rr http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/ * Removing repository 'Main Repository (OSS)' Repository 'Main Repository (OSS)' has been removed.
everything is fine.
<cut>
If I manually add the same repository from above with
bourbaki:~ # zypper ar http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/ "foobar" * Adding repository 'foobar' Repository 'foobar' successfully added Enabled: Yes Autorefresh: No URL: http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/
It shows up quite differently:
bourbaki:~ # zypper repos # | Enabled | Refresh | Type | Alias | Name --+---------+---------+-------+-------------------+------------------ 1 | Yes | Yes | yast2 | openSUSE-DVD 11.0 | openSUSE-DVD 11.0 2 | Yes | No | NONE | foobar | foobar
Yes, zypper currently has no way to specify the Name when adding repository (except for adding it via a .repo file) and when no Name is known, the alias is shown instead of it. The Alias is always required.
hmm. If I
bourbaki:~ # zypper ar --check
http://download.opensuse.org/repositories/home:/thomas-schraitle/openSUSE_Factory\
toms * Adding repository 'toms' Repository 'toms' successfully added Enabled: Yes Autorefresh: No URL:
http://download.opensuse.org/repositories/home:/thomas-schraitle/openSUSE_Fa...
bourbaki:~ # zypper repos # | Enabled | Refresh | Type | Alias | Name --+---------+---------+--------+-------------------+------------------ 1 | Yes | Yes | yast2 | openSUSE-DVD 11.0 | openSUSE-DVD 11.0 2 | Yes | No | rpm-md | toms | toms
the official name of the Repository is _not_ used, although it is specified in
http://download.opensuse.org/repositories/home:/thomas-schraitle/openSUSE_Fa...:
[home_thomas-schraitle] name=Thomas Schraitle's Home Project (openSUSE_Factory)
AFAIK, placement of .repo files to the reporitory root has not (yet) been established as a standard. Zypper can't just detect them and take whatever name it can get from them. If it's not a standard, people are free to put any .repo files in their repos. However it would be a good idea to support this! Any opinions/information from the software management people?
3. Questions: Alias and Name are the same - is this a bug? What exactly is "Name"?
See above.
How can I turn on Autorefresh with zypper?
zypper modifyrepo --refresh <alias|#|URI>
How do I determine a repository's URl?
old way: 'zypper -v repos' I recently changed this (for zypper 0.11.1), see zypper help repos. new way: 'zypper repos -u' or 'zypper repos -d'
Should'nt zypper be able to determine the repository type automatically? (it is listed as NONE since I did not specified it with "-t yast2")
Yes but it depends on what you want. You can tell zypper to 'probe' repository when adding it, but you can also add it without accessing the internet at all. You decide either by editing /etc/zypp/zypp.conf (see 'repo.add.probe' item; affects also YaST) or by specifying --check or --no-check option to the addrepo command. If the repository is not probed or checked when adding it, it will get probed when you will try to use it for the first time (with some other command like refresh or install). Then, if the type of the repository is figured out, it will get stored and you will see the type in the repo list. (Note however that the 'plaindir' can be automatically figured out, if you want to use it, you have to use --type plaindir). BTW i noticed we use --nocheck instead of --no-check. I'll correct that to be consistent with other boolean options. (already done).
However removing with zypper rr by URl _and_ Alias works, when the repositoty is added with zypper and not by YaST.
It should work for both. <cut>
(YaST adds an "_1" to an already existing alias but hides this from the user (the "_1" is not shown in the Configured Software repositories Overview) - this is IMHO a very bad solution)
I'm not sure.. YaST users should not care what alias has been used. As for notifying the user about adding the very same repo twice, we need to invent another means to do this. We are already thinking of this.
Terminology: When adding a repository with zypper, I need to specify * URl * Alias when adding a repository with YaST, I need to specify * Repository name (actually the alias)
No no, it really is the Name in this case! The Name is whathever you want to name it. Alias is used only internally by YaST.
* URl
5. Question: Is it possible to use the same terms in YaST and zypper?
Hmm.. i don't know. For zypper as a command line tool the alias is a means to manipulate the repos. YaST users manipulate them by clicking in the GUI. Name servers in both YaST and zypper as an arbitrary/descriptive string for the user. It is just a label, has no other meaning.
6. More questions: How do I specify URls to cd, dvd, network sources, local directory? Neither the man page nor zypper's help output provide any hints
Hm.. thanx for pointing this out. I will document it both in man page and the wiki. For now, see http://en.opensuse.org/Libzypp/API/Url. Cheers, jano see also: https://bugzilla.novell.com/show_bug.cgi?id=373167 https://bugzilla.novell.com/show_bug.cgi?id=364391 -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org