What to do if pacman fails to download the source

background

When compiling a C++ program, it prompts that the link failed. The error is as follows:

clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
[24/25] Linking CXX executable samples/xxx
ninja: build stopped: subcommand failed.

I won’t go into too much detail here, but anyway, it’s the lack of resources caused by the linker’s need to perform a large number of links. Ok, then we switch to mold, a lightweight linker. I heard that it is fast and resource-saving, and it is simply invincible. . .
Mold address: https://github.com/rui314/mold

Download mold linker

Search before downloading. OK, this package exists in the source of pacman, so go ahead.

 sudo pacman -Si mold
Repository      : extra
Name            : mold
Version         : 2.1.0-1
Description     : A Modern Linker
Architecture    : x86_64
URL             : https://github.com/rui314/mold
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : glibc  gcc-libs  mimalloc  openssl  zlib  tbb  zstd
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 2.30 MiB
Installed Size  : 19.09 MiB
Packager        : Frederik Schwan <[email protected]>
Build Date      : Sun 13 Aug 2023 07:35:32 PM CST
Validated By    : MD5 Sum  SHA-256 Sum  Signature

download

The good guy immediately reported an error when downloading. The error message is as follows

error: failed retrieving file 'mold-2.1.0-1-x86_64.pkg.tar.zst' from mirrors.ustc.edu.cn : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.

stable for testing

I doubt whether it is a source problem, and I am going to try replacing the standard source with testing.

1、sudo vim pacman-mirrors.conf

2、stable修改成testing

3、pacman下载还是失败

View source website

Checking the corresponding mold packages under stable and testing respectively, we found that there is no 2.1.0 version of mold. There is only a lower version of mold.

cat /etc/pacman.d/mirrorlist


## Country : China
Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch

I used the source from the University of Science and Technology of China. I went to the source website to look for mold and found that there was indeed no mold 2.1.0.

View applicable versions of mold

Check the mold official github for the mold address applicable to this system, and it is indeed 2.1.0. What's even more speechless is that a colleague successfully installed mold 2.1.0 version from pacman some time ago, which is strange.
It is speculated that it is a problem with the resource management of the source website, maybe it was deleted by swiping. . .
image.png

Go and search in the arch repo

image.png
The version and time are very nice and can be used.

Install pacman from the download package

sudo pacman -U mold-2.1.0-1-x86_64.pkg.tar.zst

# 查看
mold --help

The result is very silky smooth. Sometimes I feel that my thinking is not broad enough. I have been stuck on the source address for a long time. I should have gone to the source website earlier. If you find that the source website does not have this package, just go to the arch warehouse and look for it. The last time I installed an ubuntu package, I used a similar method. I hope I can solve this problem in seconds if I encounter this problem in the future. Thanks!

end

Guess you like

Origin blog.csdn.net/LJFPHP/article/details/132917691