- 记录部署项目时碰到的问题
- 需求是需要在ubuntu服务器上安装pandoc软件,找到github上对应的release。

- 复制出下载链接,使用如下curl指令下载,下载过程没有报错,但查看文件大小发现居然为0,这明显不正常。
news_yu@SZ-YUXINWEN-L1:~$ curl -O https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-arm64.deb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
news_yu@SZ-YUXINWEN-L1:~$ ls -al
-rw-r--r-- 1 news_yu news_yu 0 Aug 18 11:50 pandoc-3.1.6.1-1-arm64.deb
- 换一种方式,使用wget工具下载发现可以成功下载,查看下载日志发现访问源url,302了,重定向到另一个url。对于重定向wget自动处理了,curl失败了是不是因为没有处理重定向?
news_yu@SZ-YUXINWEN-L1:~$ wget https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-arm64.deb
--2023-08-18 11:53:06-- https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-arm64.deb
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/571770/6c16279c-6bca-4df0-98f3-adc29379f77d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230818%2Fus-east-1%2Fs3%2F
aws4_request&X-Amz-Date=20230818T035306Z&X-Amz-Expires=300&X-Amz-Signature=678a96912f4dbdd0919f12ca7153cdfb4ba1a9c3931f614b598d12adf1feb71f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=571770&response-content-disposition=att
achment%3B%20filename%3Dpandoc-3.1.6.1-1-arm64.deb&response-content-type=application%2Foctet-stream [following]
--2023-08-18 11:53:06-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/571770/6c16279c-6bca-4df0-98f3-adc29379f77d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230818%2Fus
-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230818T035306Z&X-Amz-Expires=300&X-Amz-Signature=678a96912f4dbdd0919f12ca7153cdfb4ba1a9c3931f614b598d12adf1feb71f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=571770&response-content-
disposition=attachment%3B%20filename%3Dpandoc-3.1.6.1-1-arm64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 33263992 (32M) [application/octet-stream]
Saving to: ‘pandoc-3.1.6.1-1-arm64.deb.1’
pandoc-3.1.6.1-1-arm64.deb.1 100%[=====================================================================================================================================>] 31.72M 4.42MB/s in 5.8s
2023-08-18 11:53:12 (5.51 MB/s) - ‘pandoc-3.1.6.1-1-arm64.deb.1’ saved [33263992/33263992]

news_yu@SZ-YUXINWEN-L1:~/venv$ curl -OL https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 29.1M 100 29.1M 0 0 3480k 0 0:00:08 0:00:08 --:--:-- 5668k