root@CRSH1301000004:/mnt/c/Users/chenfei.shen# sudo apt install software-properties-common Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: python3-software-properties The following packages will be upgraded: python3-software-properties software-properties-common 2 upgraded, 0 newly installed, 0 to remove and 183 not upgraded. Need to get 32.1 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 software-properties-common all 0.99.9.12 403 Forbidden [IP: 101.6.15.130 443] Err:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 python3-software-properties all 0.99.9.12 403 Forbidden [IP: 101.6.15.130 443] E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/s/software-properties/software-properties-common_0.99.9.12_all.deb 403 Forbidden [IP: 101.6.15.130 443] E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/s/software-properties/python3-software-properties_0.99.9.12_all.deb 403 Forbidden [IP: 101.6.15.130 443] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
时间: 2025-08-10 17:24:21 AIGC 浏览: 19
<think>好的,我现在需要帮用户解决在Ubuntu20.04上安装software-properties-common时出现的403 Forbidden错误。用户之前的问题是关于安装pgloader,现在遇到了新的问题。我需要结合用户提供的三个引用内容来分析可能的原因和解决方案。首先,用户提到在安装software-properties-common时出现403错误。403错误通常与权限有关,但在这里更可能是指无法访问软件源,可能是因为镜像源的问题或者网络连接问题。根据引用[2]中的情况,用户之前在执行sudo apt-get update时遇到签名验证失败,可能源列表中有不可达的PPA或者镜像源。引用[3]中提到执行apt-getupdate可以解决部分包找不到的问题,但用户现在的问题是403,可能需要更换镜像源或者检查网络设置。接下来,我需要考虑可能的解决步骤。首先,检查网络连接是否正常,确保可以访问Ubuntu的软件仓库。然后,检查/etc/apt/sources.list中的镜像源是否正确,可能更换为国内镜像源如阿里云或清华源。另外,用户之前添加了pgloader的PPA,可能这个PPA现在不可用或导致冲突,需要暂时禁用或删除。此外,执行apt-get update和apt-get upgrade来更新软件包列表和升级现有软件,可能解决依赖问题。如果问题依然存在,可以尝试清除apt缓存并重新安装。
用户之前的问题中,通过PPA安装pgloader时,需要software-properties-common,所以现在安装这个包出现403,可能因为镜像源配置错误或者PPA的问题。需要引导用户检查源列表,更换镜像,并确保PPA可用。此外,引用[1]中提到安装ubuntu-desktop时出现依赖问题,可能与软件源未正确更新有关,所以更新源可能也是关键步骤。
最后,整理解决方案的步骤,确保用户能够一步步操作,并生成相关问题,帮助用户解决可能遇到的类似问题。</think>### 解决 Ubuntu 20.04 安装 `software-properties-common` 时出现 403 Forbidden 错误的步骤
#### 1. **检查网络连接**
确保系统能正常访问网络,特别是官方软件仓库:
```bash
ping archive.ubuntu.com
```
若无法连通,需检查防火墙或代理设置[^2]。
#### 2. **更换软件源镜像**
将默认源替换为国内镜像(如阿里云或清华源):
```bash
sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
sudo apt update
```
此操作可解决因官方源网络不稳定导致的 403 错误[^3]。
#### 3. **清理残留的 PPA 配置**
若之前添加过第三方仓库(如 `pgloader/stable`),可能因仓库失效导致冲突:
```bash
sudo add-apt-repository --remove ppa:pgloader/stable # 移除冲突的 PPA
sudo rm -rf /var/lib/apt/lists/* # 清除缓存
sudo apt clean
sudo apt update
```
#### 4. **重新安装软件包**
更新完成后重新尝试安装:
```bash
sudo apt install software-properties-common
```
#### 5. **处理依赖问题**
若仍报错,修复依赖关系:
```bash
sudo apt --fix-broken install
sudo apt autoremove
```
---
### 常见问题场景
- **镜像源未生效**:检查 `/etc/apt/sources.list` 是否成功替换为国内镜像。
- **代理干扰**:若使用代理,临时关闭或配置代理白名单。
- **PPA 签名问题**:若提示 `NO_PUBKEY`,执行 `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [缺失的密钥ID]`[^2]。
---
阅读全文
相关推荐



















