You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装OpenVPN客户端遇权限拒绝(23)及404错误求助

解决Ubuntu安装OpenVPN客户端的权限与404错误

一、修复权限拒绝问题

权限错误源于sudo仅作用于命令前半段,重定向操作(>)仍以普通用户权限执行,无法写入/etc/apt/这类系统目录。需调整命令,让整个写入流程使用管理员权限。

修正后的步骤1命令

curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg > /dev/null

修正后的步骤2命令

curl -fsSL https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list | sudo tee /etc/apt/sources.list.d/openvpn3.list > /dev/null

二、修复404 Not Found错误

404错误是因为$DISTRO变量未正确赋值,导致请求URL缺失Ubuntu版本代号。先执行以下命令获取并设置系统版本代号:

export DISTRO=$(lsb_release -cs)

设置完成后再执行相关源添加命令,即可生成正确URL,避免404错误。

三、完整安装流程

按顺序执行以下命令,完成OpenVPN客户端安装:

  1. 安装lsb-release(若未安装):
sudo apt update && sudo apt install -y lsb-release
  1. 设置版本代号变量:
export DISTRO=$(lsb_release -cs)
  1. 导入GPG密钥:
curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg > /dev/null
  1. 添加OpenVPN3软件源:
curl -fsSL https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list | sudo tee /etc/apt/sources.list.d/openvpn3.list > /dev/null
  1. 更新包列表并安装客户端:
sudo apt update && sudo apt install -y openvpn3

内容的提问来源于stack exchange,提问作者César Robledo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 01:01:19