pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.43k stars 84 forks source link

PackageKit removing Contents files #2639

Open defhacks opened 1 year ago

defhacks commented 1 year ago

Distribution (run cat /etc/os-release):

NAME="Pop!_OS" VERSION="22.04 LTS" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 22.04 LTS" VERSION_ID="22.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=jammy UBUNTU_CODENAME=jammy LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

packagekit: Installed: 1.2.5-2ubuntu2 Candidate: 1.2.5-2ubuntu2 Version table: *** 1.2.5-2ubuntu2 500 500 http://apt.pop-os.org/ubuntu jammy/main amd64 Packages 100 /var/lib/dpkg/status

Issue/Bug Description:

Packagekit removing Contents files needed by apt-file(1)

Steps to reproduce (if you know):

Contrast (lack of) output of

apt-file update
sleep 60
ls /var/lib/apt/lists/*Contents*

versus running

apt-file update
ls /var/lib/apt/lists/*Contents*

Expected behavior:

$ apt-file search linux/types.h
backport-iwlwifi-dkms: /usr/src/backport-iwlwifi-9858/backport-include/linux/types.h
dietlibc-dev: /usr/include/diet/linux/types.h
elks-libc: /usr/lib/bcc/include/linux/types.h
linux-allwinner-5.17-headers-5.17.0-1002: /usr/src/linux-allwinner-5.17-headers-5.17.0-1002/include/linux/types.h

Other Notes:

Using eBPF, I was able to find the removal caused by unlinkat(2) calls originating from a process with the name of PK-Backend

Tested Ubuntu 22.04 install on a VM to see if this is something originating upstream and confirmed that the issue only happens on Pop_OS!.

mmstick commented 1 year ago

Did you find out the binary path of that process? Does it happen if you uninstall the pop-shop?

defhacks commented 1 year ago

I could not find a binary with that name, but traced it to packagekit via https://github.com/PackageKit/PackageKit/blob/main/src/pk-backend-job.c#L771 .

Interesting, removing pop-shop stops the removal. Re-installing pop-shop doesn't seem to cause the removal behaviour to reappear either, even after a reboot.