Skip to content

behnam0x/ubuntu-mirror-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ubuntu 24.04 Mirror Script

This script automates the process of mirroring all Ubuntu 24.04 (noble) packages using debmirror. It supports full repository syncing across all major sections (main, restricted, universe, multiverse) and optional suites like security, updates, and backports.

πŸš€ What the Script Does

  • Mirrors Ubuntu 24.04 packages from archive.ubuntu.com
  • Downloads all .deb binaries and metadata files
  • Supports optional suites: noble-security, noble-updates, noble-backports
  • Organizes mirrored content into a local Debian-style repository
  • Logs progress, duration, and disk usage
  • Handles stale lock files and running processes gracefully

πŸ§ͺ How to Run It

  1. Make the script executable:

    chmod +x mirror-ubuntu-24.04.sh
  2. Run the script:

    sudo ./mirror-ubuntu-24.04.sh
  3. Follow the interactive prompts to include optional suites.

πŸ“¦ Dependencies

Make sure the following packages are installed:

  • debmirror

    sudo apt install debmirror
  • rsync (used internally by debmirror)

    sudo apt install rsync
  • curl, awk, pgrep, tee, du (standard utilities)

πŸ’Ύ Disk Space Requirements

Mirroring the full Ubuntu 24.04 repository can consume:

  • Base mirror (main only): ~80–100 GB
  • Full mirror (all sections + suites): 500–800 GB+

Actual usage depends on selected suites and architecture.

🌐 Serving the Mirror

To use the mirrored packages on other machines:

  1. Transfer the mirror directory to a server:

    rsync -a /Ubuntu-Repository/ user@server:/srv/apt-mirror/
  2. Serve it via HTTP (e.g., using Nginx or Apache)

  3. Add this to client machines:

    echo "deb [trusted=yes] http://your-server/apt-mirror noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/offline.list
    sudo apt update

πŸ“„ License

This script is provided under the MIT License. Feel free to modify and share.

About

Script to mirror Ubuntu 24.04 packages using debmirror

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages