乌班图Linux里使用wget下载清华镜像网站的压缩包(Anaconda3-2023.09-0-Linux-x86_64.sh)出现ERROR 403: Forbidden.

文章讲述了在使用Wget下载Anaconda时遇到403Forbidden错误,原因可能是服务器限制、IP封禁等。提供了解决方案,包括更改用户代理为Mozilla开头,以及尝试其他下载参数。还介绍了其他常见的HTTP状态码及其含义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.出现问题代码

%%以前输入这个,服务器直接下载安装包
(base) wkl-A100-40:/data/WLC$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh 

%%以下是输入后出现报错
--2023-12-27 09:17:25--  https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2023-12-27 09:17:25 ERROR 403: Forbidden.

2.说明:

403 forbidden ”是一个 HTTP 状态码(HTTP STATUS CODE),它的含义非常好理解。就是:网站禁止你请求到该 URL 的内容,服务器就会返回403页面。

可能出现 403 的原因是:请求到了网站禁止访问的内容,一般是管理后台页面;请求速度太快被网站暂时屏蔽;发送请求的 IP 被网站封禁屏蔽;网站正在升级维护中,禁止其他人访问。

3.解决方法

1.以 Mozilla 开头或不包含 Wget 的用户代理(wget --user-agent=“Mozilla” + 链接)

(base) wkl-A100-40:/data/WLC$ wget --user-agent="Mozilla" https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh

--2023-12-27 09:26:37--  https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1153404010 (1.1G) [application/octet-stream]
Saving to: ‘Anaconda3-2023.09-0-Linux-x86_64.sh’

Anaconda3-2023.09-0-Linux-x86_64.sh           100%[=================================================================================================>]   1.07G  14.3MB/s    in 22s
%%下载完成

2.如果下载压缩包和图片对应参数可能不一样,需要去了解对应参数,以下三种也可以试试

wget -O 链接
wget --referer=链接
wget --no-check-certificate 链接

4.补充

相似的 40X 系列的状态码还有:
400:400 Bad Request 语义有误,当前请求无法被服务器理解。
401:401错误代表用户没有访问权限,需要进行身份认证。
403:403 forbidden 网站禁止访问。
404:404 not found,服务器找不到页面。
405:请求方法不被允许 (Method not allowed)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值