linux ubuntu apt-get更換源
ubuntu 的默認源是美國的,因此下載起來特別慢,做爲天朝用戶,天然要更換爲天朝的源了。
國內有不少源可用,有些大學和公司也在維護着一些源。網上有不少可用的,下面給出一種簡單的方法。
用vi和gedit 打開 /etc/apt/sources.list 將其中的us.archive 所有替換爲 cn.archive便可,這樣,之後使用apt-get下載就會使用源自http://cn.archive.ubuntu.com 了。
使用vi編輯器的命令爲(注意首先切換到root用戶):
root@ubuntu :/#vi /etc/apt/sources.list
打開sources.list
在vi命令模式下(進入後便是命令行模式,按i後纔可進入編輯模式,不過這裏不須要編輯模式),輸入
:%s/us.archive/cn.archive/g
替換完畢,輸入
:wq!
保存退出。
命令中的符號解釋:
:(冒號),表示後面是命令
%(百分號),表示修改緩衝區中的文件內容;也就是說若是不保存,源文件不會改變;因此以後要用:wq! 命令保存退出
s(字母s),表示替換
/us.archive/cn.archive,表示將文件中的us.archive 替換爲cn.archive
/g(撇加字母g),表示替換全部內容
這樣,就將apt-get的源更改成國內的源了。
下面必須重起下apt-get,命令
apt-get update
好了。linux
安裝桌面
/etc/apt/reources.list.d
修改源
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverseubuntu
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverseapp
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse編輯器
1 (最簡) 基於GNOME
sudo apt-get install --no-install-recommends ubuntu-gnome-desktop
or
sudo apt-get install xorg gnome-core gnome-system-tools gnome-app-install(這個更小).net
2 基於Unity
sudo apt-get install --no-install-recommends ubuntu-desktop命令行
3 Lubuntu or LXDE 桌面
sudo apt-get install --no-install-recommends lubuntu-desktop
or
sudo apt-get install lxde or sudo apt-get install lxde-corerest