zoukankan      html  css  js  c++  java
  • 《ubuntu — apt-get install的时候提示unable to locate package》

      我们在安装ubuntu时,由于ubuntu镜像一般默认自带的都是us的官方源http://us.archive.ubuntu.com,和http://security.ubuntu.com。这些镜像源的地址在中国大多数难以连接,因此需要换国内的源,国内的源有网易源、阿里源、科大源等等,本文会详细讲解怎么替换阿里源。

    sudo su     #输入密码
    cd /etc/apt  #切换到apt源文件
    mv  sources.list sources.list_bak  #备份源文件
    vim sources.list  #新建一个,然后将下面的内容copy进去
    # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
    deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
    deb http://archive.canonical.com/ubuntu xenial partner
    deb-src http://archive.canonical.com/ubuntu xenial partner
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

    按ecs,然后:wq保存后退出
    再执行命令更新配置

    sudo apt-get update
  • 相关阅读:
    vue 初始化项目模板报错
    092117-6265-01.dmp 蓝屏日志文件
    电信流氓注入JS
    DISM
    node.js
    Adobe ZXPInstaller 报错 Installation failed because of a file operation error.
    Microsoft Edge 针对 Web 开发人员更新日志
    What's new in Safari 11.0
    CSS Filter
    accept-language
  • 原文地址:https://www.cnblogs.com/zhuangquan/p/11803926.html
Copyright © 2011-2022 走看看