Ubuntu20.10で作るラズパイUbuntu20.10用ミラーサーバ

#前書き

ミラーサーバはPCで動くUbuntu20.10で動作しました。
基本は↓の通りです。
「Ubuntu20.10でapt-mirrorに失敗する為debmirrorを使うことにする」
https://qiita.com/t-yamanashi/items/362ef78b5b7c33bee36b


#上記差分
PC用との差分を書きます。

##mirrorbuild.shを変更
Ubuntu20.10の日本語環境に動作する設定に変更します。
変更箇所は４箇所

```
arch=amd64 →　#arch=amd64
arch=arm64,armhf         を追加

release=bionic,bionic-security,bionic-updates,bionic-backports
↓
release=focal,focal-security,focal-updates,focal-backports

inPath=/ubuntu
↓
inPath=/ubuntu-ports

outPath=/mirror/mirror/$server/ubuntu
↓
outPath=/mirror/mirror/$server/ubuntu-ports

debmirrorの引数に--i18n を追加
```

変更後のファイル

```
#### Start script to automate building of Ubuntu mirror #####
## THE NEXT LINE IS NEEDED THE REST OF THE LINES STARTING WITH A # CAN BE DELETED

#!/bin/bash

## Setting variables with explanations.

#
# Don't touch the user's keyring, have our own instead
#
export GNUPGHOME=/mirrorkeyring

# Arch=         -a      # Architecture. For Ubuntu can be i386, powerpc or amd64.
# sparc, only starts in dapper, it is only the later models of sparc.
#
#arch=amd64
arch=arm64,armhf

# Minimum Ubuntu system requires main, restricted
# Section=      -s      # Section (One of the following - main/restricted/universe/multiverse).
# You can add extra file with $Section/debian-installer. ex: main/debian-installer,universe/debian-installer,multiverse/debian-installer,restricted/debian-installer
#
section=main,restricted,universe,multiverse

# Release=      -d      # Release of the system (...Hardy, Intrepid... Lucid, Precise, Quantal, Saucy, Trusty ), and the -updates and -security ( -backports can be added if desired)
# List of updated releases in: https://wiki.ubuntu.com/Releases
#

release=groovy,groovy-security,groovy-updates,groovy-backports

# Server=       -h      # Server name, minus the protocol and the path at the end
# CHANGE "*" to equal the mirror you want to create your mirror from. au. in Australia  ca. in Canada.
# This can be found in your own /etc/apt/sources.list file, assuming you have Ubuntu installed.
#
server=ports.ubuntu.com

# Dir=          -r      # Path from the main server, so http://my.web.server/$dir, Server dependant
#
inPath=/ubuntu-ports

# Proto=        --method=       # Protocol to use for transfer (http, ftp, hftp, rsync)
# Choose one - http is most usual the service, and the service must be available on the server you point at.
#
proto=http

# Outpath=              # Directory to store the mirror in
# Make this a full path to where you want to mirror the material.
#
outPath=/mirror/mirror/$server/ubuntu-ports

# The --nosource option only downloads debs and not deb-src's
# The --progress option shows files as they are downloaded
# --source \ in the place of --no-source \ if you want sources also.
# --nocleanup  Do not clean up the local mirror after mirroring is complete. Use this option to keep older repository
# Start script
#
debmirror       -a $arch \
                --no-source \
                -s $section \
                -h $server \
                -d $release \
                -r $inPath \
                --progress \
                --method=$proto \
		--i18n \
                $outPath

#### End script to automate building of Ubuntu mirror ####
```

##クライアントの設定差分

###/etc/apt/sources.listを管理者権限で変更
deb http://から始まるURLを
http://apt:8080/ports.ubuntu.com/ubuntu-ports/
に置き換えます。

```
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy main restricted
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates main restricted
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy universe
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy universe
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates universe
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy multiverse
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy multiverse
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates multiverse
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-backports main restricted universe multiverse
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu groovy partner
# deb-src http://archive.canonical.com/ubuntu groovy partner

deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security main restricted
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security main restricted
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security universe
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security universe
deb http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security multiverse
# deb-src http://apt:8080/ports.ubuntu.com/ubuntu-ports/ groovy-security multiverse

```