安装 OpenVPN 时遇到问题

安装 OpenVPN 时遇到问题

我尝试按照他们的指南进行安装通过存储库打开OpenVPN适用于 Ubuntu 18,但遇到了一些问题。输入第一个命令后:

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

我遇到了以下错误。

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)

然后,我尝试在原始命令前面添加“sudo”,似乎解决了其中一个问题,但最后仍然收到错误。

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?

我不知道接下来该怎么办。有什么建议吗?

答案1

如下所示单独运行命令应该可以解决问题,因为命令是用“&&”混合在一起的

sudo apt update

然后

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

谢谢用户535733感谢他的评论。

相关内容