# openSUSE mirror (pkg.shecan.ir)

> Mirror of download.opensuse.org for zypper: openSUSE Leap 15.6 and 16.0, Tumbleweed and Slowroll (also ports/ for aarch64 and other architectures), with their oss, non-oss and update repositories.

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

## Limitations

- zypper verifies the repository metadata signature and the package signatures with the official openSUSE keys; mirror paths match download.opensuse.org.
- Leap 16.0 and newer Tumbleweed installs generate their repositories from the openSUSE-repos service (cdn.opensuse.org); the guide edits that service too. An update of the openSUSE-repos package restores cdn.opensuse.org, so run the command again after it.
- The Open H.264 codec repository (codecs.opensuse.org) is not mirrored and is still fetched from Cisco; disable it where it cannot be reached.
- Build Service repositories (download.opensuse.org/repositories/) are not mirrored.

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

### zypper: persistent (user- or system-wide configuration)

Back up first (linux)

```sh
sudo mkdir -p /root/zypp.bak && sudo cp -a /etc/zypp/repos.d /root/zypp.bak/
if [ -d /usr/share/zypp/local/service/openSUSE ]; then sudo cp -a /usr/share/zypp/local/service/openSUSE/repo /root/zypp.bak/service-repo; fi
```

Run (linux)

```sh
sudo sed -i -E 's#https?://(download|cdn)\.opensuse\.org/#https://mirror-opensuse.pkg.shecan.ir/#' /etc/zypp/repos.d/*.repo
if [ -d /usr/share/zypp/local/service/openSUSE ]; then sudo sed -i -E 's#disturl="https?://(download|cdn)\.opensuse\.org"#disturl="https://mirror-opensuse.pkg.shecan.ir"#' /usr/share/zypp/local/service/openSUSE/repo/opensuse-*-repoindex.xml; fi
```

Run (linux)

```sh
sudo zypper modifyrepo --disable repo-openh264 || sudo zypper modifyrepo --disable openSUSE:repo-openh264
```

Run (linux)

```sh
sudo zypper refresh
sudo zypper install -y jq
```

Undo / restore the default (linux)

```sh
sudo rm -f /etc/zypp/repos.d/*.repo && sudo cp -a /root/zypp.bak/repos.d/. /etc/zypp/repos.d/
if [ -d /root/zypp.bak/service-repo ]; then sudo cp -a /root/zypp.bak/service-repo/. /usr/share/zypp/local/service/openSUSE/repo/; fi
```
