Linux 如何找到我使用的 Fedora 版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/540603/
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 can I find the version of the Fedora I use?
提问by pindare
sudo find /etc | xargs grep -i fedora > searchFedora
gives:
给出:
/etc/netplug.d/netplug: # At least on Fedora Core 1
...
But see the Fedora version in the /etc/netplug.d/netplug
file. Is it serious?
但请参阅/etc/netplug.d/netplug
文件中的 Fedora 版本。严重吗?
采纳答案by David Grant
cat /etc/issue
Or cat /etc/fedora-release
as suggested by @Bruce ONeel
或者 cat /etc/fedora-release
按照@Bruce ONeel 的建议
回答by mouviciel
What about uname -a
?
怎么样uname -a
?
回答by Bruce ONeel
You can also try /etc/redhat-release
or /etc/fedora-release
:
您也可以尝试/etc/redhat-release
或/etc/fedora-release
:
cat /etc/fedora-release
Fedora release 7 (Moonshine)
回答by stephen mulcahy
You could try
你可以试试
lsb_release -a
which works on at least Debian and Ubuntu (and since it's LSB, it should surely be on most of the other mainstream distros at least). http://rpmfind.net/linux/RPM/sourceforge/l/ls/lsb/lsb_release-1.0-1.i386.htmlsuggests it's been around quite a while.
它至少适用于 Debian 和 Ubuntu(并且由于它是 LSB,它肯定至少应该适用于大多数其他主流发行版)。http://rpmfind.net/linux/RPM/sourceforge/l/ls/lsb/lsb_release-1.0-1.i386.html表明它已经有一段时间了。
回答by stephen mulcahy
uname -a works with my fc11
uname -a 适用于我的 fc11
回答by Belmiro
[Belmiro@HP-550 ~]$ uname -a
Linux HP-550 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 07:06:34 UTC 2010
x86_64 x86_64 x86_64 GNU/Linux
[Belmiro@HP-550 ~]$ lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:deskt
op-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch
Distributor ID: Fedora
Description: Fedora release 11 (Leonidas)
Release: 11
Codename: Leonidas
[Belmiro@HP-550 ~]$
回答by myroslav
The proposed standard file is /etc/os-release
. See http://www.freedesktop.org/software/systemd/man/os-release.html
建议的标准文件是/etc/os-release
. 见http://www.freedesktop.org/software/systemd/man/os-release.html
You can execute something like:
您可以执行以下操作:
$ source /etc/os-release
$ echo $ID
fedora
$ echo $VERSION_ID
17
$ echo $VERSION
17 (Beefy Miracle)
回答by Gorgan Razvan
The simplest command which can give you what you need but some other good info too is:
最简单的命令可以给你你需要的东西,但也有一些其他的好信息:
hostnamectl
回答by Old Uncle Ho
On my installation of Fedora 25 (workstation) all of the distribution ID info was found in this file:
在我安装 Fedora 25(工作站)时,所有发行版 ID 信息都可以在此文件中找到:
/usr/lib/os.release.d/os-release-workstation
This included,
这包括,
- NAME=Fedora
- VERSION="25 (Workstation Edition)"
- ID=fedora
- VERSION_ID=25
- PRETTY_NAME="Fedora 25 (Workstation Edition)"
- <...>
- VARIANT="Workstation Edition"
- VARIANT_ID=workstation
- 名称=Fedora
- VERSION="25 (工作站版)"
- ID=fedora
- VERSION_ID=25
- PRETTY_NAME="Fedora 25(工作站版)"
- <...>
- VARIANT="工作站版"
- VARIANT_ID=工作站
回答by Rafael
These commands worked for Artik 10 :
这些命令适用于 Artik 10:
- cat /etc/fedora-release
- cat /etc/issue
- hostnamectl
- cat /etc/fedora-release
- 猫 /etc/issue
- 主机名
and these others didn't :
而这些其他人没有:
- lsb_release -a
- uname -a
- lsb_release -a
- uname -a