This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
避免 /etc/*release* 文件并运行此命令,它更可靠并提供更多详细信息:
Avoid /etc/*release* files and run this command instead, it is far more reliable and gives more details:
我假设您已经运行了 yum update。这通常会将您更新到最新的次要版本。
用于确定版本的主要资源是
/etc/redhat_release
和lsb_release -a
I assume that you've run yum upgrade. That will in general update you to the newest minor release.
Your main resources for determining the version are
/etc/redhat_release
andlsb_release -a
那是 RHEL 发行版本。
您可以通过输入
uname -r
来查看内核版本。它将是 2.6.something。That's the RHEL release version.
You can see the kernel version by typing
uname -r
. It'll be 2.6.something.这是 RHEL 的发行版,或者至少是安装了提供 /etc/redhat-release 的软件包的 RHEL 发行版。这样的文件可能是您能找到的最接近的文件;您还可以查看 /etc/lsb-release.
理论上可以从混合版本安装软件包(例如,将系统的一部分升级到 5.5,而将其他部分保留在 5.4),因此,如果您依赖于特定组件的版本,则需要单独检查这些版本。
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.
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.