我知道Ubuntu中有一个GUI Software & Updates来启用更新通道
- 更新
- 提议的
- 返港
- 安全
如以下屏幕截图所示:
我正在寻找一种使用以下命令从终端内部执行此操作的简便方法
sudo apt-add-update enable updates
sudo apt-add-update enable proposed
sudo apt-add-update enable backports
sudo apt-add-update enable security
sudo apt-add-update disable updates
sudo apt-add-update disable proposed
sudo apt-add-update disable backports
sudo apt-add-update disable security
还有一件事
sudo apt-add-update enable default
sudo apt-add-update disable default
一些例子,以更好地理解
一个空的
sources.list
cat /etc/apt/sources.list
<empty>
sudo apt-add-update enable security
<empty>
一个启用的存储库(
main
)cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily-security main
一行或两行中的两个或多个启用的存储库
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe
要么
deb http://archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily universe
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu wily-security main universe
要么
deb http://archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily-security main deb http://archive.ubuntu.com/ubuntu wily universe deb http://archive.ubuntu.com/ubuntu wily-security universe
带
deb-src
条目cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe deb-src http://archive.ubuntu.com/ubuntu wily main universe
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily main universe deb-src http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu wily-security main universe deb-src http://archive.ubuntu.com/ubuntu wily-security main universe
使用无效的
deb-src
条目cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe # deb-src http://archive.ubuntu.com/ubuntu wily main universe
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily main universe # deb-src http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu wily-security main universe
该
default
事cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily-security universe
sudo apt-add-update enable default
deb http://archive.ubuntu.com/ubuntu wily universe deb http://archive.ubuntu.com/ubuntu wily-security universe
只有一个条目和
disable
动作cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily-security universe
sudo apt-add-update disable security
<empty>
对于不同或相同存储库的不同或相同服务器,请尊重每个服务器
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily universe deb http://us.archive.ubuntu.com/ubuntu wily main
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily universe deb http://us.archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily-security universe deb http://us.archive.ubuntu.com/ubuntu wily-security main
针对不同存储库的不同Ubuntu版本,请尊重每个版本
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu trusty main
sudo apt-add-update enable security
deb http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu trusty main deb http://archive.ubuntu.com/ubuntu wily-security main universe deb http://archive.ubuntu.com/ubuntu trusty-security main
PPA或?中的其他软件包来源(非规范)
sources.list
?忽视!
不要更改协议,例如
https
,http
,tor
,...