ubuntu添加软件源

ubuntu的方便在于很多软件与工具都已经被收录在官方的源里面,但有时候还是需要添加一些源来安装特定的东东,方法如下:

打开终端,先做个备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
然后 sudo gedit /etc/apt/sources.list
在打开的编辑器最后,加入需要的源地址
PS:注释掉其他行(行首加上#),也可不操作

最后,更新列表   sudo apt-get update

xd的源设置:

再在/etc/apt/sources.list    开头加入:
#----------------------- xidian -------------------------
deb http://ftp.xdlinux.info/ubuntu/ precise main multiverse restricted universe
deb http://ftp.xdlinux.info/ubuntu/ precise-backports main multiverse restricted universe
deb http://ftp.xdlinux.info/ubuntu/ precise-proposed main multiverse restricted universe
deb http://ftp.xdlinux.info/ubuntu/ precise-security main multiverse restricted universe
deb http://ftp.xdlinux.info/ubuntu/ precise-updates main multiverse restricted universe
deb-src http://ftp.xdlinux.info/ubuntu/ precise main multiverse restricted universe
deb-src http://ftp.xdlinux.info/ubuntu/ precise-backports main multiverse restricted universe
deb-src http://ftp.xdlinux.info/ubuntu/ precise-proposed main multiverse restricted universe
deb-src http://ftp.xdlinux.info/ubuntu/ precise-security main multiverse restricted universe
deb-src http://ftp.xdlinux.info/ubuntu/ precise-updates main multiverse restricted universe

#----------------------- 163 -------------------------

deb http://mirrors.163.com/ubuntu/ percise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ percise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ percise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ percise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ percise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ percise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ percise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ percise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ percise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ percise-backports main restricted universe multiverse
注意:precise是12.04的代号,更具版本不同做相应修改:
trusty(14.04)   quantal (12.10)   precise (12.04)   oneiric (11.10)   natty (11.04)   maverick (10.10)   lucid (10.04)

使用 sudo apt-get update 同步本地包数据库。
使用 sudo apt-get upgrade 升级所有已安装的软件包。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值