0

I tried following their guide for installing OpenVPN via repository for Ubuntu 18 but ran into a few issues. After entering the first command:

apt update && apt -y install ca-certificates wget net-tools

I'm hit with the following errors.

Reading package lists... Done
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)

I then tried adding "sudo" in front of the original command it seems to have fixed one of the problems but still receive errors at the end.

Hit:1 http://ca.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://ca.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Get:4 http://ca.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] 
Get:5 http://ca.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [586 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [740 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,007 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [980 kB]
Fetched 3,564 kB in 6s (601 kB/s) 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
24 packages can be upgraded. Run 'apt list --upgradable' to see them.
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

I'm not sure what to do from here. Any advice?

Sr8120
  • 41
  • You have two commands munged together with a "&&". Separate them and try each separately. Then you will see the problem right away. Optional: Also get rid of the "-y": It eliminates an important protection. – user535733 Sep 26 '19 at 15:52
  • You forgot sudo. – fkraiem Sep 26 '19 at 16:39

1 Answers1

0

Running the commands separately as shown below should solve the problem as the commands are munged together with "&&"

sudo apt update

Then

sudo apt -y install ca-certificates wget net-tools

Thanks to user535733 for his comment.

Sr8120
  • 41