通过代理设置 Ubuntu 更新

通过代理设置 Ubuntu 更新

我正在使用 Ubuntu 20.04 LTS,并与我的 Ubuntu 笔记本电脑共享使用 http 隧道的手机互联网连接。手机上的应用程序提供了一个代理 IP 和一个端口来连接到互联网。我已在 Ubuntu 网络代理设置中添加了这些代理 IP 和端口

在此处输入图片描述

我可以使用该互联网连接浏览互联网,浏览器运行良好,但无法使用终端更新 Ubuntu。它给了我这个错误请求错误。

nuwan@myUbuntu:~$ sudo apt update
Hit:1 http://packages.microsoft.com/repos/vscode stable InRelease                                                                     
Hit:2 http://linux.teamviewer.com/deb stable InRelease                                                                                
Hit:3 https://repo.steampowered.com/steam stable InRelease                                                                            
Err:4 http://ppa.launchpad.net/mkusb/ppa/ubuntu focal InRelease                           
  400  Bad Request [IP: 192.168.43.69 44355]
Err:5 http://us.archive.ubuntu.com/ubuntu focal InRelease           
  400  Bad Request [IP: 192.168.43.69 44355]
Err:6 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease     
  400  Bad Request [IP: 192.168.43.69 44355]
Get:7 http://dl.google.com/linux/chrome/deb stable InRelease [1,811 B]
Err:8 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
  400  Bad Request [IP: 192.168.43.69 44355]
Err:9 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
  400  Bad Request [IP: 192.168.43.69 44355]
Get:10 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,090 B]
Reading package lists... Done         
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://ppa.launchpad.net/mkusb/ppa/ubuntu focal InRelease' is no longer signed.
E: Failed to fetch http://ppa.launchpad.net/mkusb/ppa/ubuntu/dists/focal/InRelease  400  Bad Request [IP: 192.168.43.69 44355]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal InRelease' is no longer signed.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal/InRelease  400  Bad Request [IP: 192.168.43.69 44355]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' is no longer signed.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  400  Bad Request [IP: 192.168.43.69 44355]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  400  Bad Request [IP: 192.168.43.69 44355]
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' is no longer signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-security/InRelease  400  Bad Request [IP: 192.168.43.69 44355]
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal-security InRelease' is no longer signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

我发现了一些相关问题像这样,但它们没有解决我的问题。这里的问题是什么?(IP 地址与图像中的不同,因为我删除了图像并重新添加了具有新结果的代码)

答案1

正确的方法是这样的:

编辑你的/etc/apt/apt.conf并添加以下内容:

Acquire::http::Proxy "http://192.168.43.104:44355";

相关内容