LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1355|回复: 5

如何安装内核源码

[复制链接]
发表于 2006-3-13 03:30:45 | 显示全部楼层 |阅读模式
请教;我是用debian-31r0a-i386-binary-1.iso硬盘安装的,现在/usr/src目录中没有kernel-soure-version文件,要如何才能装上呢?

#apt-cache search kernel-source,只发现了最符合的是kernel-sourc-2.6.8,于是
#apt-get install kernel-sourc-2.6.8
发现/lib/modules/目录下多出了2.6.8目录(还有一个是原来的2.6.8-2-386),就是说我下载安装的不是现在的版本,不能用来装alsa是吧?

我想要装上正确的内核源码,硬盘或者网络的方法都行,请教!
发表于 2006-3-13 07:42:04 | 显示全部楼层
可以使用aptitude 或者 synaptic 来安装软件。
启动aptitude后按“?”键然后查找。
回复 支持 反对

使用道具 举报

发表于 2006-3-13 08:09:41 | 显示全部楼层
编辑/etc/apt/sources.list文件,将其改写为:
deb http://debian.cn99.com/debian testing main non-free contrib
deb http://debian.cn99.com/debian-security testing/updates main contrib non-free
deb-src http://debian.cn99.com/debian testing main non-free contrib
deb-src http://debian.cn99.com/debian-security testing/updates main contrib non-free

然后,aptitude update
aptitude dist-upgrade进行系统升级(这时会安装最新的内核linux-image-2.6.15-1)

如果只想安装内核,你可以:
aptitude search linux-image找到一个你需要的内核
然后aptitude install linux-image-686 / aptitude install linux-image-686-smp(如果你有多个CPU或者有支持超线程的CPU)

内核头文件是linux-header打头的,内核源码是linux-source打头的。
自己选择需要的就可以了。
回复 支持 反对

使用道具 举报

发表于 2006-3-13 09:32:42 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-14 14:17:25 | 显示全部楼层
thanks for your kindness

我只想装上跟自己内核相同的内核源码,即在我的/usr/src目录下面有个内核版本的目录(asla-driver提示要[red]full kernel source[/red],好象是/usr/src/2.6.8-2-386/kernel/source下要有东西),这样可以满足装asla-drive的要求

另外:
1、难道不可以在装系统的时候一起装上跟我内核版本相同的内核源码吗?我又想再装了。。。
2、为什么装asla需要那个内核源码呢?
3、/usr/src目录下的内核目录和/lib/modules/目录下的内核目录是什么关系呢?装alsa时我搞晕了
4、回springwind426:aptitude install linux-image-686的意思是安装内核是吧?这是什么意思呢?难道我的内核没装?我系统都在运行了。是装个新内核的意思吗?
5、关于springwind426提到的安装源:如果要升级,[red]一定[/red]要将我原来的安装源
deb http://debian.cn99.com/debian stale main non-free contrib
deb-src http://debian.cn99.com/debian stable main non-free contrib
改成
deb http://debian.cn99.com/debian [red]testing[/red] main non-free contrib
deb http://debian.cn99.com/debian-security [red]testing[/red]/updates main contrib non-free
deb-src http://debian.cn99.com/debian [red]testing[/red] main non-free contrib
deb-src http://debian.cn99.com/debian-security [red]testing[/red]/updates main contrib non-free是吗?
6、我是用debian-31r0a-i386-binary-1.iso硬盘装的系统,以上我填的安装源没有错吧?应该是stale的吧?

我是个新手,很渴望能够用好她,如果我的问题问的很幼稚还请多见凉
回复 支持 反对

使用道具 举报

发表于 2006-3-14 21:22:55 | 显示全部楼层
deb http://debian.cn99.com/debian stable main non-free contrib
deb-src http://debian.cn99.com/debian stable main non-free contrib

你有没有做过apt-get update?

你可以用aptitude update
aptitude search kernel-source看看有没有与你当前内核相对应的源代码。

不过,好象一般的编译内核模块的时候,只需要kernel-header.....包。

如果是声卡的关系,可以试试
aptitude install alsa-base alsa-utils

然后 alsaconf 一般情况下都能正确的认出声卡。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表