I know there is a GUI in Ubuntu Software & Updates to enable the update channels
- updates
- proposed
- backports
- security
as shown in this screenshot:
I am looking for an easy way to do this from within a terminal using commands such as
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
and an additional thing
sudo apt-add-update enable default
sudo apt-add-update disable default
Some examples for a better understanding
-
An empty
sources.list
-
cat /etc/apt/sources.list
<empty>
-
sudo apt-add-update enable security
<empty>
-
-
One enabled repository (
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
-
-
Two or more enabled repositories in one or two lines
-
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily main universe
or
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
or
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
-
-
With
deb-src
entries-
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
-
-
With inactive
deb-src
entries-
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
-
-
The
default
thing-
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
-
-
Only one entry and the
disable
action-
cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu wily-security universe
-
sudo apt-add-update disable security
<empty>
-
-
Different or the same servers for different or the samerepositories, respect each server
-
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
-
-
Different Ubuntu releases for different repositories, respect each release
-
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 or other package sources (not-Canonical) in the
sources.list
?Ignore!
-
Don't change the protocols, e.g.
https
,http
,tor
, …
Best Answer
This does exactly what has been asked;
I'll update this from time to time if necessary;
The bleeding edge version can be found at this GitHub repository;
To install from the GitHub repository:
git
:sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
Synopsis: