制作本地/局域 apt 源
部署nginx
sudo apt install nginx
sudo rm -rf /etc/nginx/sites-enabled/default
vim /etc/nginx/sites-enabled/openstack-slushee.vhost
server {
listen 80;
server_name openstack-slushee;
# Logging
access_log /var/log/nginx/openstack-slushee.access.log;
error_log /var/log/nginx/openstack-slushee.error.log;
location / {
# 设置访问位置
root /home/kylin/repo/;
autoindex on;
expires 5h;
}
}
systemctl restart nginx
gpg --gen-key
制作源信息
mkdir ~/temp/pool
#将要上传的deb包放入pool中
cp *.deb ~/temp/pool
#需要apt-src包
cp apt-src ~/temp/
cd ~/temp
python apt-src/src/archive_man.py publish ./ -s v101 -a amd64
#此时在~/temp下生成dists文件夹,然后将pool和apt-src放在/home/kylin/repo/下
cp -r ~/temp/pool ~/temp/dists /home/kylin/repo/
此时在浏览器打开本地网址,就可以看见文件了。
添加源
sudo vim /etc/apt/sources.list
deb [trusted=yes] http://10.211.55.124 v101 main
sudo apt update
此时就可以通过sudo apt install
下载软件了。
参考链接:
https://www.cnblogs.com/silvermagic/p/7665841.html
https://blog.csdn.net/weixin_33976072/article/details/94163758