Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Linux Mirrors (IranMirrors.sh)

A cross‑distribution, smart mirror manager designed for Linux users operating under Iran's internet blackout. It automatically tests and selects the fastest accessible local mirrors for your distribution, ensuring your system can be updated and maintained even when international access is severed.

✨ Features

  • 🖥️ Multi‑Distribution Support – Auto‑detects and configures sources for APT (Debian/Ubuntu), YUM/DNF (RHEL/Rocky/AlmaLinux), and Pacman (Arch/Manjaro).
  • ⚡ Smart Testing – Tests latency and availability of dozens of local mirrors using HTTP checks and ping, then selects the top 4 fastest options.
  • 🛡️ Safe & Automatic Backups – Creates a timestamped backup of your original sources before making any changes.
  • 🔄 One‑Command Restore – Easily revert to your previous configuration with the --restore flag.

🚀 Quick Start: One‑Line Install & Run

As root or with sudo, copy and paste this command into your terminal:

curl -s -o /tmp/IranMirrors.sh https://github.com/ghraw/RMNO21/Linux_Mirrors/main/IranMirrors.sh && sudo bash /tmp/IranMirrors.sh

The script will:

  1. Detect your operating system.
  2. Test a curated list of Iranian and accessible local mirrors.
  3. Automatically update your source lists with the fastest ones.

🔧 Manual Usage

  1. Clone the repository:

    git clone https://github.com/RMNO21/Linux_Mirrors.git
    cd Linux_Mirrors
  2. Make the script executable:

    chmod +x IranMirrors.sh
  3. Run the script as root:

    sudo ./IranMirrors.sh

📋 How It Works

  1. Detection: Identifies your OS, version, and codename from /etc/os-release.

  2. Backup: Your current sources are backed up to /var/backups/mirrorgpt/ with a timestamp.

  3. Probing: Each mirror is tested with a release-specific HTTP probe (e.g., dists/noble/Release for Ubuntu 24.04) to verify it carries your distribution.

  4. Scoring: Mirrors are ranked by ping latency (fallback: curl response time).

  5. Selection: The top 2 fastest mirrors that pass HTTP checks are selected.

  6. Configuration: Source files are rewritten using the appropriate format for your OS.

  7. Cleanup: Old conflicting source files are disabled, not deleted.

🗺️ Included Mirrors

The script contains a curated, static list of active local mirrors within Iran or accessible via the national intranet. This list is regularly updated and includes providers such as:

  • mirror.shatel.ir
  • repo-portal.ito.gov.ir
  • arvancloud.ir
  • linuxmirrors.ir
  • repo.iut.ac.ir

(A full list can be found within the MIRRORS_UBUNTU, MIRRORS_DEBIAN, etc., arrays in the script.)

🤝 Contributing

If you know of a new or updated local mirror that should be added to the list, please open an issue or submit a pull request. Your contribution helps keep the community connected.

⚖️ License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

📡 Community & Awareness

#InternetShutdown #IranInternetShutdown #DigitalBlackoutIran #IranDigitalBlackout #Whitelisted_Line #IRanASignalProxy #SOSIran

About

Cross-distribution Linux mirror manager for fast packages and network resilience

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages