我在 Nginx 托管的服务器(server1)上设置了本地存储库。它有几个.deb
软件包,另一个本地服务器(服务器 2)上的 bash 脚本使用存储库来安装软件包。我必须更改包内的文件,因此我提取了该包并在文件名以及包内的控制文件中使用新版本号 (1.3-0-0) 重建它。 bash 脚本仍在寻找特定版本 (1.2-0-0) 的旧软件包,而不安装新软件包。
在服务器 1 上,软件包位于/var/www/folder1/repo
并且 Nginx 访问日志显示服务器 2 bash 脚本正在从存储库请求软件包,并且我看到它正在请求旧版本。
在托管包的服务器 1 上,如果我直接在浏览器中输入指向新包和旧包的 URL,则两个包都会直接下载。
localrepository.list
中的内容/etc/apt/sources.list.d
是:
deb [trusted=yes] http://server_hostname/ repo folder1
安装软件包的脚本部分:
for package in xml-service update-legacy server-scripts; do
apt-get update
apt-get install -y $package
done
server-scripts
未安装我修改过的软件包。主要问题是为什么它要求旧包server-scripts 1.2-0-0
。我将旧包移到了 repo 文件夹之外。应该是要求的server-scripts 1.3-0-0
。
从日志来看,它正在安装第一个包,如下所示:
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
xml-service
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 453 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://server_hostname repo/folder1 amd64 xml-service all **0.94.3-2** [453 kB]
Fetched 453 kB in 0s (6,008 kB/s)
Selecting previously unselected package xml-service.
Selecting previously unselected package xml-service.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 72356 files and directories currently installed.)
Preparing to unpack .../xml-service_0.94.3-2_all.deb ...
Unpacking xml-service (0.94.3-2) ...
Setting up xml-service (0.94.3-2) ...
现在,当谈到我修改的包时:我目前没有完整的错误日志,但它是这样的:
Error: server-scripts 1.2-0-0 cannot be found
我不知道是否发生任何缓存,如果是的话,我不知道它在哪里。