# VS Code mirror (pkg.shecan.ir)

> Mirror of the VS Code repositories on packages.microsoft.com (repos/code for apt, yumrepos/vscode for dnf).

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

## Limitations

- Only the VS Code repositories are mirrored, not other packages.microsoft.com repositories.
- Extensions (Marketplace) and the Windows/macOS installers 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.

### 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/microsoft.asc https://mirror-vscode.pkg.shecan.ir/keys/microsoft.asc
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/microsoft.asc] https://mirror-vscode.pkg.shecan.ir/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
sudo apt update && sudo apt install -y code
```

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

```sh
sudo rm -f /etc/apt/sources.list.d/vscode.list
sudo apt update
```

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

Configuration file (linux): `/etc/yum.repos.d/vscode.repo`

```ini
[code]
name=Visual Studio Code
baseurl=https://mirror-vscode.pkg.shecan.ir/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://mirror-vscode.pkg.shecan.ir/keys/microsoft.asc
```

Undo / restore the default (linux)

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

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

Run (linux) (checked by hand)

```sh
sudo dnf install -y code
```
