LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-09-2008, 10:45 AM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 492

Rep: Reputation: 31
yum variables $distribution/$releasever/$basearch, how to check?


Currently I have responsibilities for Fedora. I want to set ones up for Oracle EL and CentOS

How do I see what yum will set the $distribution/$releasever/$basearch variables too? Is there a way to check?
 
Old 06-09-2008, 01:54 PM   #2
tommyr1216
Member
 
Registered: Sep 2004
Location: Pennsylvania
Distribution: Gentoo, Suse, Fedora, Slackware
Posts: 56

Rep: Reputation: 15
$releasever will be the release number of your Fedora install. That is, if you're running Fedora 8, $releasever=8. If you're running Fedora Core 5, $releasever=5.
$basearch can be determined by running "uname -i"
$distribution will be "fedora-release" (not 100% sure about that one, none of my repository configs use it.)
 
Old 06-09-2008, 02:07 PM   #3
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 492

Original Poster
Rep: Reputation: 31
Question

Quote:
Originally Posted by tommyr1216 View Post
$releasever will be the release number of your Fedora install. That is, if you're running Fedora 8, $releasever=8. If you're running Fedora Core 5, $releasever=5.
$basearch can be determined by running "uname -i"
$distribution will be "fedora-release" (not 100% sure about that one, none of my repository configs use it.)
$releasever is actually one of these:
rpm -q --queryformat '%{VERSION}' redhat-release
rpm -q --queryformat '%{VERSION}' fedora-release
rpm -q --queryformat '%{VERSION}' centos-release

Sorry I guess I wasn't that clear on my question.

My question isn't where it get's the info...I just wanted to see what all the environment variables are set to on a distro so I can use it to check distros like OEL5, CentOS 5, etc.

$releasever is not setup on bash prompt so I wanted to know if I could drive yum to set them up for me on the fly.
 
Old 12-13-2023, 09:10 PM   #4
A.Thyssen
Member
 
Registered: May 2006
Location: Brisbane, Australia
Distribution: linux
Posts: 158

Rep: Reputation: 44
Quote:
Originally Posted by MikeyCarter View Post
$releasever is actually one of these:
rpm -q --queryformat '%{VERSION}' redhat-release
rpm -q --queryformat '%{VERSION}' fedora-release
rpm -q --queryformat '%{VERSION}' centos-release
NOT Always...

I have a system where it is "7Server" but the above does not give me that.

This seems to work universally for fedora, centos and redhat systems, both older "yum" only and newer "dnf" systems... But it is a little slow.

yum-debug-dump --norepos /dev/stdout | grep -oP '^ releasever:\s*\K\S+'

Last edited by A.Thyssen; 12-13-2023 at 09:12 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum update Transaction Check Error JonBL Linux - Software 21 08-10-2007 10:33 PM
How to check variables in a FOR loop? richikiki Programming 6 07-10-2006 03:57 AM
How to check which distribution I use Junk Linux - Newbie 1 10-16-2005 10:21 AM
Yum - check for disk space maimonoded Linux - Software 0 03-31-2005 09:23 AM
$releasever set to 2.90 brunnopessoa Fedora 9 10-17-2004 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration