Score:2

Lot of dpkg package missing, but I can't reinstall them

de flag

I had a problem with python-debian package with Lubuntu 18.04 and I reinstalled it. After that I get a lot of:

dpkg: warning: files list file for package 'PACKAGE' missing; assuming package has no files currently installed

I reinstalled a lot of them with apt-get install --reinstall PACKAGE1 PACKAGE2 etc, but a bunch of them I can't reinstall:

Reinstallation of PACKAGE is not possible, it cannot be downloaded.

I think it's because these packages are old or manually installed from source (as llvm-10). These packages are anyway installed and working.

How can I get rid of these annoying warnings?

EDIT

Currently, GChuf's answer worked, but I still have the warnings for these packages:

libarchive13:amd64
libnm0:amd64
python3-zope.interface
network-manager

and they depends from packages I don't have the bravery to pass to dpkg -r

guiverc avatar
cn flag
FYI: Lubuntu 18.04 LTS is no longer supported; refer https://lubuntu.me/bionic-eol/ or https://fridge.ubuntu.com/2020/08/14/ubuntu-18-04-5-lts-released/ where you'll note only Ubuntu Server, Ubuntu Desktop & Ubuntu Cloud come with 5 years of support; *flavors* had shorter lives. I'd suggest using `ubuntu-support-status` to assess the security status of your actual install. Your question is still on-topic here, but consider how much security matters to you and the results of prior command. You're now using Ubuntu 18.04 LTS with LXDE (*not Lubuntu*).
Marco Sulla avatar
de flag
@guiverc *"Lubuntu 18.04 LTS is no longer supported"* I quite know :)
GChuf avatar
in flag
How did you reinstall the packages?
Marco Sulla avatar
de flag
@GChuf I reinstalled the packages with `apt-get install --reinstall PACKAGE1 PACKAGE2 etc`. This did not work with the packages I'm asking help
GChuf avatar
in flag
Just to be clear, what is the actual thing you want to solve? Successfully reinstall all missing packages, or get rid of dpkg warnings?
Marco Sulla avatar
de flag
@GChuf Get rid of the warnings.
Score:2
in flag

TL;DR

dpkg -r PACKAGE1 PACKAGE2 PACKAGE3 ...

Short explaination:

dpkg -r removes an installed package without removing the config files.

In this case, dpkg -r did not perform a real "uninstall", since the packages were not installed through dpkg or apt.

It simply removed some leftover files or entries on Marco's PC - I wasn't able to find the information on where these entries could be stored other than under "/var/lib/dpkg/info".

There may be other explainations possible, and I don't know how exactly this situation would happen in the first place.


Not sure if any of these will help you, but it's worth a try.

Check if dpkg sees the packages:

dpkg -l '*python3.5*'

mark to remove:

dpkg-remove PACKAGE_NAME
apt-update

remove or purge through dpkg:

dpkg -r python3.5
dpkg -P python3.5

Double check if there are any files in /var/lib/dpkg/info

ls -al /var/lib/dpkg/info/ | grep python3

Clean packages thorugh apt-get:

sudo apt-get autoclean

sudo apt-get autoremove

sudo apt-get clean

I've also come across this bash script: https://github.com/epinna/Unusedpkg

If anything happened, reboot the PC afterwards.


EDIT

I can find all of these 4 packages through apt on ubuntu 20:

libarchive13:amd64
libnm0:amd64
python3-zope.interface
network-manager

I suggest you simply try to reinstall these 4.

Marco Sulla avatar
de flag
`dpkg -r` worked. It left only some packages, I'll remove the warnings for them with relax :)
GChuf avatar
in flag
I'm glad! I accepted your edit as well.
GChuf avatar
in flag
P.S. if the bounty is still available, I'd gladly accept it, thank you!
Someone avatar
my flag
Great! Could you please explain why or how the `dpkg -r` removed the warnings; and would be appreciated if you include why the error message generate in the first place... It would attract votes and add content to your answer making it more trustable.
Marco Sulla avatar
de flag
I'll second @AlwaysAvailable . What I found surprising is that it seemed to remove only the warning, without uninstalling any package (I tested it first with python3.5, to be safe)
GChuf avatar
in flag
Added a short explaination which might be lacking a little bit - if anyone knows more than I do about this, feel free to make an edit. I've also checked the 4 packages that still output a warning for you and updated the answer.
Someone avatar
my flag
Worth noticing, that the post installation scripts and the pre installation scripts along with the lists files of the packages are stored in `var/lib/dpkg/info`; since those files were missing, dpkg threw warnings related to the same (surprisingly, someone or some packages had manually removed those files); `dpkg -r` or even better `dpkg -P` just completely remove the package, so no installation candidate is sustained, so dpkg just assumes that those packages were never installed and stopped the warnings. Also, the packages are crucial and I suggest @MarcoSulla to reinstall them.
Marco Sulla avatar
de flag
@AlwaysAvailable thank you for the explaining. About reinstalling them, I suppose they are already installed. For example, python3.5 is available, even after `dpkg -r python3.5`. I suppose they were simply not listed as installed after the reinstalling of `python-debian`, since these packages are no more available in the Ubuntu repo.
Score:-1
cn flag

Try clean the dpkg package list cache using commands:

    sudo dpkg --clear-avail
    sudo apt-get update

If the warning messages persist, try remove the package's files list manually like this:

    sudo rm /var/lib/dpkg/info/<PACKAGE>.list
Marco Sulla avatar
de flag
`--clear-avail` did not worked, and there's no file for problematic packages in `/var/lib/dpkg/info/`
Efi Jeremiah avatar
cn flag
what do you get when try reinstall? upgrade the package?
Marco Sulla avatar
de flag
I can't reinstall because they are no more present in the repository (there's python3.5 for example). I could remove them, but they are not listed by autoremove and I do not want to mess up things (more than that...)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.