温馨提示×

debian yum仓库在哪设

小樊
48
2026-10-07 18:53:12
栏目: 智能运维

在 Debian 系统里,不使用 yum,而是使用 apt / apt-get,对应的“仓库”配置文件在:

1. 仓库源配置文件位置

主配置文件:

/etc/apt/sources.list

附加仓库目录(推荐):

/etc/apt/sources.list.d/

这个目录下通常是 .list 文件,比如:

/etc/apt/sources.list.d/docker.list

2. 如何修改仓库

编辑文件(需要 root 权限):

sudo nano /etc/apt/sources.list

或修改 sources.list.d/ 下的文件。

示例(Debian 12 bookworm):

deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://security.debian.org/debian-security bookworm-security main

3. 修改后更新

sudo apt update

4. 补充说明

  • yum 是 RHEL / CentOS / Rocky / AlmaLinux 用的
  • Debian / Ubuntu 用 apt
  • yum 的仓库在:
    /etc/yum.repos.d/
    

如果你是 把 CentOS 的思维带到 Debian,记住一句话:

Debian 没有 yum,仓库在 /etc/apt/sources.list 和 /etc/apt/sources.list.d/

如果你是想 在 Debian 上用 yum(不推荐) 或 配置某个特定软件源,可以告诉我具体场景。

0 踩