Skip to content

Instantly share code, notes, and snippets.

@d2s
Last active June 14, 2021 01:04
Show Gist options
  • Save d2s/d2a6e24773ebb75ecb8569360755af3f to your computer and use it in GitHub Desktop.
Save d2s/d2a6e24773ebb75ecb8569360755af3f to your computer and use it in GitHub Desktop.

Fix Ubuntu package cache

Had problem with Ubuntu package cache.

➜  sources.list.d sudo apt-get update                   
Hit:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease                                                                   
Hit:3 http://fi.archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                 
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Reading package lists... Error!                    
E: Malformed Description-md5 line; includes invalid character '21!0a2ee344f1a65d3401a41cc0d42a7'
E: Malformed Description-md5 line; includes invalid character '21!0a2ee344f1a65d3401a41cc0d42a7'
W: You may want to run apt-get update to correct these problems
E: The package cache file is corrupted

First tried to disable any extra package sources, but it wasn't helping at all. Problem was caused by broken package cache, so had to find a way to remove temporary cache.

Solution was found from old forum thread:

sudo rm -r /var/lib/apt/lists/*
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get update
@pracplayopen
Copy link

works well thanks

@XtophZ92
Copy link

Thanks a lot! That worked.

@fatadz
Copy link

fatadz commented Jun 14, 2021

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment