# CentOS Stream mirror (pkg.shecan.ir)

> Mirror of mirror.stream.centos.org (CentOS Stream 9 and 10: BaseOS, AppStream, CRB, HighAvailability, NFV, RT, ResilientStorage, and extras-common under SIGs/) for dnf. The official host and mirrors.centos.org refuse Iranian addresses (403).

- Upstream: mirror.stream.centos.org
- Mirror URL: <https://mirror-centos.pkg.shecan.ir/>
- Clients: dnf, yum
- Service status: <https://pkg.shecan.ir/status.json> (key `centos-stream`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/centos-stream/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/centos-stream.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `centos`, mirror `shecan`): <https://audit.shecan.ir/#centos>

## Limitations

- dnf verifies packages with the official CentOS key. Mirror paths match mirror.stream.centos.org (for example 9-stream/BaseOS/x86_64/os/ and SIGs/9-stream/extras/x86_64/extras-common/).
- Only the binary repositories are switched to the mirror; the disabled debuginfo and source repositories keep their metalink.
- CentOS Stream 10 was verified on arm64 (aarch64); its x86_64 build needs an x86-64-v3 processor.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### dnf, yum: persistent (user- or system-wide configuration)

Back up first (linux)

```sh
sudo mkdir -p /root/yum.repos.d.bak && sudo cp /etc/yum.repos.d/centos*.repo /root/yum.repos.d.bak/
```

Run (linux)

```sh
sudo sed -i \
  -e 's|^metalink=.*repo=centos-baseos-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/BaseOS/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-appstream-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/AppStream/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-crb-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/CRB/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-highavailability-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/HighAvailability/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-nfv-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/NFV/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-rt-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/RT/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-resilientstorage-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/$stream/ResilientStorage/$basearch/os/|' \
  -e 's|^metalink=.*repo=centos-extras-sig-extras-common-\$stream&arch=\$basearch&.*|baseurl=https://mirror-centos.pkg.shecan.ir/SIGs/$stream/extras/$basearch/extras-common/|' \
  /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos-addons.repo
```

Run (linux)

```sh
sudo dnf makecache
sudo dnf install -y jq
```

Undo / restore the default (linux)

```sh
sudo cp /root/yum.repos.d.bak/centos*.repo /etc/yum.repos.d/
```
