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 升级所有已安装的软件包。