一、创建本地源
1、apt-get install dpkg-dev (先把dpkg-scanpackages命令装上)
2、cd /data/mysql
mkdir /data/mysql/pools (软件包存放的物理地址,要先把所有的软件包放进来)
mkdir -p /data/mysql/dists/sid/main/binary-amd64
3、ls -1 pools | sed 's/_.*$/ extra BOGUS/' | uniq > override (把pools目录下所有的deb包包名写入文件override中)
4、dpkg-scanpackages pools override > dists/sid/main/binary-amd64/Packages (把所有包的包名、版本号、依赖关系等信息写入文件Packages中)
[Debian stretch版本中要把Packages文件变成Packages.gz文件]
5、vi /data/mysql/dists/sid/main/Release (此处因人而异)
输入:
Archive: sid
Version: mysql
Component: main
Origin: Local
Label: Local
Architecture: amd64
6、
echo "deb file:///data/mysql/ sid main" >> /etc/apt/sources.list
7、apt-get update