ubuntu codename

1、查看当前系统的codename

$ lsb_release -a

2、历史版本codename

Ubuntu 发布版本的官方名称是 Ubuntu X.YY ,其中 X 表示年份(减去2000),YY 表示发布的月份。

Ubuntu 没有像其它软件一样有 1.0 版本,是因为其第一个版本是发布于 2004 年。所以Ubuntu的生日是10月20日。

版本

别名(codename)

发布日期

4.10

Warty Warthog(长疣的疣猪)

2004年10月20日

5.04

Hoary Hedgehog(灰白的刺猬)

2005年4月8日

5.10

Breezy Badger(活泼的獾)

2005年10月13日

6.06

Dapper Drake(整洁的公鸭)

2006年6月1日(LTS)

6.10

Edgy Eft(急躁的水蜥)

2006年10月6日

7.04

Feisty Fawn(坏脾气的小鹿)

2007年4月19日

7.10

Gutsy Gibbon(勇敢的长臂猿)

2007年10月18日

8.04

Hardy Heron(耐寒的苍鹭)

2008年4月24日(LTS)

8.10

Intrepid Ibex (勇敢的野山羊)

2008年10月30日

9.04

Jaunty Jackalope(得意洋洋的怀俄明野兔)

2009年4月23日

9.10

Karmic Koala(幸运的考拉)

2009年10月29日

10.04

Lucid Lynx(清醒的猞猁)

2010年4月29日

11.10

Oneiric Ocelot(梦幻的豹猫)

2010年10月13日

11.04

Natty Narwhal(敏捷的独角鲸)

2011年4月28日

12.04

Precise Pangolin(精准的穿山甲)

2012年的4月26日(LTS)

12.10

Quantal Quetzal(量子的绿咬鹃)

2012年的10月20日

13.04

Raring Ringtail(铆足了劲的猫熊)

2013年4月25日

13.10

Saucy Salamander(活泼的蝾螈)

2013年10月17日

14.04

Trusty Tahr (可靠的塔尔羊)

2014年4月18日 (LTS)

14.10

Utopic Unicorn(乌托邦独角兽)

2014年10月23日

15.04

Vivid Vervet (活泼的小猴)

2015年4月

15.10

Wily Werewolf (狡猾的狼人)

2015年10月

16.04

Xenial Xerus (好客的非洲地松鼠)

2016年4月 (LTS)

16.10

Yakkety Yak(牦牛)

2016年10月

17.04

Zesty Zapus(开心的跳鼠)

2017年4月

17.10

Artful Aardvark(机灵的土豚)

2017年10月

18.04

Bionic Beaver(仿生海狸)

2018年4月(LTS)

 

参考文档:https://blog.youkuaiyun.com/zhengmx100/article/details/78352773

