Ubuntu如何更换软件源

 --Ubuntu8换源-----------------------------

如果你什么软件包更新不了,运行sudu apt-get update出现Could not resolve 'cn.archive.ubuntu.com'那么你就需要换一下系统的软件源了。

1、打开终端
应用程序-附件-终端

2、修改更新服务器列表,请在终端执行:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list


注意:接下来在打开的文本编辑器中,把你看到的内容全部删掉,访问我们推荐的源http://wiki.ubuntu.org.cn/index.php?title=如何使用我们推荐的源&variant=zh-cn#Hardy.288.04.29_.E7.89.88.E6.9C.AC 8.04页面。在那里里请选择一组对于你来说速度最快的更新服务器列表。粘贴到你所看到的窗口中。

3、更新软件包列表
sudo apt-get update

这里有更详细的说明:http://wiki.ubuntu.org.cn/index.php?title=Qref/Hardy&variant=zh-cn


--查看Ubuntu版本-------------------

方法一

在终端中执行下列指令:

cat /etc/issue

可以查看当前正在运行的 Ubuntu 的版本号。其输出结果类似下面的内容:

Ubuntu 8.04 \n \l

方法二

使用 lsb_release 命令也可以查看 Ubuntu 的版本号,与方法一相比,内容更为详细。执行指令如下:

sudo lsb_release -a

将输出结果:


Distributor ID: Ubuntu
Description: Ubuntu 8.04
Release: 8.04
Codename: feisty

 

 

  参考的是http://www.linuxidc.com/Linux/2012-10/73114.htm    


    安装ubuntu12.10之后,第一件事就是更换源,ubuntu网易163的更新源速度一直很好。
    首先备份源,sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
    更换源,sudo gedit /etc/apt/sources.list
    将下边的源直接覆盖掉:
deb http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted


    运行apt-get update


     ubuntu中常用命令:
    apt-get upgrade
    apt-get install
    apt-get bulid-dep


12.04源

 deb http://mirrors.163.com/ubuntu/ precise main restricted
 deb-src http://mirrors.163.com/ubuntu/ precise main restricted
 deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
 deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
 deb http://mirrors.163.com/ubuntu/ precise universe
 deb-src http://mirrors.163.com/ubuntu/ precise universe
 deb http://mirrors.163.com/ubuntu/ precise-updates universe
 deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
 deb http://mirrors.163.com/ubuntu/ precise multiverse
 deb-src http://mirrors.163.com/ubuntu/ precise multiverse
 deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
 deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
 deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
 deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
 deb http://mirrors.163.com/ubuntu/ precise-security main restricted
 deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
 deb http://mirrors.163.com/ubuntu/ precise-security universe
 deb-src http://mirrors.163.com/ubuntu/ precise-security universe
 deb http://mirrors.163.com/ubuntu/ precise-security multiverse
 deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
 deb http://extras.ubuntu.com/ubuntu precise main
 deb-src http://extras.ubuntu.com/ubuntu precise main

你可能感兴趣的:(linux)