ubuntu配置本地apt仓库

发行信息

Version Code name Docs Release End of Standard Support End of Life
Ubuntu 22.04.1 LTS Jammy Jellyfish Release Notes August 11, 2022 April 2027 April 2032
Ubuntu 22.04 LTS Jammy Jellyfish Release Notes April 21, 2022 April 2027 April 2032
Ubuntu 20.04.5 LTS Focal Fossa Changes September 1, 2022 April 2025 April 2030
Ubuntu 20.04.4 LTS Focal Fossa Changes February 24, 2022 April 2025 April 2030
Ubuntu 20.04.3 LTS Focal Fossa Changes August 26, 2021 April 2025 April 2030
Ubuntu 20.04.2 LTS Focal Fossa Changes February 4, 2021 April 2025 April 2030
Ubuntu 20.04.1 LTS Focal Fossa Changes August 6, 2020 April 2025 April 2030
Ubuntu 20.04 LTS Focal Fossa Release Notes April 23, 2020 April 2025 April 2030
Ubuntu 18.04.6 LTS Bionic Beaver Changes September 17.2021 April 2023 April 2028
Ubuntu 18.04.5 LTS Bionic Beaver Changes August 13, 2020 April 2023 April 2028
Ubuntu 18.04.4 LTS Bionic Beaver Changes February 12, 2020 April 2023 April 2028
Ubuntu 18.04.3 LTS Bionic Beaver Changes August 8, 2019 April 2023 April 2028
Ubuntu 18.04.2 LTS Bionic Beaver Changes February 15, 2019 April 2023 April 2028
Ubuntu 18.04.1 LTS Bionic Beaver Changes July 26, 2018 April 2023 April 2028
Ubuntu 18.04 LTS Bionic Beaver Release Notes April 26, 2018 April 2023 April 2028
Ubuntu 16.04.7 LTS Xenial Xerus Changes August 13, 2020 April 2021 April 2026
Ubuntu 16.04.6 LTS Xenial Xerus Changes February 28, 2019 April 2021 April 2026
Ubuntu 16.04.5 LTS Xenial Xerus Changes August 2, 2018 April 2021 April 2026
Ubuntu 16.04.4 LTS Xenial Xerus Changes March 1, 2018 April 2021 April 2026
Ubuntu 16.04.3 LTS Xenial Xerus Changes August 3, 2017 April 2021 April 2026
Ubuntu 16.04.2 LTS Xenial Xerus Changes February 16, 2017 April 2021 April 2026
Ubuntu 16.04.1 LTS Xenial Xerus Changes July 21, 2016 April 2021 April 2026
Ubuntu 16.04 LTS Xenial Xerus Release Notes April 21, 2016 April 2021 April 2026
Ubuntu 14.04.6 LTS Trusty Tahr Changes March 7, 2019 April 2019 April 2024
Ubuntu 14.04.5 LTS Trusty Tahr Changes August 4, 2016 April 2019 April 2024
Ubuntu 14.04.4 LTS Trusty Tahr Changes February 18, 2016 HWE August 2016 April 2024
Ubuntu 14.04.3 LTS Trusty Tahr Changes August 6, 2015 HWE August 2016 April 2024
Ubuntu 14.04.2 LTS Trusty Tahr Changes February 20, 2015 HWE August 2016 April 2024
Ubuntu 14.04.1 LTS Trusty Tahr Changes July 24, 2014 April 2019 April 2024
Ubuntu 14.04 LTS Trusty Tahr Release Notes April 17, 2014 April 2019 April 2024

apt-mirror

  • 作用:同步工具

  • 安装:apt install apt-mirror -y

  • 安装完成后,会生成文件 /etc/apt/mirror.list,最好备份一份

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  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb http://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

自用ubuntu1804使用的配置:

  • 请确认默认的base_path空间足够,否则请更换路径

  • 增加arch字段,这样下载的包更全,如有需要,可再添加arm64,用以下载arm包,对应的地址也需要修改为http://archive.ubuntu.com/ubuntu-ports/

  • 默认使用官方源,使用nload命令可以查看网速,如果速度慢的话可以尝试替换为下方国内源。建议还是使用官方源,实测即使换成国内源将线程改大,

    下载速度依然是20MB左右,且国内源会报一些错误

    mirrors.tuna.tsinghua.edu.cn

    mirrors.ustc.edu.cn

############# 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  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
deb [arch=i386] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb [arch=i386] http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=i386] http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse


deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
deb-src [arch=i386] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb-src [arch=i386] http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src [arch=i386] http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse


clean http://archive.ubuntu.com/ubuntu

开始同步

使用screen命令,开启会话,放至中断,然后执行apt-mirror即可,大概需要300GB左右的数据

客户端配置

  • 根据自己的下载路径,替换file:///root/mirror/archive.ubuntu.com/ubuntu
deb [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb-src [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic main restricted universe multiverse

deb [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse

deb [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
deb-src [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse

deb [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
deb-src [arch=amd64] file:///root/mirror/archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
posted @ 2022-10-12 17:01  秒年度  阅读(1080)  评论(0编辑  收藏  举报