Could not refresh list of updates--Your APT cache is corrupted

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ablebaker
Level 3
Level 3
Posts: 145
Joined: Mon Jun 05, 2017 1:14 pm

Could not refresh list of updates--Your APT cache is corrupted

Post by ablebaker »

This morning Update Manager showed two new updates available so I tried to install them, but got a message saying something like "switch respositories." I tried to do that, then got the message shown by the screenshot below:

[img]file:///home/linuxuser/Desktop/Screenshot%20from%202019-02-18%2007-12-41.png[/img]

Please note that the message has a dire warning of "Do not install or update anything. It could break your operating system." It says to "click OK" to solve the problem, but no OK button is present. What to do?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
philotux

Re: Could not refresh list of updates--Your APT cache is corrupted

Post by philotux »

ablebaker wrote: Mon Feb 18, 2019 11:43 am ... got a message saying something like "switch respositories." I tried to do that, then got the message shown by the screenshot below:
[img]file:///home/linuxuser/Desktop/Screenshot%20from%202019-02-18%2007-12-41.png[/img]
Your screenshot can not be seen. Please use > Attachments > Add files > Place inline from below the edit box to upload it to your post.


Have you already tried launching Software Sources, restoring the mirrors to default and refreshing the cache from the top bar? If this hasn't solved the issue, try the following (copy, paste and run in a terminal):

Code: Select all

sudo apt clean
and

Code: Select all

sudo rm -rfv /var/lib/apt/list/*
Next run

Code: Select all

sudo apt update
If still no go, please post the output of the update command plus the output from

Code: Select all

inxi -r
for forum members to have a look.
ablebaker
Level 3
Level 3
Posts: 145
Joined: Mon Jun 05, 2017 1:14 pm

Re: Could not refresh list of updates--Your APT cache is corrupted

Post by ablebaker »

Thank you, philotux, for your reply. The image I tried to upload doesn't appear as being available when I use the Forum's Attachments > Add files window. Maybe I should start another thread to address this problem?

Anyway, the Update Manager warning message has disappeared without any intervention on my part and now shows the system is up to date!

The log from Update Manager > View > Information is offered for any insights it may provide.

Code: Select all

02.18@06:15 ++ Starting refresh (including refreshing the APT cache) 
02.18@06:16 ++ Found 2 software updates 
02.18@06:16 ++ Refresh finished 
02.18@06:58 ++ Install requested by user 
02.18@06:58 ++ Will install libcogl20 
02.18@06:58 ++ Will install libcogl-path20 
02.18@06:58 ++ Will install libcogl-common 
02.18@06:58 ++ Will install libcogl-pango20 
02.18@06:58 ++ Will install gir1.2-cogl-1.0 
02.18@06:58 ++ Will install gir1.2-coglpango-1.0 
02.18@06:58 ++ Will install libvulkan1 
02.18@06:59 ++ Ready to launch synaptic 

(synaptic:15262): Gtk-CRITICAL **: 06:59:08.901: gtk_widget_hide: assertion 'GTK_IS_WIDGET (widget)' failed
02.18@06:59 ++ Return code:0 
02.18@06:59 ++ Install finished 
02.18@06:59 ++ Starting refresh 
02.18@06:59 ++ Error: The APT policy is incorrect! 
02.18@08:15 ++ MintUpdate is in tray mode, performing auto-refresh 
02.18@08:15 ++ Starting refresh (including refreshing the APT cache) 
02.18@08:15 ++ Auto-refresh will happen in 0 minutes, 2 hours and 0 days 
02.18@08:15 ++ System is up to date 
02.18@08:15 ++ Refresh finished 
Unless you see something in the log that suggests I need to take some action, I'll assume the problem has fixed itself. (However, I think it may be misleading for me to mark this as "Solved," since I didn't do anything to fix it.)

Thank you again for your response to my request for help. I'll follow your suggestions in the future, should the "APT cache is corrupted" problem arise again.
philotux

Re: Could not refresh list of updates--Your APT cache is corrupted

Post by philotux »

ablebaker wrote: Mon Feb 18, 2019 1:24 pm The image I tried to upload doesn't appear as being available when I use the Forum's Attachments > Add files window. Maybe I should start another thread to address this problem?
If you are sandboxing your browser, you will need to move the file to the Downloads folder in order for it to be accessible by the browser.

And then the log from update manager seems to suggest that it has successfully updated the cache and installed the available updates. However, the following couple of lines:

Code: Select all

synaptic:15262): Gtk-CRITICAL **: 06:59:08.901: gtk_widget_hide: assertion 'GTK_IS_WIDGET (widget)' failed
...
02.18@06:59 ++ Error: The APT policy is incorrect! 
need probably some further comments by someone with higher pay grade than me in Linux world. Hopefully someone will chime in to shed some light on this.

PS. Here you will find the code for the Update Manager (mintupdate). You can see some references to the error messages that you have been receiving between the line 615 and 643. I am afraid with my next-to-zero coding knowledge I am unable to comment further on this :(
Locked

Return to “Beginner Questions”