Ubuntu交換パッケージソース

1465 ワード

に質問

sudo apt-get updateまたはsudo apt-get installを実行すると、Not Found Package Repository ErrorsまたはE: Some index files failed to download They have been ignored, or old ones usedの問題が発生し、パッケージソースを交換することによって解決することができる

解決策

  • バックアップsudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  • 修正sudo vim /etc/apt/sources.list、以下の内容(16.04.3)で置換:
  • deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    ## 
    deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
    #  
    deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    ## 
    deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
    

    更新

    sudo apt-get update