

HPEの物理サーバにUbuntu 22.04をインストールして、サーバはオフラインで運用しています。  
オフライン環境のため、パッケージのインストールができず、事前にパッケージのdebファイルをtarで固めて置いておくことになっています。（以下のファイル全て）  
上記のパッケージファイルを一個一個ダウンロードしていると気が遠くなる作業なので、Ubuntu/Debian ではパッケージリポジトリをミラーリングする
apt-mirrorコマンドを使用しようと思っています。  
<https://ja.linux-console.net/?p=1392#gsc.tab=0>

apt-mirror を実行してみたのですが以下のエラーが表示され上手くいきません。  
何かご存知であればご教示いただけると助かります。  
設定値はデフォルトで変更してません。（強調表記になるみたいなので#の数を増やしたり、リンクにならないようにhttpのhを削除しています。）

エラー内容

[code]

    root@testserver:~# apt-mirror
    Downloading 162 index files using 20 threads...
    Begin time: Fri Jan 6 06:59:43 2023
    [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
    End time: Fri Jan 6 07:08:36 2023
    
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 507.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 507.
    Processing translation indexes: [TTT]
    
    Downloading 0 translation files using 0 threads...
    Begin time: Fri Jan 6 07:08:36 2023
    [0]...
    End time: Fri Jan 6 07:08:36 2023
    
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-security/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 653.
    Failed to open Release file from ttp://archive.ubuntu.com/ubuntu/dists/artful-updates/Release at /usr/bin/apt-mirror line 653.
    Processing DEP-11 indexes: [DDD]
    
    Downloading 0 dep11 files using 0 threads...
    Begin time: Fri Jan 6 07:08:36 2023
    [0]...
    End time: Fri Jan 6 07:08:36 2023
    
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/main/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/restricted/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/universe/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/multiverse/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/main/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/restricted/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/universe/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/multiverse/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/main/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/restricted/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/universe/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/multiverse/source/Sources in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/main/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/restricted/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/universe/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful/multiverse/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/main/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/restricted/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/universe/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-security/multiverse/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/main/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/restricted/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/universe/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/artful-updates/multiverse/binary-amd64/Packages in process_index at /usr/bin/apt-mirror line 800.
    Processing indexes: [SSSPPP]
    
    0 bytes will be downloaded into archive.
    Downloading 0 archive files using 0 threads...
    Begin time: Fri Jan 6 07:08:36 2023
    [0]...
    End time: Fri Jan 6 07:08:36 2023
    
    0 bytes in 0 files and 0 directories can be freed.
    Run /var/spool/apt-mirror/var/clean.sh for this purpose.
    
    Running the Post Mirror script ...
    (/var/spool/apt-mirror/var/postmirror.sh)
    
    Post Mirror script has completed. See above output for any possible errors.
    
[/code]

設定

[code]

    root@testserver:~# cat /etc/apt/mirror.list
    ############# config ##################
    
    ####### set base_path /var/spool/apt-mirror
    
    ####### set mirror_path $base_path/mirror
    ####### set skel_path $base_path/skel
    ####### set var_path $base_path/var
    ####### set cleanscript $var_path/clean.sh
    ####### set defaultarch
    ####### set postmirror_script $var_path/postmirror.sh
    ####### set run_postmirror 0
    set nthreads 20
    set _tilde 0
    
    ############# end config ##############
    
    deb ttp://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
    deb ttp://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
    deb ttp://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
    #deb ttp://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
    #deb ttp://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
    
    deb-src ttp://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
    deb-src ttp://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
    deb-src ttp://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
    #deb-src ttp://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
    #deb-src ttp://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
    
    clean ttp://archive.ubuntu.com/ubuntu
    
    root@testserver:~# cat /etc/apt/sources.list
    ####### See ttp://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    ####### newer versions of the distribution.
    deb ttp://jp.archive.ubuntu.com/ubuntu jammy main restricted
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy main restricted
    
    ######## Major bug fix updates produced after the final release of the
    ######## distribution.
    deb ttp://jp.archive.ubuntu.com/ubuntu jammy-updates main restricted
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-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 ttp://jp.archive.ubuntu.com/ubuntu jammy universe
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy universe
    deb ttp://jp.archive.ubuntu.com/ubuntu jammy-updates universe
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-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 ttp://jp.archive.ubuntu.com/ubuntu jammy multiverse
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy multiverse
    deb ttp://jp.archive.ubuntu.com/ubuntu jammy-updates multiverse
    ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-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 ttp://jp.archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse deb ttp://jp.archive.ubuntu.com/ubuntu jammy-security main restricted ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-security main restricted deb ttp://jp.archive.ubuntu.com/ubuntu jammy-security universe ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-security universe deb ttp://jp.archive.ubuntu.com/ubuntu jammy-security multiverse ####### deb-src ttp://jp.archive.ubuntu.com/ubuntu jammy-security multiverse
    root@testserver:~# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    loop0 7:0 0 79.9M 1 loop /snap/lxd/22923
    loop1 7:1 0 62M 1 loop /snap/core20/1587
    loop3 7:3 0 49.6M 1 loop /snap/snapd/17883
    loop4 7:4 0 63.3M 1 loop /snap/core20/1778
    loop5 7:5 0 103M 1 loop /snap/lxd/23541
    sda 8:0 0 430.1G 0 disk
    tqsda1 8:1 0 1M 0 part
    tqsda2 8:2 0 2G 0 part /boot
    mqsda3 8:3 0 428.1G 0 part
    mqubuntu--vg-ubuntu--lv 253:0 0 100G 0 lvm /
    sr0 11:0 1 1024M 0 rom
    
[/code]


CC BY-SA 4.0
2023-01-10T03:39:10.387
93279
2023-01-11T11:58:29.690
2023-01-11T11:58:29.690
19110
56275
question
ubuntu apt
apt-mirrorコマンドが上手くいきません


前提知識として、Ubuntu/Debian ではパッケージを取得する際、OS バージョンに対応したコードネームを使用します。

あなたが使用している Ubuntu 22.04 の場合、`/etc/apt/sources.list` の中に記載されている "jammy"
がコードネームになります。

[code]

    deb http://jp.archive.ubuntu.com/ubuntu jammy main restricted
    
[/code]

* * *

さて、apt-mirror の設定ファイル (`/etc/apt/mirror.list`) で初期設定では "artful"
となっており、これに対応するのは Ubuntu 17.10
になります。とても古いバージョンなのでミラーサイトにもファイルが見つからずにダウンロードエラーになっている状態なのだと思われます。

[code]

    deb http://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
                                         ~~~~~~
    
[/code]

まずは最低限、こちらを自分が使用しているバージョンのコードネームに書き換える必要があります。

**書き換え例:**

[code]

    deb http://archive.ubuntu.com/ubuntu jemmy main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu jemmy-security main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu jemmy-updates main restricted universe multiverse
    #deb http://archive.ubuntu.com/ubuntu jemmy-proposed main restricted universe multiverse
    #deb http://archive.ubuntu.com/ubuntu jemmy-backports main restricted universe multiverse
    
[/code]

**参考:** (OSバージョンは異なるので適時読み替えてください)  
[apt-mirrorの設定 | Ubuntu20.04
ローカルにアーカイブミラーを立ててみる](https://rohhie.net/ubuntu20-04-try-to-set-up-a-local-
archive-mirror/#Build-ConfigureAptMirror)


CC BY-SA 4.0
2023-01-10T05:21:23.990
93280
2023-01-10T05:21:23.990
3060
93279
answer