Linux 简介
Linux 的来历、内核与发行版的区别、常见发行版怎么选。
Key Points1991 年 Linus 写出内核,GNU 提供工具,合起来成为可用的系统;发行版 = 内核 + 工具 + 包管理 + 默认配置。
来历
Stallman started GNU in 1983 and produced the compiler, shell and core utilities — but no kernel. Linus released the Linux kernel in 1991. Together they form a complete free OS, which is why the precise name is GNU/Linux.
内核与发行版
| Layer | Examples | Responsibility |
|---|---|---|
| Kernel | Linux 6.x | Process scheduling, memory, drivers, syscalls |
| Userland | glibc, bash, coreutils | Shell, libc, basic commands |
| Package manager | apt / dnf / apk | Install, upgrade, resolve deps |
| Init | systemd / OpenRC | Boot services, supervision |
常见发行版
| Distro | Package | Use |
|---|---|---|
| Ubuntu LTS | apt | Most tutorials, cloud default |
| Debian | apt | Stable, minimal, servers |
| Rocky / AlmaLinux | dnf | RHEL-compatible, enterprise |
| Alpine | apk | Tiny containers, musl libc |
| Arch | pacman | Rolling, for enthusiasts |
看自己的系统
Bash
cat /etc/os-release
uname -r
getconf LONG_BITOn a cloud host,
ID and VERSION_ID in /etc/os-release tell you whether to use apt or dnf. Do not guess.来历
1983 年 Stallman 发起 GNU 计划,写出了编译器、shell、核心工具,但缺一个内核。1991 年 Linus Torvalds 发布了 Linux 内核。两者结合,才有了完整可用的自由操作系统,所以严格叫法是 GNU/Linux。
内核与发行版
| 层次 | 例子 | 职责 |
|---|---|---|
| 内核 | Linux 6.x | 进程调度、内存、驱动、系统调用 |
| 用户空间 | glibc、bash、coreutils | Shell、C 库、基础命令 |
| 包管理 | apt / dnf / apk | 安装、升级、依赖解析 |
| 初始化 | systemd / OpenRC | 开机服务、进程守护 |
常见发行版
| 发行版 | 包管理 | 适用 |
|---|---|---|
| Ubuntu LTS | apt | 教程最多,云主机默认 |
| Debian | apt | 稳定、精简,服务器常用 |
| Rocky / AlmaLinux | dnf | RHEL 兼容,企业环境 |
| Alpine | apk | 极小容器,musl libc |
| Arch | pacman | 滚动更新,折腾党 |
看自己的系统
Bash
cat /etc/os-release
uname -r
getconf LONG_BIT云主机上
cat /etc/os-release 的 ID 与 VERSION_ID 决定你该用 apt 还是 dnf,别凭记忆。