[01:37:01] 🟢 INFO: 🔐 密码验证(不可跳过) [01:37:01] 🟢 INFO: 📌 请输入部署密码继续执行 [01:37:01] 🛑 请输入密码 (剩余尝试次数: 3): [01:37:03] 🟢 INFO: ✅ 密码正确,开始部署... [01:37:03] 🟢 INFO: 🔧 安装核心工具链(coreutils, software-properties-common, unzip, bsdutils)... Ign:1 http://mirrors.aliyun.com/ubuntu $CODENAME InRelease Ign:2 http://mirrors.aliyun.com/ubuntu $CODENAME-security InRelease Ign:3 http://mirrors.aliyun.com/ubuntu $CODENAME-updates InRelease Err:4 http://mirrors.aliyun.com/ubuntu $CODENAME Release 404 Not Found [IP: 58.58.80.46 80] Err:5 http://mirrors.aliyun.com/ubuntu $CODENAME-security Release 404 Not Found [IP: 58.58.80.46 80] Err:6 http://mirrors.aliyun.com/ubuntu $CODENAME-updates Release 404 Not Found [IP: 58.58.80.46 80] Reading package lists... Done E: The repository 'http://mirrors.aliyun.com/ubuntu $CODENAME Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://mirrors.aliyun.com/ubuntu $CODENAME-security Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://mirrors.aliyun.com/ubuntu $CODENAME-updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
最新发布
12-03
<think>我们被要求查看Ubuntu系统的Codename(开发代号)。根据引用内容,有几种方法可以查看: 1. 使用`lsb_release -a`命令,在输出中会有一行"Codename",显示当前系统的开发代号。 2. 查看`/etc/os-release`文件,其中会有`VERSION_CODENAME`字段,该字段的值就是Codename。 3. 使用`lsb_release -c`或`lsb_release --codename`可以直接输出Codename。 根据引用[1]和[2]中的示例,我们可以看到在Ubuntu 22.04系统中,Codename为"jammy"。 因此,我们可以采用以下任一命令: 方法1:使用`lsb_release -a`,然后在输出中查找Codename行。 方法2:使用`lsb_release -c`(或`lsb_release --codename`)直接输出Codename。 方法3:查看`/etc/os-release`文件,使用命令`cat /etc/os-release`,然后查找`VERSION_CODENAME`字段。 其中,最直接的方法是使用`lsb_release -c`,因为它只输出Codename,格式如下: Codename: jammy 或者使用`lsb_release -c`会输出两行,我们可以用`cut`或`awk`来只取值,但通常直接看就行。 另外,引用[3]也提到了Codename的重要性,特别是在换源的时候,因为源地址中通常使用Codename来标识系统版本。 因此,我们给出以下命令: 1. 使用`lsb_release -c`: ``` lsb_release -c ``` 2. 或者使用`lsb_release --codename`(同上): ``` lsb_release --codename ``` 3. 如果只想获取纯Codename字符串(不包含标签),可以使用: ``` lsb_release -c | awk '{print $2}' ``` 4. 查看`/etc/os-release`文件并过滤Codename: ``` grep VERSION_CODENAME /etc/os-release | cut -d= -f2 ``` 注意:`lsb_release`命令可能需要安装`lsb-release`包,但通常Ubuntu默认已安装。 如果系统没有安装`lsb-release`,可以使用以下命令安装: sudo apt update sudo apt install lsb-core 但是,根据引用[2]中的示例,系统已经能够使用`lsb_release`命令,所以一般情况下无需安装。 因此,我们推荐使用`lsb_release -c`来查看Codename。 示例输出: $ lsb_release -c Codename: jammy 或者,如果只想获取值(不带前面的标签): $ lsb_release -cs jammy 注意:`lsb_release -cs`中的`s`选项表示短输出,只输出值(即只输出"jammy"),这在脚本中特别有用。 所以,最简单直接且适合脚本使用的方式是: lsb_release -cs 总结:要查看当前Ubuntu系统的Codename,请在终端运行: lsb_release -cs 这样就会直接输出开发代号,例如:jammy。 注意:如果系统没有`lsb_release`命令,那么可以按照上述方法安装,或者使用第二种方法(查看/etc/os-release文件)。 根据引用[4],我们还可以使用`uname -a`查看内核版本,但这并不能直接得到Codename,所以不推荐用于此目的。 因此,我们主要使用`lsb_release`命令。</think>要查看当前 Ubuntu 系统的 Codename(开发代号),可以通过以下任一方法实现: ### 方法 1:使用 `lsb_release` 命令(推荐) ```bash lsb_release -c # 或直接获取 Codename 值 lsb_release -cs ``` **输出示例**: ```bash Codename: jammy # 完整输出 jammy # 仅 Codename 值(-cs 参数) ``` ### 方法 2:查看 `/etc/os-release` 文件 ```bash grep VERSION_CODENAME /etc/os-release # 或直接提取值 grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release ``` **输出示例**: ```bash VERSION_CODENAME=jammy # 完整输出 jammy # 仅 Codename 值 ``` ### 方法 3:使用 `hostnamectl` 命令 ```bash hostnamectl | grep "Operating System" ``` **输出示例**: ```bash Operating System: Ubuntu 22.04.3 LTS (jammy) # 括号内为 Codename ``` --- ### 说明: 1. **Codename 作用**: Codename(如 `jammy`)是 Ubuntu 版本的开发代号,在配置软件源(如 `/etc/apt/sources.list`)时需使用此名称[^3]。 2. **系统兼容性**: 以上命令适用于所有 Ubuntu 版本(包括服务器/桌面版),无需 root 权限。 3. **快速验证**: 终端直接运行 `lsb_release -cs` 可最快获得结果(如 `jammy`)。 > 示例系统:Ubuntu 22.04 LTS 的 Codename 为 **jammy**[^1][^2]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值