Rhel

如何在 RHEL8 上安裝 Tor

  • March 24, 2020

我無法在 RHEL8.1 上安裝 Tor。我創建了一個儲存庫文件:/etc/yum.repos.d/tor.repo包含

[tor]
name=Tor experimental
repo enabled=1 baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/$basearch/ 
gpgcheck=1
gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc

[tor-source] 
name=Tor experimental source repo 
enabled=1
autorefresh=0 
baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/SRPMS
gpgcheck=1 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc'

安裝tor時,出現以下錯誤:

# yum -y install tor 
Updating Subscription Management repositories.
Tor Project Repo                                                                                                                                962  B/s | 264  B     00:00    
Failed to download metadata for repo 'Tor'
Error: Failed to download metadata for repo 'Tor'

您正在為 RHEL 添加不正確的儲存庫。RHEL 基於 RPM 包,但您正在為 Debian/Ubuntu 添加一個包含 DEB 包的儲存庫。

在文件中添加儲存庫:/etc/yum.repos.d/tor.repo

[tor]
name=Tor for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.torproject.org/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/centos/public_gpg.key
cost=100

啟用 EPEL 儲存庫:

dnf install epel-release -y

導入儲存庫的 GPG 密鑰: https ://rpm.torproject.org/fedora/public_gpg.key

wget -O- -q https://rpm.torproject.org/fedora/public_gpg.key
rpm --import public_gpg.key

安裝 Tor:

dnf install tor -y

引用自:https://unix.stackexchange.com/questions/574714