How to create a fresh package list?

I am trying to figure out how to delete the current package list that apt uses and generate a new one. So far, I cannot find this information in the “Debian Administrator’s Guide” or by searching.

‘apt update’ and ‘apt clean’ do not help with my problem.


I want to install a package that still uses python-libxml2. Unfortunately, the python-libxml2 version shown by apt and the one in the amber repository have different version numbers. apt shows ‘2.9.4+dfsg1-7+b3’; the repository has ‘2.9.4+dfsg1-7+deb10u1’. The actual version numbers, 2.9.4, match, but ‘apt update’ does not synchronize the version “suffixes.”

When I try ‘apt install python-libxml2’, I get the following error:

Err:1 amber/main amd64 python-libxml2 amd64 2.9.4+dfsg1-7+b3
  404  Not Found [IP: 443]

My thought is that ‘apt update’ is not doing what I expect, so I want to start with a fresh list of packages. I have not found a command to do this. I think that this information is in /var/apt/cache/pkgcache.bin, but I really do not want to go around mv-ing files without being certain I am not going to cause myself more problems.

FYI, my bug on what I thought was simply a missing file is here.

My sources.list is:

deb amber main
deb-src amber main #Added by software-properties

deb amber-security main
deb amber-updates main

Thanks for suggestions.

apt update should do it. I’ve never had any problems with apt stubbornly sticking to stale cache data in all my time running debian (15+ years :slight_smile: )
What does apt policy python-libxml2 say? on my machine, with the same sources.lists I get this:

# apt policy python-libxml2
Installed: (none)
Candidate: 2.9.4+dfsg1-7+deb10u1
Version table:
2.9.4+dfsg1-7+deb10u1 800
800 amber/main amd64 Packages

And the python-libxml2 package installs without a hitch. I guess there was some temporary problem in the purism repo itself. If it apt update still does not solve your problem, you may remove everything from /var/lib/apt/lists

Thanks for responding. Simply doing ‘apt update’ would not work.

I was finally able to make this work by erasing repo.puri.sm_pureos_dists_amber_main_binary-amd64_Packages in /var/lib/apt/lists and then doing an update. It seems to have gotten stuck somehow.

(Sorry, I meant to add that I figured out this was the right thing to do before I saw your post. You were spot on, though. Turns out I had a bunch of updates I did not know about due to this issue.)