Ubuntu下的换源。。。。
因为自己手贱,一下子把半年的心血全部毁掉了,我整个嵌入式学习过程中的代码啊,项目啊,问题啊,全部都给搞丢了。。。还有万恶的配置。。。
没办法,还的重新装系统。。。
在Vmware下装了Ubuntu,有很多的问题啊,今天开始记录在学习过程中的整个配置过程。。。以防不测!!!!
1,换源
在shell中敲命令用到apt-get命令的时候,总是提示:could not open file '/etc/apt/sources.list',这个是源被删除了,这个还好说,整个配置过程如下:;
a,首先备份文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
b,添加源:
gedit /etc/apt/sources.list
将源列表拷贝到sources.list文件中,然后保存。下面提供一些源:
官方源:额,速度超级慢
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse浙江杭州的源:这个速度还是很给力的
deb http://mirror.lupaworld.com/ubuntu precise main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu precise-security main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu precise-updates main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu precise-backports main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu precise-proposed main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu precise main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu precise-security main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu precise-updates main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu precise-backports main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu precise-proposed main restricted universe multiverse
c,更新:
apt-get update 这个过程需要一定的时间,我们唯一能做的就是敲个yes,no,然后就是等了。。。。耐心。。。。
2,交叉编译环境的安装
这个就很简单了吧,下载安装包:arm-linux-gcc 4.3.2.tgz
首先解压这个安装包,
tar xvzf arm-linux-gcc 4.3.2.taz -C / (-C / 这个会自动将这个文件解压到/usr/locl/这个文件夹下)
这个命令会在/usr/local下添加一个arm文件夹,进入这个文件夹,然后找到bin文件,记下此时的路径比如为path.
最后呢,添加path路径到PATH中:
编辑/root/.bashrc文件,添加这样的一行:
export PATH=$PATH:path
然后保存,重启shell终端,然后arm-linux-gcc这个命令就可以用了。。。