📦

APT Source Manager

Generate Linux APT source management scripts for Debian/Ubuntu

Practical Guide

Distribution Selection

1.11.1
Ubuntu 22.04 LTS (Jammy Jellyfish)
Mirror Source
Ubuntu Official (Global) (archive.ubuntu.com)

Options

Backup Current sources.list
Include Security Updates
Enable Source Repositories
Auto Run apt-get update

Generated Script

Save as .sh file, run: chmod +x filename.sh && sudo ./filename.sh

❓What is APT Source Manager

APT Source Manager is a tool for generating and managing APT sources list (sources.list) for Debian/Ubuntu systems. APT (Advanced Package Tool) is the package management system for Debian-based Linux. Key features: Multi-distribution support (Ubuntu 18.04-24.04, Debian 9-12), Multi-mirrors (Aliyun, Tencent, Huawei, USTC, 163, Official), Version-specific configuration (LTS, non-LTS), HTTPS/HTTP support, Component selection (main, universe, restricted, multiverse), Auto backup/restore script generation, One-click apply scripts. Why it matters: Package download speed (domestic mirrors 10x faster), System update reliability, Network cost savings (CDN mirrors), Disaster recovery (backup/restore). Use cases: New server initialization, Mirror source optimization, Batch server deployment, Offline environment configuration, CI/CD pipelines. How it works: 1) Select distribution/version, 2) Choose mirror and components, 3) Generate sources.list file, 4) Generate backup script (backup original), 5) Generate apply script (apply new sources), 6) Generate restore script (rollback). Best practices: Backup before changes, Choose closest mirror, Use HTTPS in production, Test after source update, Keep consistent sources across multiple servers. This tool generates scripts locally in browser without uploading data.

✨Features

📦

Multi Distribution

Support Ubuntu, Debian, Linux Mint
🌍

Mirror Selection

Choose from global mirror servers
⚡

Quick Generate

Instant sources.list generation
📋

Copy & Use

Copy configuration to clipboard

🎯Use Cases

Daily productivity

Use APT Source Manager to complete common utility tasks faster without installing a dedicated desktop application.

Validation and review

APT Source Manager helps check output, compare values, prepare examples, and reduce manual mistakes in routine work.

Documentation support

Create clearer examples with APT Source Manager for notes, tutorials, support tickets, and internal knowledge base content.

📚Practical Guide

APT Package Management

APT (Advanced Package Tool) is a high-level package management system for Debian-based distributions. It uses /etc/apt/sources.list to define repository locations. Each line in sources.list specifies a repository type (deb/deb-src), URL, distribution codename, and components. APT automatically resolves dependencies and handles package installation, upgrades, and removal.

Repository Structure

Ubuntu repositories are divided into four components: main (officially supported free software), restricted (proprietary drivers), universe (community-maintained free software), and multiverse (software with copyright restrictions). Debian uses main, contrib, and non-free. Security updates and backports are provided through separate repository channels.

Mirror Sources

Mirror sources are synchronized replicas of official repositories hosted by universities, companies, and organizations worldwide. Using geographically closer mirrors significantly reduces package download time. Major Chinese mirrors like Aliyun, Tsinghua (TUNA), and USTC provide daily synchronized repositories with high-speed connections for Chinese users.

Security Updates

Security repositories provide critical security patches and updates. Enabling security updates is essential for production systems to protect against vulnerabilities. The -security repository channel delivers timely security fixes without requiring full system upgrades. These updates are tested for stability and compatibility before release.

💬Frequently Asked Questions

❓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.

💡How to Use

1️⃣

Select System

Choose distribution (Ubuntu/Debian) and version (20.04, 22.04, 11, 12). Check current version: lsb_release -a
2️⃣

Choose Mirror

Select mirror based on geographic location and network. China: Aliyun, Tencent, USTC recommended. International: Use official mirrors.
3️⃣

Generate Scripts

Tool generates complete sources.list and backup/restore scripts. Download or copy the scripts.
4️⃣

Backup and Apply

Run backup script on server: sudo bash backup.sh. Apply new sources: sudo bash apply.sh. Verify update: sudo apt-get update
5️⃣

Verify and Upgrade

Confirm update completes without errors. Upgrade packages: sudo apt-get upgrade. If issues, restore: sudo bash restore.sh

User Comments

0 / 2000
Loading...