# Google Cloud CLI mirror (pkg.shecan.ir)

> Mirror of the Google Cloud CLI repositories on packages.cloud.google.com (apt suite cloud-sdk, yum repositories cloud-sdk-el<n>-<arch>: google-cloud-cli, its components and kubectl) and their keys. packages.cloud.google.com refuses Iranian addresses (403).

- Upstream: packages.cloud.google.com
- Mirror URL: <https://mirror-gcloud.pkg.shecan.ir/>
- Clients: apt, dnf, yum
- Service status: <https://pkg.shecan.ir/status.json> (key `gcloud`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/gcloud/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/gcloud.json>

## Limitations

- apt and dnf still verify Google's signature.
- Only the cloud-sdk repositories are mirrored, not the other repositories on packages.cloud.google.com (gcsfuse, legacy Kubernetes).
- The mirror installs the CLI; using Google Cloud itself from Iran is still subject to Google's restrictions.

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

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

Run, Ubuntu or Debian (linux)

```sh
sudo install -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/cloud.google.asc https://mirror-gcloud.pkg.shecan.ir/apt/doc/apt-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/cloud.google.asc] https://mirror-gcloud.pkg.shecan.ir/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt update && sudo apt install -y google-cloud-cli
```

Undo / restore the default, Ubuntu or Debian (linux)

```sh
sudo rm -f /etc/apt/sources.list.d/google-cloud-sdk.list /etc/apt/keyrings/cloud.google.asc
sudo apt update
```

Run, Ubuntu or Debian (linux)

```sh
sudo apt install -y google-cloud-cli-gke-gcloud-auth-plugin
```

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

Configuration file (linux): `/etc/yum.repos.d/google-cloud-sdk.repo`

```ini
[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://mirror-gcloud.pkg.shecan.ir/yum/repos/cloud-sdk-el9-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://mirror-gcloud.pkg.shecan.ir/yum/doc/rpm-package-key.gpg
```

Undo / restore the default (linux)

```sh
sudo rm -f /etc/yum.repos.d/google-cloud-sdk.repo
sudo dnf clean all
```

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

Run (linux) (checked by hand)

```sh
sudo dnf install -y google-cloud-cli
```
