Surface Book 2 上安装 apt 时出现“401 未授权”错误

Surface Book 2 上安装 apt 时出现“401 未授权”错误

我正在尝试使用 Ubuntu 20.04 设置我的 Surface Book 2。

我首先使用以下命令:

wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" | sudo tee /etc/apt/sources.list.d/linux-surface.list
sudo apt update
sudo apt install linux-image-surface linux-headers-surface iptsd libwacom-surfacei

使用最后一条命令,我得到以下结果:

Err:1 https://pkg.surfacelinux.com/debian release/main amd64 libwacom-surface amd64 1.12-2
  401  Unauthorized [IP: 185.199.108.133 443]
Err:2 https://pkg.surfacelinux.com/debian release/main amd64 iptsd amd64 0.5-1
  401  Unauthorized [IP: 185.199.108.133 443]
Err:3 https://pkg.surfacelinux.com/debian release/main amd64 linux-headers-surface amd64 5.14.16-surface-1
  401  Unauthorized [IP: 185.199.108.133 443]
Err:4 https://pkg.surfacelinux.com/debian release/main amd64 linux-image-5.14.16-surface amd64 5.14.16-surface-1
  401  Unauthorized [IP: 185.199.108.133 443]
E: Failed to fetch https://objects.githubusercontent.com/github-production-release-asset-2e65be/139604852/86019e52-7bfa-4bc6-8cc1-52147027aee6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20211106/us-east-1/s3/aws4_request&X-Amz-Date=20211106T131450Z&X-Amz-Expires=300&X-Amz-Signature=9b44d56c807e04d58c36fc33d5a6ad4ae1f74fee6431e763897fd886cb3a575d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=139604852&response-content-disposition=attachment; filename=libwacom-surface_1.12-2_amd64.deb&response-content-type=application/octet-stream  401  Unauthorized [IP: 185.199.108.133 443]
E: Failed to fetch https://objects.githubusercontent.com/github-production-release-asset-2e65be/261858706/88ea66fa-8b1d-45dd-96a0-004ddaaa2281?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20211106/us-east-1/s3/aws4_request&X-Amz-Date=20211106T131634Z&X-Amz-Expires=300&X-Amz-Signature=2051bebe2fe503c967b59d3657a56f9b668aaf1718c448570958f5acf7f7dfbd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=261858706&response-content-disposition=attachment; filename=iptsd_0.5-1_amd64.deb&response-content-type=application/octet-stream  401  Unauthorized [IP: 185.199.108.133 443]
E: Failed to fetch https://objects.githubusercontent.com/github-production-release-asset-2e65be/155009767/5e6532eb-2738-49cf-aac9-2f6b5669e2c7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20211106/us-east-1/s3/aws4_request&X-Amz-Date=20211106T131450Z&X-Amz-Expires=300&X-Amz-Signature=365eaaa7166dce0ed9871d0dda23f3e215e6faf76c076d9bb2dbcfdd38b2bdc1&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=155009767&response-content-disposition=attachment; filename=linux-headers-surface_5.14.16-surface-1_amd64.deb&response-content-type=application/octet-stream  401  Unauthorized [IP: 185.199.108.133 443]
E: Failed to fetch https://objects.githubusercontent.com/github-production-release-asset-2e65be/155009767/5538f486-10ef-4ba5-9136-f43f5938c538?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20211106/us-east-1/s3/aws4_request&X-Amz-Date=20211106T131450Z&X-Amz-Expires=300&X-Amz-Signature=ead5fed4643556504c56e282292cdb31b8e378981b62011d600c0fe9b4cb1f8c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=155009767&response-content-disposition=attachment; filename=linux-image-5.14.16-surface_5.14.16-surface-1_amd64.deb&response-content-type=application/octet-stream  401  Unauthorized [IP: 185.199.108.133 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我尝试将一些档案设置sources.list

http://security.ubuntu.com/ubuntu/

我现在真的陷入困境。我也试过

sudo apt-get update
sudo apt-get update --fix-missing

答案1

运行以下三个命令:

sudo add-apt-repository ppa:tj/bugfixes
sudo apt-get update
sudo apt install apt apt-utils

然后再次尝试最后一个命令。它应该可以正确安装。

摘自此帖子https://github.com/linux-surface/linux-surface/issues/625由@pyoor 链接。该问题似乎是由 apt 中的一个错误引起的,该错误已在@iam-TJ 的软件包中针对 ubuntu 20.04 进行了修复。

答案2

这对于我的 Surface Book 2 来说非常有效。

按照上述方法添加@iam-TJ 的包后,完成升级:

sudo apt update --fix-missing
sudo apt upgrade

最后一步将完成安装的实际工作。

答案3

我已经尝试过解决方案,因为我来自印度,所以我尝试删除“in”。例如“debhttp://in.archive.ubuntu.com/ubuntu/焦点主要受限”许多其他线路也在那里,但我们必须瞄准 debhttp://in.archive.... 到 deb http://archive.... 意味着我们必须从所有行中删除“in.” 之后只需运行以下命令 sudo rm -rf /var/lib/apt/lists/* sudo rm -rf /etc/apt/sources.list.d/*

  then start 

apt-get 更新 apt-get 升级 apt-get dist-upgrade 和 apt autoremove

  .............that's it folks & your system upgrades.......

它对我有用......也可能对你们所有人都有帮助......祝你好运......

相关内容