+ -
当前位置:首页 → 问答吧 → cygwin添加环境变量

cygwin添加环境变量

时间:2011-11-24

来源:互联网

我的系统是ubuntu11.04,本想在Ubuntu11.10发布的时候更新到11.10,奈何装上这个宝贝,搞了两天耐性还是被它折磨殆尽。只好重新装机,换回11.04。但是呢?我又需要用3.0的内核,这可怎么办呢?可以自己编译、甚至可以直接到Ubuntu ppa下载 已经编译好的内核。不过我觉得这些方法都比较麻烦,更重要的是我担心自己编译的跟老版本的系统兼容性不佳,所以就想着能不能直接用使用11.10的内核,这样子应该兼容性好一些吧。呵呵,到网上找了找,还真找到了。 现在写一篇总结。
其实原理也简单,就是在源里添加11.10的源,但是再设置一下,限制更新的时候只使用11.10的内核,其它的则还使用11.04的。不得不佩服Linux的定制性呀。
下面开始说详细步骤:

1.在 /etc/apt/sources.list里添加更新版本的源:
说明:我要更新的是11.10的内核,所以就添加这个版本的源,哦,我用的源是教育网的源:
http://202.38.95.110/ubuntu/ ,所以我的添加方式是:
代码:
sudo echo "deb http://202.38.95.110/ubuntu/ oneiric main"  >> /etc/apt/sources.list

下面是我的/etc/apt/sources.list文件的内容:
cat /etc/apt/sources.list
代码:
#北京交通大学的校内源,速度可达1.5M/s http://mirror.njtu.edu.cn,
deb http://202.38.95.110/ubuntu/ natty main multiverse restricted universe
deb http://202.38.95.110/ubuntu/ natty-backports main multiverse restricted universe
deb http://202.38.95.110/ubuntu/ natty-proposed main multiverse restricted universe
deb http://202.38.95.110/ubuntu/ natty-security main multiverse restricted universe
deb http://202.38.95.110/ubuntu/ natty-updates main multiverse restricted universe
deb-src http://202.38.95.110/ubuntu/ natty main multiverse restricted universe
deb-src http://202.38.95.110/ubuntu/ natty-backports main multiverse restricted universe
deb-src http://202.38.95.110/ubuntu/ natty-proposed main multiverse restricted universe
deb-src http://202.38.95.110/ubuntu/ natty-security main multiverse restricted universe
deb-src http://202.38.95.110/ubuntu/ natty-updates main multiverse restricted universe

deb http://202.38.95.110/ubuntu/ oneiric main


2. 创建 /etc/apt/preferences.d/30-oneiric 文件
代码:
         gedit  /etc/apt/preferences.d/30-oneiric

把下面的内容复制到 /etc/apt/preferences.d/30-oneiric 文件里
代码:
Package: *
Pin: release n=natty
Pin-Priority: 900

Package: *
Pin: release n=oneiric
Pin-Priority: 800

Package: linux-image-generic
Pin: release n=oneiric
Pin-Priority: 900

Package: linux-headers-generic
Pin: release n=oneiric
Pin-Priority: 900

Package: linux-libc-dev
Pin: release n=oneiric
Pin-Priority: 900

Package: module-init-tools
Pin: release n=oneiric
Pin-Priority: 900

Package: procps
Pin: release n=oneiric
Pin-Priority: 900

Package: nvidia-common
Pin: release n=oneiric
Pin-Priority: 900


3.然后更新即可,以后可能同步ubuntu11.10的内核了

代码:
apt-get update; apt-get dist-upgrade -y

我在11.04的系统上实测通过,原理上只要是旧的版本都可以通过这种方式可以使用最新的内核啦。但是要记得依据你的系统做相应的修改啊。

作者: Crazier   发布时间: 2011-11-24

懒人一枚
下deb装的。

作者: remeber   发布时间: 2011-11-24

热门下载

更多