Permission denied when updating

All we need is an easy explanation of the problem, so here it is.

I’m trying to update Linux, I am running 18.04.4 LTS. It has been failing to update for a while now and it’s the first moment I have had to look into it. This is the error I am getting

Err:1 http://apt.insync.io/ubuntu bionic/non-free amd64 insync amd64 3.2.6.40863-bionic
  403  Forbidden [IP: 52.216.102.123 80]
E: Failed to fetch http://apt.insync.io/ubuntu/pool/non-free/i/insync/insync_3.2.6.40863-bionic_amd64.deb  403  Forbidden [IP: 52.216.102.123 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

There was some software that I was using call insync that synced computers between two remote locations. That software is no longer being used or installed.

I have tried with the recommended run apt-get update. I then get these messages.

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

Any ideas?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

You need to run it with sudo. For example, apt update should be sudo apt update.

If you just want to do standard normal updates (e.g., if you want to update the packages, and not just the package list), the proper command is sudo apt update && sudo apt upgrade. The sudo tells Ubuntu to run the command as the superuser, which is the Linux equivalent of an administrator. The superuser has permission to run that command, your user doesn’t. Hence, why when you run it without sudo, it fails. Also, if you aren’t using Insync anymore, you can remove the package repo by following the directions here.

Method 2

You can also try something like this…

$ sudo -i
$ apt update

Enter above these two commands in your terminal something like this…

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply