如何确认 RedHat Enterprise Linux 版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4140219/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to confirm RedHat Enterprise Linux version?
提问by Michael Mao
I am a bit confused by the fact that although I installed RHEL 5.1 from DVD (RedHat/5.1.x86_64), when I issue command:
尽管我从 DVD (RedHat/5.1.x86_64) 安装了 RHEL 5.1,但当我发出命令时,我有点困惑:
cat /etc/redhat-release
I got:
我有:
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
What does this mean? is this to be the release version or kernel version? Is there another way to confirm the real version of RHEL?
这是什么意思?这是发布版本还是内核版本?还有其他方法可以确认RHEL的真实版本吗?
I am asking this question because there will be certain applications that would depend on this.
我问这个问题是因为会有某些应用程序依赖于此。
Many thanks in advance.
提前谢谢了。
采纳答案by Bill Lynch
I assume that you've run yum upgrade. That will in general update you to the newest minor release.
我假设您已经运行了 yum upgrade。这通常会将您更新到最新的次要版本。
Your main resources for determining the version are /etc/redhat_release
and lsb_release -a
您确定版本的主要资源是/etc/redhat_release
和lsb_release -a
回答by cHao
That's the RHEL release version.
那是 RHEL 发行版。
You can see the kernel version by typing uname -r
. It'll be 2.6.something.
您可以通过键入来查看内核版本uname -r
。这将是 2.6.something。
回答by Michael Ekstrand
That is the release version of RHEL, or at least the release of RHEL from which the package supplying /etc/redhat-release was installed. A file like that is probably the closest you can come; you could also look at /etc/lsb-release.
那是 RHEL 的发行版,或者至少是安装了提供 /etc/redhat-release 的软件包的 RHEL 发行版。像这样的文件可能是你能得到的最接近的文件;您还可以查看 /etc/lsb-release。
It is theoretically possible to have packages installed from a mix of versions (e.g. upgrading part of the system to 5.5 while leaving other parts at 5.4), so if you depend on the versions of specific components you will need to check for those individually.
理论上可以安装多个版本的软件包(例如,将系统的一部分升级到 5.5,而将其他部分保留在 5.4),因此如果您依赖于特定组件的版本,则需要单独检查这些版本。
回答by MarcH
Avoid /etc/*release* files and run this command instead, it is far more reliable and gives more details:
避免使用 /etc/*release* 文件并运行此命令,它更可靠并提供更多详细信息:
rpm -qia '*release*'