0

I have a local repository setup on the server (server1) hosted by Nginx. It has few .deb packages and a bash script on another local server (server 2) uses the repo to install packages. I had to change a file inside a package, so I extracted the package and rebuilt it with a new version number (1.3-0-0) in the filename as well as in the control file inside the package. The bash script is still looking for the old package with specific version (1.2-0-0) and not installing the new package.

On server 1 the packages are in /var/www/folder1/repo and Nginx access logs show that server 2 bash script is requesting the the packages from the repository and I see it's requesting the old version.

On the server 1 where the packages are hosted, if I directly enter the URL pointing to the new and old packages in browser, both packages are being downloaded directly.

The contents of localrepository.list in /etc/apt/sources.list.d are:

deb [trusted=yes] http://server_hostname/ repo folder1

The script part where the packages are installed:

for package in xml-service update-legacy server-scripts; do
            apt-get update
            apt-get install -y $package
        done

server-scripts package is not being installed which is the one I modified. The main question is as to why it's asking for the old package server-scripts 1.2-0-0. I moved the old package outside the repo folder. It should be asking for server-scripts 1.3-0-0.

From the logs, it's installing the first package like this:

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) ...

Now when it comes to the package I modified: I don't full error logs at the moment but it's something like this:

Error: server-scripts 1.2-0-0 cannot be found

I don't if any caching is happening and if so, I can't figure it out where.

Cruise5
  • 456
  • 3
  • 17
  • Did you regenerate the package index on the server? – Stephen Kitt Aug 20 '22 at 19:06
  • Regenerate the package index on the server1 hosting the repo? How can I do that? – Cruise5 Aug 20 '22 at 19:49
  • What tools did you use to create your repository? Here’s [an example using `apt-ftparchive`](https://unix.stackexchange.com/q/403485/86440) but you should use whatever you used for your initial setup. – Stephen Kitt Aug 20 '22 at 20:54
  • Honestly I don’t know what tools were used, I have inherited this. I don’t think apt-ftparchive was used. There is no .conf file or a database file. There are like only 4 packages inside the repo. – Cruise5 Aug 20 '22 at 22:40
  • I did find a Packages.gz file and using `zcat` on it, I can see the the old version mentioned there. The output has line called `Filename: repo/ server-scripts_1.2-0-0.deb` The Packages.gz file is not in the repo directory so I am not sure how apt-get reads it? – Cruise5 Aug 21 '22 at 16:08
  • With a `sources.list` entry saying `deb [trusted=yes] http://server_hostname/ repo folder1` I would expect to find a `Packages` file in `http://server_hostname/dists/repo/folder1/binary-amd64` or something like that. Is that not the case? – Stephen Kitt Aug 21 '22 at 16:32
  • Yes. It's exactly located in `/dists/repo/folder1/binary-amd64`. So I have to recreate the Packages file? I searched the packages installed and `reprepro` and `dpkg-dev` are installed. How would recreate the Packages file? I thought the file should be where the packages are located. – Cruise5 Aug 21 '22 at 17:05

0 Answers0