我曾经在 CentOS 上用 yum 做过类似的事情。我认为有一个 --enable-repo 和 --disable-repo 参数。
是否有东西存在apt-get install <some pkg>,这将限制/etc/apt/sources.list.d/<somefile>?
apt-get install <some pkg>
/etc/apt/sources.list.d/<somefile>
installation apt
apt ×1
installation ×1