apt离线源配置
1、前提条件
nginx #apt install -y nginx
apt离线源:
ARM:http://58.49.120.2:56998/mirrors.aliyun.com.arm.tar.gz #大小120G
2、apt离线源服务端搭建
如文件:mirrors.aliyun.com.arm.tar.gz上传到服务器
tar zxvf mirrors.aliyun.com.arm.tar.gz -C /opt #时间非常久
mv /opt/mirrors.aliyun.com /opt/apt-mirrors #修改目录名
chmod 777 /opt/apt-mirrors #修改权限
配置nginx
sed -i 's#root .*;#root /opt/apt-mirrors;#' /etc/nginx/sites-enabled/default
systemct restart nginx #重启
systemct enable nginx #开机启动
3、apt客户端配置
清除代理配置
sed -i 's/^/#/g' /etc/apt/apt.conf
配置apt源
cat << EOF > /etc/apt/sources.list
deb http://mirrors.zenview.com/ubuntu-ports/ bionic main restricted universe multiverse
deb http://mirrors.zenview.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.zenview.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.zenview.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb http://mirrors.zenview.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
EOF
配置hosts
vi /etc/hosts
添加如下,200.100.128.18修改为apt服务端ip地址
200.100.128.18 mirrors.zenview.com
完成,可以更新源了
apt update
清华源地址
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/