Eu sei que existe uma GUI no Ubuntu Software & Updatespara ativar os canais de atualização
- atualizações
- proposto
- backports
- segurança
como mostrado nesta captura de tela:
Estou procurando uma maneira fácil de fazer isso de dentro de um terminal usando comandos como
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
e uma coisa adicional
sudo apt-add-update enable default
sudo apt-add-update disable default
Alguns exemplos para uma melhor compreensão
Um vazio
sources.list
cat /etc/apt/sources.list
<empty>
sudo apt-add-update enable security
<empty>
Um repositório ativado (
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
Dois ou mais repositórios ativados em uma ou duas linhas
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe
ou
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
ou
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
Com
deb-src
entradascat /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
Com
deb-src
entradas inativascat /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
A
default
coisacat /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
Apenas uma entrada e a
disable
açãocat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily-security universe
sudo apt-add-update disable security
<empty>
Servidores diferentes ou iguais para diferentes ou os mesmos repositórios, respeite cada servidor
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
Diferentes versões do Ubuntu para diferentes repositórios, respeite cada versão
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
PPAs ou outras fontes de pacotes (não Canonical) na
sources.list
?Ignorar!
Não altere os protocolos, por exemplo
https
,http
,tor
, ...