错误处理
手动安装错误
报错内容:
root@TestServer:~# mkdir /downloads && chmod -R 747 /downloads && wget https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb -O /downloads/hugo.deb && apt install /downloads/hugo.deb && hugo version && rm -R /downloads/hugo.deb
--2024-09-03 15:50:49-- https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb
Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/11180687/f1de7f8f-af1f-4416-a838-f9352f883c0a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240903%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240903T075049Z&X-Amz-Expires=300&X-Amz-Signature=0dd400a2ae55df46968e36d675f20ab907fa5428194c1ec14e1fe0e6b2b2d95b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=11180687&response-content-disposition=attachment%3B%20filename%3Dhugo_extended_0.133.1_linux-amd64.deb&response-content-type=application%2Foctet-stream [following]
--2024-09-03 15:50:49-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/11180687/f1de7f8f-af1f-4416-a838-f9352f883c0a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240903%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240903T075049Z&X-Amz-Expires=300&X-Amz-Signature=0dd400a2ae55df46968e36d675f20ab907fa5428194c1ec14e1fe0e6b2b2d95b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=11180687&response-content-disposition=attachment%3B%20filename%3Dhugo_extended_0.133.1_linux-amd64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25259918 (24M) [application/octet-stream]
Saving to: ‘/downloads/hugo.deb’
/downloads/hugo.deb 100%[=====================================================================================>] 24.09M 61.7MB/s in 0.4s
2024-09-03 15:50:50 (61.7 MB/s) - ‘/downloads/hugo.deb’ saved [25259918/25259918]
Note, selecting 'hugo' instead of '/downloads/hugo.deb'
The following packages were automatically installed and are no longer required:
golang-1.22-go golang-1.22-src golang-any golang-go golang-src libsass1
Use 'apt autoremove' to remove them.
Upgrading:
hugo
Summary:
Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 0
Download size: 0 B / 25.3 MB
Freed space: 1,011 kB
Get:1 /downloads/hugo.deb hugo amd64 0.133.1 [25.3 MB]
Reading changelogs... Done
(Reading database ... 118146 files and directories currently installed.)
Preparing to unpack /downloads/hugo.deb ...
Unpacking hugo (0.133.1) over (0.130.0-2) ...
Setting up hugo (0.133.1) ...
Processing triggers for man-db (2.13.0-1) ...
-bash: /usr/bin/hugo: No such file or directory如果使用apt install hugo 安装,在/usr/bin/目录下,会有hugo文件,但如果是手动安装则没有,手动安装时hugo 会在 /usr/local/bin/ 目录下
处理方法 - 创建 Symlinks:
ln -s /usr/local/bin/hugo /usr/bin/hugo