zoukankan      html  css  js  c++  java
  • Ubuntu管理软件源

          在Ubuntu环境下,我们经常会使用apt-get(apt)命令下载各种软件,当所需软件在官方软件库中找不到时,我们需要添加第三方的软件源,或者由于位于海外的官方软件源下载速度过于感人时,需要添加国内的源,我们可以编辑"/etc/apt/sources.list"文件,添加相应的源,例如添加阿里云软件源如下:

    1、百度找到阿里云软件源

    deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

    2、编辑之前最好先备份

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

    3、用vim或其它方法编辑

    sudo vim /etc/apt/sources.list  

    4、配置完成后需要更新下

    sudo apt-get update
    

    添加PPA源

    PPA(Personal Package Archives)源的添加我们需要用到software-properties-common软件包下的add-apt-repository命令,当然,该命令不仅仅可以添加PPA源,普通的源也可以

    先安装该软件包

    sudo apt-get install software-properties-common 

    安装完成后即可使用

    sudo add-apt-repository [options] [repository]  

    例如Oracle Jdk的ppa(由于Oracle JDK的下载需要登录Oracle账号,该PPA源已经无法使用)

    sudo add-apt-repository ppa:webupd8team/java
    

    删除PPA源,先输入命令:

    sudo add-apt-repository -r ppa:user/ppa-name  

     
    然后进入 /etc/apt/sources.list.d 目录,将相应 ppa 源的保存文件删除,然后更新

    sudo cd /etc/apt/sources.list.d
    sudo rm -r xxx 
    sudo apt-get update

    要更方便的找到需要的PPA源,可以上launchpad查看

  • 相关阅读:
    生于忧患,死于安乐
    【网络流24题】骑士共存问题
    【网络流24题】最长不下降子序列问题
    【网络流24题】太空计划问题
    SG函数
    【网络流24题】餐巾计划问题
    【APIO2019】奇怪装置
    【HEOI2016/TJOI2016】游戏
    【SDOI2015】星际战争
    【CQOI2009】跳舞
  • 原文地址:https://www.cnblogs.com/life-of-coding/p/10776882.html
Copyright © 2011-2022 走看看