ubuntu2310制作离线源

ubuntu2310制作openstack离线源

2310清华源

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
root@controller:~# cd /var/cache/apt/archives
root@controller:/var/cache/apt/archives# rm -rf ./*

apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances 软件包名 | grep “^\w” | sort -u)

apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances sshpass python3-openstackclient mariadb-server python3-pymysql rabbitmq-server memcached python3-memcache keystone glance placement-api nova-api nova-conductor nova-novncproxy nova-scheduler nova-compute neutron-server neutron-plugin-ml2  neutron-l3-agent neutron-dhcp-agent  neutron-metadata-agent neutron-openvswitch-agent openstack-dashboard | grep "^\w" | sort -u)

–no-enhances:后面跟下载所需的软件包

拷贝软件包

root@controller:/var/cache/apt/archives# mkdir -p /opt/openstackpkg/debs/
root@controller:/var/cache/apt/archives# touch /opt/openstackpkg/debs/Packages.gz
root@controller:/var/cache/apt/archives# chmod 777 -R /opt/openstackpkg
root@controller:/var/cache/apt/archives# cp -r /var/cache/apt/archives/* /opt/openstackpkg/

构建依赖环境

root@controller:/var/cache/apt/archives# apt install dpkg-dev -y
root@controller:/var/cache/apt/archives# dpkg-scanpackages /opt/openstackpkg /dev/null | gzip > /opt/openstackpkg/debs/Packages.gz

打包离线源

root@controller:/opt# tar zcvf openstackpkg-B.tar.gz openstackpkg/

验证

root@controller:~# cp /etc/apt/sources.list{,.bak}
cat > /etc/apt/sources.list << EOF
deb [trusted=yes] file:// /opt/openstackpkg/debs/
EOF
root@controller:~# apt update
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huhy~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值