Untitled conversation
- User
[注意] salsa20/chacha20-*系列加密方式,需要额外安装依赖 libsodium ,否则会无法启动ShadowsocksR !
- Assistant
这条提醒信息说明了在使用ShadowsocksR时,如果你选择了使用salsa20或chacha20系列的加密方式,则需要额外安装libsodium库。否则,ShadowsocksR可能无法正常启动。这些加密方式依赖于libsodium库来提供加密功能。
如果你碰到了这个问题,可以按照下面的步骤来解决:
-
安装libsodium:
- 对于Debian/Ubuntu系统,可以通过命令安装:
sudo apt-get update sudo apt-get install libsodium-dev - 对于CentOS系统,可以使用以下命令:
sudo yum install epel-release sudo yum install libsodium - 对于macOS,可以使用Homebrew进行安装:
brew install libsodium
- 对于Debian/Ubuntu系统,可以通过命令安装:
-
验证安装:安装完毕后,你可以通过命令
sodium_version_string来验证是否安装成功。 -
重启ShadowsocksR:安装完成后,重启ShadowsocksR以确保更改生效。
安装libsodium可以确保使用salsa20和chacha20加密方式的ShadowsocksR正常工作。
-
- User
[root@fresh-flags-1 /]# cd sudo yum install epel-release sudo yum install libsodium -bash: cd: too many arguments warning: Signature not supported. Hash algorithm SHA1 not available. Last metadata expiration check: 0:11:57 ago on Fri 18 Oct 2024 11:51:25 PM CST. No match for argument: libsodium Error: Unable to find a match: libsodium
- Assistant
遇到这个问题可能是因为以下几个原因:
-
命令输入错误:你在试图切换目录时输入了错误的命令。
cd命令是用于改变目录的,而不是用于执行安装命令。 -
软件源问题:你的系统可能缺少必要的软件源,或者软件源中的软件包没有更新。
-
软件包不在默认仓库中:有时候,某些软件包可能不在默认配置的仓库中。
以下是一些可能的解决方案:
检查并更新软件源
-
确保你的软件源是最新的:
- 运行以下命令更新软件源:
sudo yum clean all sudo yum makecache
- 运行以下命令更新软件源:
-
启用EPEL存储库:
- 如果尚未启用,可以尝试安装或重新启用EPEL(Extra Packages for Enterprise Linux)存储库:
sudo yum install epel-release
- 如果尚未启用,可以尝试安装或重新启用EPEL(Extra Packages for Enterprise Linux)存储库:
-
安装libsodium:
- 再次尝试安装libsodium:
-
- User
[root@fresh-flags-1 /]# sudo yum install epel-release warning: Signature not supported. Hash algorithm SHA1 not available. Last metadata expiration check: 0:00:09 ago on Sat 19 Oct 2024 12:04:48 AM CST. Package epel-release-9-7.el9.noarch is already installed. Dependencies resolved. Nothing to do. Complete! [root@fresh-flags-1 /]# sudo yum install libsodium warning: Signature not supported. Hash algorithm SHA1 not available. Last metadata expiration check: 0:00:14 ago on Sat 19 Oct 2024 12:04:48 AM CST. No match for argument: libsodium Error: Unable to find a match: libsodium [root@fresh-flags-1 /]# sudo yum install warning: Signature not supported. Hash algorithm SHA1 not available. Last metadata expiration check: 0:00:23 ago on Sat 19 Oct 2024 12:04:48 AM CST. [MIRROR] epel-release-7-11.noarch.rpm: Status code: 404 for (IP: 152.19.134.145) [MIRROR] epel-release-7-11.noarch.rpm: Status code: 404 for (IP: 152.19.134.145) [MIRROR] epel-release-7-11.noarch.rpm: Status code: 404 for (IP: 152.19.134.145) [MIRROR] epel-release-7-11.noarch.rpm: Status code: 404 for (IP: 152.19.134.145) [FAILED] epel-release-7-11.noarch.rpm: Status code: 404 for (IP: 152.19.134.145) Status code: 404 for (IP: 152.19.134.145) [root@fresh-flags-1 /]# sudo yum install libsodium warning: Signature not supported. Hash algorithm SHA1 not available. Last metadata expiration check: 0:00:29 ago on Sat 19 Oct 2024 12:04:48 AM CST. No match for argument: libsodium Error: Unable to find a match: libsodium [root@fresh-flags-1 /]#
- Assistant
看来你目前遇到了一些问题:软件包无法找到,以及一些关于SHA1算法的警告信息。以下是一些可能的解决措施:
1. 解决SHA1警告问题
首先我们来解决SHA1算法的警告信息,这通常是由于系统的加密策略配置导致的。你可以尝试通过以下命令调整加密策略:
sudo update-crypto-policies --set DEFAULT2. 手动安装libsodium
由于似乎在默认yum仓库中找不到libsodium,可以尝试通过其他方式安装libsodium。
使用dnf代替yum
在较新的CentOS/RHEL版本中,可以利用
dnf代替yum来找到和安装一些软件包:sudo dnf install libsodium手动下载并编译安装
如果
dnf方法依然无效,你可以尝试手动下载并编译安装libsodium:-
下载源码:
wget https://download.libsodium.org/libsodium/releases/libsodium-x.y.z.tar.gz tar xvfz libsodium-x.y.z.tar.gz cd libsodium-x.y.z请替换
x.y.z为最新版的版本号。 -
编译和安装:
./configure make sudo make install -
更新共享库缓存:
sudo ldconfig
3. 检查/更新系统版本
-
- User
- Assistant
你在尝试安装 ShadowsocksR 时遇到了一些问题,比如服务管理命令(如
service和chkconfig)找不到,以及 ShadowsocksR 启动失败。这些问题可能是由于你使用的操作系统版本没有安装必要的软件包,或者你的系统可能配置为使用systemctl而非service和chkconfig。以下是一些解决方案:
1. 使用
systemctl在较新的 CentOS/RHEL 版本中,
systemd已取代了init.d服务的老方法。因此,你的操作系统可能使用systemctl而不是service和chkconfig。尝试以下命令来启动 ShadowsocksR:
sudo systemctl start ssr sudo systemctl enable ssr检查状态:
sudo systemctl status ssr2. 安装
chkconfig和service如果你需要使用
service和chkconfig,可以通过以下方式安装:-
安装 EPEL(Extra Packages for Enterprise Linux):
-
- User
[root@fresh-flags-1 ~]# # 下载最新源码包 wget https://download.libsodium.org/libsodium/releases/libsodium-x.y.z.tar.gz tar xvfz libsodium-x.y.z.tar.gz cd libsodium-x.y.z
编译和安装
./configure make sudo make install
更新共享库缓存
sudo ldconfig --2024-10-19 00:08:38-- https://download.libsodium.org/libsodium/releases/libsodium-x.y.z.tar.gz Resolving download.libsodium.org (download.libsodium.org)... 37.59.238.213 Connecting to download.libsodium.org (download.libsodium.org)|37.59.238.213|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2024-10-19 00:08:39 ERROR 404: Not Found.
tar (child): libsodium-x.y.z.tar.gz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now -bash: cd: libsodium-x.y.z: No such file or directory -bash: ./configure: No such file or directory -bash: make: command not found sudo: make: command not found
- Assistant
出现这些错误是由于以下几种原因造成的:
- 下载链接错误:错误的链接中含有占位符
x.y.z,需要替换为具体的版本号。 - 缺少开发工具:系统中没有安装
make等必要的编译工具。
以下是修复这些问题的步骤:
1. 获取正确的版本号
首先,你需要访问 libsodium的GitHub发布页面 或 官方下载目录 来查看最新的版本号。假如最新版本是1.0.18,那么你可以下载该版本:
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz2. 安装必要的开发工具
确保你有基本的开发工具来编译源代码。如果没有,可以通过以下命令安装:
sudo yum groupinstall "Development Tools"3. 解压和编译安装
一旦你有了正确的源码包和开发工具,以下是完整的安装步骤:
# 解压缩 tar xvfz libsodium-1.0.18.tar.gz cd libsodium-1.0.18 # 编译和安装 ./configure make sudo make install # 更新共享库缓存 sudo ldconfig4. 验证安装
可以通过以下命令验证libsodium是否正确安装:
sodium_version_string如果返回libsodium的版本号,说明安装成功。
按上面的步骤操作,应该可以正确编译安装libsodium。如有进一步问题,请随时提问。
- 下载链接错误:错误的链接中含有占位符
- User
checking whether make supports nested variables... (cached) no checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports the include directive... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in
/root/libsodium-1.0.18': configure: error: no acceptable C compiler found in $PATH Seeconfig.log' for more details -bash: make: command not found sudo: make: command not found [root@fresh-flags-1 libsodium-1.0.18]# sodium_version_string -bash: sodium_version_string: command not found [root@fresh-flags-1 libsodium-1.0.18]# - Assistant
这些错误表明系统中缺少一个C编译器,如GCC,这也是为什么
make命令不可用的原因。我们需要安装GCC和其他开发工具来解决这个问题。以下是步骤:安装开发工具
-
更新包索引:
sudo yum update -
安装开发工具组: 执行以下命令以安装开发工具,这将包含
gcc和make等必需的工具:sudo yum groupinstall "Development Tools"如果上面的命令在你的版本上可能不可用(比如CentOS 9或RHEL 9),可以尝试手动安装一些关键的包:
sudo yum install gcc make
再次尝试编译并安装libsodium
确保
Development Tools安装成功后,再次尝试编译和安装libsodium:-
解压和进入目录:
tar xvfz libsodium-1.0.18.tar.gz cd libsodium-1.0.18 -
编译和安装:
./configure make sudo make install -
更新共享库缓存:
sudo ldconfig
验证安装
可以通过检查命令行工具是否返回libsodium版本以验证安装:
sodium_version_string以上方法应该能帮助解决缺少C编译器的问题,并完成libsodium的安装。如果有继续遇到问题,请检查
config.log文件以获取进一步的详细错误信息,并根据提示进行相应的修复。 -