Debian install issue using apt repo: no Package: header

We build docker images using a debian/golang base. Today, quite suddenly, we started seeing an error:

E: Encountered a section with no Package: header
E: Problem with MergeList 

Nothing changed on our end, just suddenly stopped working. If I remove mongo from the apt commands (e.g. don’t echo the package header and call update), then the build works again.
It looks like something is broken with http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0/main amd64

Relevant docker build commands:

Step 14/29 : RUN apt-get update &&     apt-get install -y gnupg &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 35aa643018af
Step 15/29 : RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
 ---> Using cache
 ---> ef7827fd065f
Step 16/29 : RUN echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list
 ---> Using cache
 ---> 993cfc0ff19e
Step 17/29 : RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update &&     apt-get install -y         libpcre++-dev libc6 libssl1.1 libssl-dev         ca-certificates openssl         apt-transport-https         make gzip mongodb-org-tools git &&     rm -rf /var/lib/apt/lists/*
 ---> Running in 0ec47fbdb9e5
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:3 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 InRelease
Get:4 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [520 kB]
Get:8 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 Release [1492 B]
Get:9 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 Release.gpg [801 B]
Get:10 http://deb.debian.org/debian stretch-updates/main amd64 Packages [27.9 kB]
Get:11 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Get:12 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0/main amd64 Packages [12.4 kB]
Fetched 7951 kB in 3s (2127 kB/s)
Reading package lists...
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/repo.mongodb.org_apt_debian_dists_stretch_mongodb-org_4.0_main_binary-amd64_Packages.lz4
E: The package lists or status file could not be parsed or opened.
The command '/bin/sh -c rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update &&     apt-get install -y         libpcre++-dev libc6 libssl1.1 libssl-dev         ca-certificates openssl         apt-transport-https         make gzip mongodb-org-tools git &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
make[1]: *** [test-container] Error 100
make: *** [test-in-container] Error 2
2 Likes

Hi @TopherGopher, it looks like there were changes. The following path might help you find what you’re looking for: Index of binary-amd64. I unfortunately don’t have time to test to make sure it works however. :frowning:

Cool - so for anyone who’s having issues, I added this to my Dockerfile:

ADD http://repo.mongodb.org/apt/debian/dists/stretch/mongodb-org/4.0/main/binary-amd64/mongodb-org-tools_4.0.17_amd64.deb /tmp/mongodb-org-tools.deb
RUN dpkg -i /tmp/mongodb-org-tools.deb

You can just curl/wget http://repo.mongodb.org/apt/debian/dists/stretch/mongodb-org/4.0/main/binary-amd64/mongodb-org-tools_4.0.17_amd64.deb (that’s what ADD is)

I don’t know what’s up with the actual package cache, but hopefully someone is on it.

1 Like

@TopherGopher There was a packaging problem with the latest 4.0.x release for Debian, but this should be resolved now.

Relevant tracking issue: SERVER-46938: mongodb-org debian repo has malformed Packages file.

Regards,
Stennie

Seems that they have close the Issue in the tracker
but the problem still exists
running:
echo “deb [ arch=amd64,arm64 ] MongoDB Repositories xenial/mongodb-org/4.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
produces
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/repo.mongodb.org_apt_ubuntu_dists_xenial_mongodb-org_4.0_multiverse_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.