Ubuntu 18.04 don't create a snap package (Failed to update the package cache)


#1
Err http://archive.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons
  Hash Sum mismatch                                                            
Fetched 42.2 MB in 6s (6574 kB/s)                                              
Failed to update the package cache: Some files could not be downloaded:

E:Failed to fetch copy:/home/andrei/.cache/snapcraft/stage-packages/apt/22a57eaf9c51f344182f55b1a3e19fc331a464fdf25de5d9f405bd5982c9b45687c89983faafb9e6b46fa3d84441fbc6/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_bionic-security_universe_dep11_icons-48x48.tar.gz  Hash Sum mismatch
E:Some index files failed to download. They have been ignored
or old ones used instead.

Check that the sources on your host are configured correctly.

I found a solution, but it did not help me

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update

#2

this is an issue for me as well in a fresh ubuntu 18.04 install


#3

Does anyone know how to solve this problem?


#4

I have the same problem. The solution Endril found, does not help me either.


#5

I have the same problem too using 18.04.


#6

if I find a solution to this problem, I will write here


#7

Glad someone posted this here. I am having the same problem on my installation of Ubuntu 18.04 as well.

Specifically I am getting this error:

E:Failed to fetch copy:/home/{name}/.cache/snapcraft/stage-packages/apt/ebbb4b1389f7016ca9b0be1bf758a6dabc4816304b01c4a504834f8b8be018b1c6748d93faa768ea0be99565dd4b0574/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_bionic-security_main_dep11_icons-48x48.tar.gz  Hash Sum mismatch
E:Some index files failed to download. They have been ignored
or old ones used instead.

#8

this problem can be solved as follows:
you need to build your application in an lxd container with the image of ubuntu 18 04.

   sudo snap install lxd
   sudo lxd init
   sudo lxc launch ubuntu:18.04 myBuildUbuntu
   sudo lxc shell myBuildUbuntu

snapcraft LXD doc