- What is APT sources list?
- APT sources list (/etc/apt/sources.list) defines repositories where Debian/Ubuntu systems download software packages. Key components: Repository type (deb, deb-src), Mirror URL (server address), Distribution (focal, jammy, bullseye), Components (main, universe, restricted). Proper source configuration can improve package installation speed by 10x+ (using local mirrors).
- Which mirror should I choose?
- Mirror selection criteria: Geographic location (closest mirror), Network (education/public/cloud), Reliability (uptime), Sync frequency (latest updates). China recommendations: Aliyun (stable, fast), Tencent (cloud servers), USTC (education network), Huawei (enterprise). International: Official mirrors (archive.ubuntu.com), Regional mirrors (apt-mirror.org). Tip: Test multiple mirrors (apt-get update speed) and choose the fastest.
- How to safely change APT sources?
- Safe change steps: 1) Backup original: sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup. 2) Edit new sources: sudo nano /etc/apt/sources.list. 3) Update sources: sudo apt-get update. 4) Check errors: if errors, restore backup. 5) Upgrade packages: sudo apt-get upgrade. This tool auto-generates backup/restore scripts. Important: Always backup your system before changes.
- Difference between HTTPS and HTTP mirrors?
- HTTPS mirrors provide encrypted transmission for better security. Advantages: Prevent man-in-the-middle attacks, Prevent package tampering, Privacy protection (hide download content). Disadvantages: Slightly slower (encryption overhead), Requires apt-transport-https. HTTP: Faster but less secure. Recommendation: HTTPS for production servers, HTTP for personal testing. Note: APT verifies packages with GPG signatures, so HTTP is also relatively safe.
- How to troubleshoot APT update errors?
- Common errors and solutions: 404 Not Found: Check distribution version (lsb_release -a), Use correct codename. GPG errors: Update apt-key, Re-import keys. Connection timeout: Change mirror, Check network. Lock file: Kill other APT processes, Delete /var/lib/dpkg/lock. Hash Sum mismatch: apt clean, Clear cache. This tool generates validated sources to reduce errors.