Я знаю, что в Ubuntu есть графический интерфейс Software & Updatesдля включения каналов обновления
- обновления
- предложил
- Backports
- безопасность
как показано на этом скриншоте:
Я ищу простой способ сделать это из терминала, используя такие команды, как
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.listcat /etc/apt/sources.list<empty>sudo apt-add-update enable security<empty>
Один включенный репозиторий (
main)cat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily mainsudo apt-add-update enable securitydeb http://archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily-security main
Два или более включенных репозитория в одну или две строки
cat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily main universeили
deb http://archive.ubuntu.com/ubuntu wily main deb http://archive.ubuntu.com/ubuntu wily universesudo apt-add-update enable securitydeb 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.listdeb http://archive.ubuntu.com/ubuntu wily main universe deb-src http://archive.ubuntu.com/ubuntu wily main universesudo apt-add-update enable securitydeb 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.listdeb http://archive.ubuntu.com/ubuntu wily main universe # deb-src http://archive.ubuntu.com/ubuntu wily main universesudo apt-add-update enable securitydeb 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.listdeb http://archive.ubuntu.com/ubuntu wily-security universesudo apt-add-update enable defaultdeb http://archive.ubuntu.com/ubuntu wily universe deb http://archive.ubuntu.com/ubuntu wily-security universe
Только одна запись и
disableдействиеcat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily-security universesudo apt-add-update disable security<empty>
Разные или одинаковые серверы для разных или одинаковых репозиториев, уважайте каждый сервер
cat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily universe deb http://us.archive.ubuntu.com/ubuntu wily mainsudo apt-add-update enable securitydeb 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.listdeb http://archive.ubuntu.com/ubuntu wily main universe deb http://archive.ubuntu.com/ubuntu trusty mainsudo apt-add-update enable securitydeb 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 или другие источники пакета (не-Canonical) в
sources.list?Игнорировать!
Не менять протоколы, например
https,http,tor, ...



