How to deal with "Unable to download updates"?

I found several discussions here dealing with specific cases of not being able to dowload updates, and I would like to understand when I can ignore the message (e.g. the update is not yet “ready”?) or when I have to do something about it. In my concrete case, the message says for instance “failed to refresh cache”, “package not (yet) available”, “could not open file…”, “permission denied”. Can somebody explain this a bit?

How did you update?

I’m guessing that you are doing it in the terminal emulador without sudo.

You should update the system as root.

sudo apt update && sudo apt upgrade

Not all the issues has the same solution.

Yes, I used the software center for the update. I performed now the command sudo apt-get update and there are errors: “could not open file…”, “failed to fetch…” and “(13: Permission denied)”.

You should post the whole error here if not we have to guess what’s going on on your system.

It’s “could not open file var/lib/dpkg/lock”? or something like that?

That means that there is another program trying to update the system, that file it’s created to tell any other program that there is already another one updating the system, sometimes the file is not removed by the system properly and you have to do it manually.

Sorry, of course, here you go:
Get:1 https://repo.pureos.net/pureos amber InRelease [5,784 B]
Get:2 https://repo.pureos.net/pureos amber-security InRelease [5,518 B]
Get:3 https://repo.pureos.net/pureos amber-updates InRelease [5,516 B]
Ign:4 https://repo.pureos.net/pureos amber/main amd64 Packages
Get:5 https://repo.pureos.net/pureos amber/main Translation-en [5,684 kB]
Get:5 https://repo.pureos.net/pureos amber/main Translation-en [5,684 kB]
Ign:5 https://repo.pureos.net/pureos amber/main Translation-en
Err:4 https://repo.pureos.net/pureos amber/main amd64 Packages
Could not open file /var/lib/apt/lists/partial/repo.pureos.net_pureos_dists_amber_main_binary-amd64_Packages.xz - open (13: Permission denied) [IP: 138.201.228.45 443]
Get:8 https://repo.pureos.net/pureos amber-security/main amd64 DEP-11 Metadata [15.3 kB]
Get:9 https://repo.pureos.net/pureos amber-security/main DEP-11 48x48 Icons [27.4 kB]
Get:10 https://repo.pureos.net/pureos amber-updates/main amd64 DEP-11 Metadata [980 B]
Ign:5 https://repo.pureos.net/pureos amber/main Translation-en
Hit:11 https://repo.pureos.net/pureos amber/main amd64 DEP-11 Metadata
Fetched 60.5 kB in 1s (52.7 kB/s)
Reading package lists… Done
E: Failed to fetch https://repo.pureos.net/pureos/dists/amber/main/binary-amd64/Packages Could not open file /var/lib/apt/lists/partial/repo.pureos.net_pureos_dists_amber_main_binary-amd64_Packages.xz - open (13: Permission denied) [IP: 138.201.228.45 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.