Tôi biết có một GUI trong Ubuntu Software & Updatesđể kích hoạt các kênh cập nhật
- cập nhật
- đề xuất
- backport
- Bảo vệ
như thể hiện trong ảnh chụp màn hình này:
Tôi đang tìm kiếm một cách dễ dàng để làm điều này từ bên trong một thiết bị đầu cuối bằng cách sử dụng các lệnh như
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
và một điều nữa
sudo apt-add-update enable default
sudo apt-add-update disable default
Một số ví dụ để hiểu rõ hơn
Trống rỗng
sources.listcat /etc/apt/sources.list<empty>sudo apt-add-update enable security<empty>
Một kho lưu trữ được kích hoạt (
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
Hai hoặc nhiều kho được kích hoạt trong một hoặc hai dòng
cat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily main universehoặc là
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 universehoặc là
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
Với
deb-srccác mụccat /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
Với
deb-srccác mục không hoạt độngcat /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
các
defaultđiềucat /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
Chỉ có một mục và
disablehành độngcat /etc/apt/sources.listdeb http://archive.ubuntu.com/ubuntu wily-security universesudo apt-add-update disable security<empty>
Khác nhau hoặc cùng một máy chủ cho khác nhau hoặc các kho lưu trữ mẫu, tôn trọng từng máy chủ
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
Các bản phát hành Ubuntu khác nhau cho các kho lưu trữ khác nhau, tôn trọng mỗi bản phát hành
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 hoặc các nguồn gói khác (không phải Canonical) trong
sources.list?Làm lơ!
Không thay đổi các giao thức, ví dụ như
https,http,tor, ...



