Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> Where does yum get $releasever?, other than /etc/yum.conf /etc/yum/vars?
K.B.Beard
 Posted: Dec 19 2016, 07:49 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









I'm running SL6.6; my "yum" seems to now not define "$releasever" anymore. It is used in yum.conf, but isn't defined there and nothing is set in /etc/yum/vars/. $basearch also seemed undefined, but then seemed OK after I did a "yum clean all".

I can manually set it on the command line with "yum --releasever=6.6" temporarily, but fear that will not work properly if I try to use yum to upgrade to 6.8

I'd like to fix this yum properly rather then just a redefinition downstream, so
my question is where this yum is supposed to get the definition of releasever?

Thanks!
PMEmail Poster
^
inittux
 Posted: Dec 19 2016, 08:14 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 306
Member No.: 953
Joined: 20-October 11









QUOTE (K.B.Beard @ Dec 19 2016, 08:49 PM)
I'm running SL6.6; my "yum" seems to now not define "$releasever" anymore.   It is used in yum.conf, but isn't defined there and nothing is set in /etc/yum/vars/.   $basearch also seemed undefined, but then seemed OK after I did a "yum clean all".

I can manually set it on the command line with "yum --releasever=6.6" temporarily, but fear that will not work properly if I try to use yum to upgrade to 6.8

I'd like to fix this yum properly rather then just a redefinition downstream, so
my question is where this yum is supposed to get the definition of releasever?

Thanks!


You need to install yum-conf-sl6x(via yum), afterwards you can just do yum update. And then your system should update to the most recent release of 6, which is 6.8.

--------------------
PM
^
K.B.Beard
 Posted: Dec 19 2016, 08:32 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









QUOTE (inittux @ Dec 19 2016, 02:14 PM)
QUOTE (K.B.Beard @ Dec 19 2016, 08:49 PM)
I'm running SL6.6; my "yum" seems to now not define "$releasever" anymore.   It is used in yum.conf, but isn't defined there and nothing is set in /etc/yum/vars/.   $basearch also seemed undefined, but then seemed OK after I did a "yum clean all".

I can manually set it on the command line with "yum --releasever=6.6" temporarily, but fear that will not work properly if I try to use yum to upgrade to 6.8

I'd like to fix this yum properly rather then just a redefinition downstream, so
my question is where this yum is supposed to get the definition of releasever?

Thanks!


You need to install yum-conf-sl6x, afterwards you can just do yum update.

This is the one. But you should be able to find it via a yum search.

---
Hi,

Thanks. Forgive my ignorance, but my system seems to say that's already there:

yum --releasever=6.6 install yum-conf-sl6x
...
Package 5:yum-conf-sl6x-1-2.noarch already installed and latest version
Nothing to do.

and I still don't have $releasever set. Is it supposed to be extracted by yum from a particular package? I fear reinstalling yum everything would result in a corrupt system.

Thanks

PMEmail Poster
^
inittux
 Posted: Dec 19 2016, 08:40 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 306
Member No.: 953
Joined: 20-October 11









QUOTE (K.B.Beard @ Dec 19 2016, 09:32 PM)
QUOTE (inittux @ Dec 19 2016, 02:14 PM)
QUOTE (K.B.Beard @ Dec 19 2016, 08:49 PM)
I'm running SL6.6; my "yum" seems to now not define "$releasever" anymore.   It is used in yum.conf, but isn't defined there and nothing is set in /etc/yum/vars/.   $basearch also seemed undefined, but then seemed OK after I did a "yum clean all".

I can manually set it on the command line with "yum --releasever=6.6" temporarily, but fear that will not work properly if I try to use yum to upgrade to 6.8

I'd like to fix this yum properly rather then just a redefinition downstream, so
my question is where this yum is supposed to get the definition of releasever?

Thanks!


You need to install yum-conf-sl6x, afterwards you can just do yum update.

This is the one. But you should be able to find it via a yum search.

---
Hi,

Thanks. Forgive my ignorance, but my system seems to say that's already there:

yum --releasever=6.6 install yum-conf-sl6x
...
Package 5:yum-conf-sl6x-1-2.noarch already installed and latest version
Nothing to do.

