安裝 DansGuardian 時,請按照以下連結中的說明進行操作:Ubuntu 9.10 Karmic 上使用透明代理進行 Dansguardian 內容過濾,我設定了 iptables,sudo iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner proxy --dport 80 -j REDIRECT --to-port 8080
以便由代理以外的任何人發出的傳出 Web 請求應重定向到代理。我將其保存到 中/etc/init.d/tproxy
,以使這些變更永久存在。
完成此操作後,我刪除了 DansGuardian、squid 和 iptables 以重做整個過程,使用sudo apt autoremove dansguardian squid iptables
每次我運行sudo apt-get update
或sudo apt-get install ..
現在,我都會收到以下錯誤。
dell@dell-Inspiron-5558:/etc$ sudo apt-get update
Err:1 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty InRelease
Could not connect to ppa.launchpad.net:80 (91.189.95.83). - connect (111: Connection refused)
Err:2 http://archive.canonical.com/ubuntu zesty InRelease
Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) [IP: 91.189.91.15 80]
Err:3 http://in.old-releases.ubuntu.com/ubuntu zesty InRelease
Could not resolve 'in.old-releases.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu zesty InRelease
Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) [IP: 91.189.88.162 80]
Err:5 http://in.old-releases.ubuntu.com/ubuntu zesty-updates InRelease
Could not resolve 'in.old-releases.ubuntu.com'
Err:6 http://in.old-releases.ubuntu.com/ubuntu zesty-backports InRelease
Could not resolve 'in.old-releases.ubuntu.com'
Err:7 http://in.old-releases.ubuntu.com/ubuntu zesty-security InRelease
Could not resolve 'in.old-releases.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://in.old-releases.ubuntu.com/ubuntu/dists/zesty/InRelease Could not resolve 'in.old-releases.ubuntu.com'
W: Failed to fetch http://in.old-releases.ubuntu.com/ubuntu/dists/zesty-updates/InRelease Could not resolve 'in.old-releases.ubuntu.com'
W: Failed to fetch http://in.old-releases.ubuntu.com/ubuntu/dists/zesty-backports/InRelease Could not resolve 'in.old-releases.ubuntu.com'
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/zesty/InRelease Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) [IP: 91.189.91.15 80]
W: Failed to fetch http://in.old-releases.ubuntu.com/ubuntu/dists/zesty-security/InRelease Could not resolve 'in.old-releases.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/InRelease Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) [IP: 91.189.88.162 80]
W: Failed to fetch http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu/dists/zesty/InRelease Could not connect to ppa.launchpad.net:80 (91.189.95.83). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.
所提到的資源或儲存庫(如 ubuntu 檔案)也無法透過瀏覽器存取。我懷疑這是由於刪除上述三個文件之前已保存的 IP 設定所致。
iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner proxy --dport 80 -j REDIRECT --to-port 8080
儘管我不再有 iptables,但有沒有辦法撤消更改?
歡迎任何執行相同操作的建議或任何替代診斷。