首頁>Ubuntu>source

首先我做了 sudo apt update and sudo apt-get update 工作正常,但做完 sudo apt upgrade and sudo apt-get upgrade getting below error之後

    sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-5.4.0-59 linux-headers-5.4.0-59-generic linux-image-5.4.0-59-generic linux-modules-5.4.0-59-generic linux-modules-extra-5.4.0-59-generic
The following packages will be upgraded:
  libasound2 libasound2-data libatopology2 libproxy1-plugin-gsettings libproxy1-plugin-networkmanager libproxy1v5 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
  linux-image-generic-hwe-20.04 linux-libc-dev nautilus-sendto python-apt-common python3-apt
13 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.5 kB/76.0 MB of archives.
After this operation, 360 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Ign:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Ign:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Ign:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
Get:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Err:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

輸出

cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)]/ focal main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal universe
deb http://in.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://in.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

sudo apt更新--fix-missing

sudo apt update --fix-missing
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
sudo apt upgrade
sudo apt upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    The following NEW packages will be installed:
      linux-headers-5.4.0-59 linux-headers-5.4.0-59-generic linux-image-5.4.0-59-generic linux-modules-5.4.0-59-generic linux-modules-extra-5.4.0-59-generic
    The following packages will be upgraded:
      libasound2 libasound2-data libatopology2 libproxy1-plugin-gsettings libproxy1-plugin-networkmanager libproxy1v5 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
      linux-image-generic-hwe-20.04 linux-libc-dev nautilus-sendto python-apt-common python3-apt
    13 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
    Need to get 72.5 kB/76.0 MB of archives.
    After this operation, 360 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Get:1 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
    Ign:1 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
    Get:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
    Ign:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
    Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
    Ign:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
    Get:1 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
    Err:1 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
      Undetermined Error [IP: 91.189.88.142 80]
    Get:2 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
    Err:2 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
      Undetermined Error [IP: 91.189.88.142 80]
    Get:3 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
    Err:3 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
      Undetermined Error [IP: 91.189.88.142 80]
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
最新回復
  • 5月前
    1 #

    通過在终端中執行以下命令將儲存庫列表還原為原始的Ubuntu Focal列表:

    sudo nano /etc/apt/sources.list
    

    將打開檔案編輯器.删除其中的所有行,然後將以下內容複製並粘贴到檔案編輯器中:

    deb http://archive.ubuntu.com/ubuntu focal main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ focal-security main multiverse universe restricted
    deb http://archive.ubuntu.com/ubuntu focal-updates main multiverse universe restricted
    

    然後,按Ctrl+X,然後按y,然後按Enter<,儲存並關闭檔案 / p>

    要驗證您是否正確儲存了檔案,請在终端中執行以下命令:

    cat /etc/apt/sources.list
    

    輸出應该完全是:

    deb http://archive.ubuntu.com/ubuntu focal main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ focal-security main multiverse universe restricted
    deb http://archive.ubuntu.com/ubuntu focal-updates main multiverse universe restricted
    

    Ubuntu repositories have a defined format. They should be for example something like deb http://archive.ubuntu.com/ubuntu bionic main

    Explanation:

    deb 這些儲存庫包含二进製檔案或預編譯的軟體包.大多數使用者都需要這些儲存庫。

    http://archive.ubuntu.com/ubuntu URI(統一資源標識符),在這種情况下為Internet上的位置。

    focal 是Ubuntu安裝的發行版名稱。

    main & restricted ...等: 是节的名稱或元件.可以有多个节名稱,用空格分隔。

    之後,請在终端中執行以下命令来清除apt快取:

    sudo apt clean && sudo apt autoclean
    

    然後通過在终端中執行以下命令来更新您的儲存庫列表:

    sudo apt update
    

    您現在應该可以安裝軟體包並再次更新系統。

    如果在此之後仍然出現錯誤,請先備份 /etc/apt/sources.list.d/ 通過在终端中執行以下命令,將其複製到您的主目錄:

    mkdir ~/old_sources_list_d && sudo cp -r /etc/apt/sources.list.d/* ~/old_sources_list_d/
    

    之後,請清除 /etc/apt/sources.list.d/中所有現有的PPA和儲存庫列表 通過在终端中執行以下命令:

    sudo rm /etc/apt/sources.list.d/*
    

    之後,請在终端中執行以下命令来清除apt快取:

    sudo apt clean && sudo apt autoclean
    

    然後,請通過在终端中再次執行以下命令来更新您的儲存庫列表:

    sudo apt update
    

    Notice:

      Check if your connection to the Internet is behind a firewall, limited in any way or behind a proxy and configure your system and connection accordingly or change to a different connection if available. Firewalls can block access to certain URLs and proxies can keep old stale links in their cache system and this would result in broken or unresponsive targets. Proxies can also modify the headers of the HTTP requests and interfere with responses from web-servers and change them and your computer might end up getting faulty responses that APT can not handle correctly. This is common in networks that are used by large number of people and limited resources or Internet speed for availability and security reasons.

      Check if there is an APT proxy configuration file by running the following command:

    ls /etc/apt/apt.conf.d/*proxy*
    

    如果命令返迴任何結果,請將這些檔案移出 /etc/apt/apt.conf.d/ 目錄或删除它们。

  • upgrade:升級期間停電時出現問题
  • networking:wifi不斷下降2004