and I still don't have $releasever set. Is it supposed to be extracted by yum from a particular package? I fear reinstalling yum everything would result in a corrupt system.

Thanks


umm try this.

CODE

yum update sl-release



--------------------
PM
^
K.B.Beard
 Posted: Dec 19 2016, 08:43 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

When I look at /var/cache/yum/x86_64/ I see both "6.6/" and "$releasever/";
could it be that $releasever -> '$releasever' because of that? I've no idea how
that got created.

Thanks again.
PMEmail Poster
^
K.B.Beard
 Posted: Dec 19 2016, 08:52 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

yum --releasever=6.6 update sl-release

seemed to run OK, but then "yum info" failed since $releasever still seems undefined. "yum --releasever=6.6 info" still works OK.

/etc/redhat-release seems to have changed from 6.6 to 6.8, but the system is
ought to still be really 6.6, I think. There is no /var/cache/yum/x86_64/6.8

I'm hesitant to keep trying workarounds without knowing exactly where yum actually looks to get the definition of $releasever; I'm very concerned I'll leave the whole system in a bad state.

Thanks
PMEmail Poster
^
inittux
 Posted: Dec 19 2016, 08:57 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 306
Member No.: 953
Joined: 20-October 11









QUOTE (K.B.Beard @ Dec 19 2016, 09:43 PM)
Hi,

   When I look at /var/cache/yum/x86_64/  I see both "6.6/" and "$releasever/";
could it be that $releasever ->  '$releasever' because of that?  I've no idea how
that got created.

Thanks again.


That yum-conf-sl6x should provide the release server:

This is on one of my systems:
rpm -ql yum-conf-sl7x-7.2-2.sl7.noarch
/etc/yum/vars/releasever
/etc/yum/vars/slreleasever

Can you a yum clean all again and then yum repolist, what do you see then, I mean what repos get listed?

This is what I see under SL7:
repo id repo name status
sl/x86_64 Scientific Linux 7x - x86_64 9,045
sl-extras/x86_64 Scientific Linux Extras - x86_64 419
sl-fastbugs/x86_64 Scientific Linux 7x - x86_64 - bugfix updates 1,388
sl-security/x86_64 Scientific Linux 7x - x86_64 - security updates 1,961

Under repo name do you see anything with Scientific Linux 6x?

And wat do you see in:
/etc/yum/vars/releasever
/etc/yum/vars/slreleasever

--------------------
PM
^
K.B.Beard
 Posted: Dec 19 2016, 09:44 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

I'd done a "yum clean all" before and got $basearch to work; I did it again
and "yum repolist" still fails with $releasever still not defined.

/var/cache/yum/x86_64/ gained yum-conf-sl6x when I tried the install.

As I mentioned at the beginning, /etc/yum/vars/ remains to be totally empty.

On my SL6.8 system at home (which seems to be working fine), I see that
$releasever works in yum.conf and *.repo and /etc/yum/vars/ is also empty.

I've a number of /etc/yum.repos.d/*.repo that ought to work - the ones
named with ".../$releasever/$basearch/..." are the ones that give problems
becuase "$releasever" using' getting substituted correctly.

None of the *.repo files explicitly specify 6x; I'm pretty sure that's what the
$releasever is for and don't what to kludge it by hardcoding the paths, since that may well
break the upgrade that's my end goal.

I'm still trying to find where yum gets it's $releasever from - that's what
I think is the root of the problem and what I need to fix.

Thanks again





PMEmail Poster
^
K.B.Beard
 Posted: Dec 19 2016, 09:51 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

I also tried to get rid of '/var/cache/yum/x86_64/$releasever', but the next "yum info"
just recreated it again.

Thanks
PMEmail Poster
^
K.B.Beard
 Posted: Dec 19 2016, 10:06 PM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

A mistake I made - the /etc/yum.repos.d/sl6x.repo has ".../6x/$basearch/..." that
one is recognized, but "$releasever" isn't used in it.

Thanks

PMEmail Poster
^
inittux
 Posted: Dec 19 2016, 10:33 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 306
Member No.: 953
Joined: 20-October 11









QUOTE (K.B.Beard @ Dec 19 2016, 11:06 PM)
Hi,

   A mistake I made - the /etc/yum.repos.d/sl6x.repo has ".../6x/$basearch/..." that
one is recognized, but "$releasever" isn't used in it.

Thanks


Does your sl6x.repo look something like this, or at least the sl6x part?


CODE

[sl6x]
name=Scientific Linux 6x - $basearch
baseurl=http://ftp.scientificlinux.org/linux/scientific/6x/$basearch/os/
 http://ftp1.scientificlinux.org/linux/scientific/6x/$basearch/os/
 http://ftp2.scientificlinux.org/linux/scientific/6x/$basearch/os/
 ftp://ftp.scientificlinux.org/linux/scientific/6x/$basearch/os/
#mirrorlist=http://ftp.scientificlinux.org/linux/scientific/mirrorlist/sl-base-6x.txt
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl6 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern


I just installed a test vm with 6.6 and there /etc/yum/vars/ is als empty but when I list updates I do get an sl-release 6.8 as an update. What repos are listed when you: yum repolist?

--------------------
PM
^
K.B.Beard
 Posted: Dec 20 2016, 01:28 AM
Quote Post


SLF Newbie


Group: Members
Posts: 9
Member No.: 3805
Joined: 19-December 16









Hi,

The sl6x.repo seems the same; I have 6 *.repo files (epel.repo epel-testing.repo linuxtech.repo
sl6x.repo sl-other.repo sl.repo). The error messages get to be rather large to post here, but they're all similar:

...
http://ftp2.scientificlinux.org/linux/scientific/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error
: 404 Not Found"
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

http://ftp.scientificlinux.org/linux/scientific/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error:
404 Not Found"

Trying other mirror.

...

The "$" becomes the %24 (0x24==$) because $releasever isn't being replaced.

Digging deeper and far back in the forums, I found a suggestion that the problem is in the Python. I see that in /usr/lib/python2.6/site-packages/yum/config.py's call of

ts= rpmUtils.transaction.initReadOnly...
ts.pushVSFlags...
idx= ts.dbMatch...

(near the end of config.py) that somehow there's a problem related to rpm; on my SL6.2 working system I get back idx.count()=1 and a # for 'version', but on the problematic SL6.6 system idx.count()=0. Both are running rpm 4.8.0, both have /etc/yum.conf in the same place.

Again, thanks for your help.



PMEmail Poster
^
inittux
 Posted: Dec 21 2016, 08:09 AM
Quote Post


SLF Geek
****

Group: Members
Posts: 306
Member No.: 953
Joined: 20-October 11









That part of that file looks a bit different than mine but rpm version is the same, running same SL version(6.6) on that test vm:

CODE

def _getsysver(installroot, distroverpkg):
   '''Calculate the release version for the system.

   @param installroot: The value of the installroot option.
   @param distroverpkg: The value of the distroverpkg option.
   @return: The release version as a string (eg. '4' for FC4)
   '''
   ts = rpmUtils.transaction.initReadOnlyTransaction(root=installroot)
   ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
   try:
       idx = ts.dbMatch('provides', distroverpkg)
   except TypeError, e:
       # This is code for "cannot open rpmdb"
       # this is for pep 352 compliance on python 2.6 and above :(
       if sys.hexversion < 0x02050000:
           if hasattr(e,'message'):
               raise Errors.YumBaseError("Error: " + str(e.message))
           else:
               raise Errors.YumBaseError("Error: " + str(e))
       raise Errors.YumBaseError("Error: " + str(e))
   except rpm.error, e:
       # This is the "new" code for "cannot open rpmdb", 4.8.0 ish
       raise Errors.YumBaseError("Error: " + str(e))
   # we're going to take the first one - if there is more than one of these
   # then the user needs a beating
   if idx.count() == 0:
       releasever = '$releasever'
   else:
       hdr = idx.next()
       releasever = hdr['version']
       del hdr
   del idx
   del ts
   return releasever


That package that provides the config.py file comes from the yum package. What version of yum are you running? I'm running yum-3.2.29-60.el6.noarch on my SL6.6 test vm.

--------------------
PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll