SETUP-APKREPOS(8)

πŸ“¦ version 3.22.0, in alpine 3.24

πŸŽ€ SETUP-APKREPOS(8) πŸŽ€

okay bestie, this is the System Manager's Manual page for setup-apkrepos β€” and it's literally here to help you configure apk package repositories without the chaos. πŸ’…βœ¨


✨ NAME ✨

  • setup-apkrepos β€” configure apk package repositories 🌸

πŸ¦‹ SYNOPSIS πŸ¦‹

the shapes this command can take, fr fr:

setup-apkrepos [-ch] [-f | -r | -1 | REPO...]

setup-apkrepos -o

πŸ’– DESCRIPTION πŸ’–

setup-apkrepos configures /etc/apk/repositories. It can add a mirror from the Alpine mirror list, write explicit repository URLs, enable matching community repositories, or prompt interactively. all the repo setup energy in one little script 🫢

When a mirror is selected from the mirror list, repositories are written for the current Alpine release. The release is inferred from an existing main repository or from /etc/alpine-release; development and unknown versions fall back to edge. 🧚

After changing repositories, the script runs apk update. ✨


πŸ’… OPTIONS πŸ’…

okay here's the full flag lineup, no cap β€” every single one:

  • -1 β€” Add the first mirror from the mirror list, normally the CDN mirror, and do not prompt. πŸ‘‘
  • -c β€” Enable the community repository when adding a mirror. Without this option, the generated community repository line is commented out. πŸ’¬
  • -f β€” Find and add the fastest mirror from the mirror list, and do not prompt. πŸ”₯
  • -h β€” Display usage information and exit. 🫑
  • -o β€” Only enable a community repository for every main repository already configured in /etc/apk/repositories. 🌈
  • -r β€” Add a random mirror from the mirror list, and do not prompt. 🎲
  • REPO... β€” Replace /etc/apk/repositories with the specified repository lines. πŸ“

big rules, bestie:

  • -o cannot be used with -c, -f, -r, or -1. 🚫
  • -f, -r, and -1 are mutually exclusive. πŸ’€

🌈 INTERACTIVE MODE 🌈

Without non-interactive options or explicit REPO arguments, the script prompts for a setup method. The prompt accepts:

  • f β€” Find and use the fastest mirror. ⚑
  • s β€” Show the mirror list. πŸ‘€
  • r β€” Use a random mirror. 🎲
  • e β€” Edit /etc/apk/repositories with EDITOR or vi. ✍️
  • c β€” Toggle whether generated mirror entries enable the community repository. πŸ”
  • skip β€” Exit without changing repositories. πŸšͺ
  • number β€” Add the numbered mirror from the mirror list. πŸ”’
  • URL or path β€” Add the specified repository URL or absolute path. πŸ”—

Adding c after answers such as f c or r c enables community repositories. periodt. πŸ’–


🧚 ENVIRONMENT 🧚

  • MIRRORS_URL β€” URL used to fetch the Alpine mirror list. The default is https://mirrors.alpinelinux.org/mirrors.txt. 🌐
  • MIRRORS β€” Whitespace-separated mirror list. If set, setup-apkrepos uses this list instead of fetching MIRRORS_URL. πŸ“‹
  • APKREPO_DEFAULT_ANSWER β€” Default answer used by the interactive prompt. πŸ’¬
  • EDITOR β€” Editor used by the interactive edit command. Defaults to vi. πŸ–ŠοΈ

⭐ EXIT STATUS ⭐

  • 0 β€” Success. πŸŽ‰
  • non-zero β€” An error occurred. 😭

πŸ“ FILES πŸ“

  • /etc/apk/repositories β€” apk repository configuration file. πŸ“
  • /etc/alpine-release β€” Alpine release file used to choose the repository release. 🏷️

πŸ”₯ SEE ALSO πŸ”₯

check out apk(8) and setup-alpine(8) β€” besties for sure. πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

shoutout to Natanael Copa <ncopa@alpinelinux.org> and others. 🫢


mwah πŸ’‹ source/version: Alpine Linux; date: 2026-06-09. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from