| aliases | |||
|---|---|---|---|
| tags |
|
||
| created | 2023-08-18 12:44:52 -0700 | ||
| modified | 2025-03-22 13:31:29 -0700 |
Debian 官网:https://www.debian.org/
Debian 的发行版 分成三支:稳定版(Stable)、测试版(testing)和不稳定版(unstable)。
其中不稳定版的代号永远为「sid」。
稳定版是官方最近一次发行的软件包。
Debian 稳定版本的生命周期为五年:
- 三年的完整支持
- 两年的长期支持(LTS)。
LTS (Long Term Support),既长期支持版本,实际是一个对 Debian 稳定版 的扩展支持,扩展至少 5 年。
| Version | schedule |
|---|---|
| Debian 6 「Squeeze」 | 2nd June 2014 to 29th of February 2016 |
| Debian 7 「Wheezy」 | 26th April 2016 to 31st May 2018 |
| Debian 8 「Jessie」 | 17th June 2018 to June 30, 2020 |
| Debian 9 「Stretch」 | July 6, 2020 to June 30, 2022 |
| Debian 10 「Buster」 | August 1st, 2022 to June 30th, 2024 |
| Debian 11 「Bullseye」 | August 15th, 2024 to June 30th, 2026 |
| Debian 12 「Bookworm」 | June 11th, 2026 to June 30th, 2028 |
distro-info 是一个 debian 查看版本的小工具。通过 apt install distro-info 安装。
# 查看debian所有版本
distro-info -a
# 查看当前LTS版本的代号名(codename)
distro-info -c -l
# 查看所有版本的代号名
distro-info -c -a
# 查看所有版本的全名
# 包括版本全名
# 版本命名包括代号号及版本号,如「Debian 10 "Buster"」
distro-info -f -a
# 查看当前版本号
distro-info -r -l
# 查看当前版本名
distro-info -l
一般情况下,将 /etc/apt/sources.list 文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为镜像地址即可。
如下面示例添加 中科大 的:
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free[!info] Debian12 容器镜像
Debian 12 (bookworm) 的容器镜像开始使用 DEB822 格式,源的格式改变了。
而对应修改的文件是:
/etc/apt/sources.list.d/debian.sources。可以使用:
sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources来修改源文件。具体应参考各源说明文档,如中科大的:Debian 源使用帮助
同时你也可能需要更改 Debian Security 源,同样也是在 /etc/apt/sources.list 文件中添加。
如下面示例,添加了中科大的:
deb http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contribTip
不过,一般来说,为了更及时地获得安全更新,不推荐使用镜像站安全更新软件源,因为镜像站往往有同步延迟。
所以安全更新还是使用官方的:
deb https://security.debian.org/debian-security bullseye-security main contrib non-free更改完 sources.list 文件后请运行 sudo apt-get update 更新索引以生效。
换源操作,各镜像网站都有非常详细的操作说明,直接跟着说明操作就可以了!
- 国内镜像网站:Mirror_Address,应该都有 Debian 的镜像源。
- Debian 官方给出的全球镜像站:Debian 全球镜像站
mkpasswd 是一个随机生成密码的命令。在 debian 系统中,是不能直接安装,它是放在 whois 包中,所以得通过安装 whois 包来安装此命令。
安装 whois:apt install whois
装完,使用 mkpasswk --help 来测试下,mkpasswd 是不是已经能用了!