Visit my.sonatype.com for documentation on Nexus Repository version 2.
Currently authenticated access from yum to Nexus Repository 2 will not work due to this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=739860
The python-urlgrabber library (which yum depends on) does not support http basic authentication.
You can work around this by applying the patch on the above issue to python-urlgrabber and setting up the yum/repos.d file like this (with credentials embedded into the URL):
[sample_yum_conf]
name=Nexus Site
baseurl=http://admin:admin123@nexus-host:8081/nexus/content/repositories/releases
username=admin
password=admin123
enabled=1
gpgcheck=0
metadata_expire=30s
autorefresh=1
protect=0
type=rpm-md
But this has a very significant downside. Any yum command which prints the URLs will show the credentials. This likely includes yum commands which can be run by end users.
Consequentially, we really can't recommend doing this.
Update: RHEL 7 does not require the patch above, but still only supports URL encoded credentials.
4 Comments
Is this fixed in a later release of CentOS?
As I know this has not been fixed. And the bug in python-urlgrabber (linked in the article) has unfortunately been closed by Red Hat as "WONTFIX".
Someone in the comments section of that bug refers to "Simple backport of an upstream fix", so I was hoping that this was resolved in CentOS 7 perhaps.
We are closing this article for comments.
If you have a support license, please contact us by submitting a support ticket.
If you do not have a support license, please use our Nexus Users List or our other free support resources.