博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何通过命令行为Linux安装驱动程序
阅读量:5935 次
发布时间:2019-06-19

本文共 10110 字,大约阅读时间需要 33 分钟。

        一般来说,在安装操作系统之后,系统会推荐一定的驱动更新,如果有些不合适,那么你可以选择手动更新。例如有的wireless无线驱动工作不正常,sudo ifconfig也不存在wlan0,那么你就必须采取手动安装方法。

        首先,先判断什么驱动工作不正常。是声卡,还是显卡,还是无线模块。

        然后,在去官方网站下载驱动包,注意选择操作系统和应用平台(i386,X86,X86_64),

        再根据安装包的不同采取操作。是需要编译的源代码,还是bin程序。

如果是源代码,一定要先阅读readme,执行

sudo make

sudo make install

sudo reboot

 

例如安装realtek的无线驱动

pp@ubuntu:~/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011$ sudo make

[sudo] password for pp:
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/base.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rc.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/debug.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/regd.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/efuse.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/cam.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/ps.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/core.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/pci.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtlwifi.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtlwifi.mod.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtlwifi.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/hw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/table.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/sw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/trx.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/led.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/fw.o
/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/fw.c: In function ‘rtl92c_download_fw’:
/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/fw.c:240: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/phy.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/rf.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/dm.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/rtl8192ce.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/rtl8192ce.mod.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce/rtl8192ce.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/hw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/table.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/sw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/trx.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/led.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/fw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/phy.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/rf.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/dm.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/rtl8192se.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/rtl8192se.mod.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se/rtl8192se.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/hw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/table.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/sw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/trx.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/led.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/fw.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/phy.o
/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/phy.c: In function ‘rtl92d_phy_reset_iqk_result’:
/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/phy.c:3002: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/rf.o
  CC [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/dm.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/rtl8192de.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/rtl8192de.mod.o
  LD [M]  /home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de/rtl8192de.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de'
pp@ubuntu:~/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011$ make install
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
rm: cannot remove `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/.tmp_versions/rtlwifi.mod': Permission denied
make[1]: *** [crmodverdir] Error 1
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make: *** [all] Error 2
pp@ubuntu:~/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011$ sudo make install
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192ce'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192se'
make[1]: Entering directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de'
make -C /lib/modules/2.6.35-28-generic/build M=/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-28-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-28-generic'
make[1]: Leaving directory `/home/pp/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011/rtl8192de'
find /lib/modules/2.6.35-28-generic -name "r8192se_*.ko" -exec rm {} \;
find /lib/modules/2.6.35-28-generic -name "r8192ce_*.ko" -exec rm {} \;
pp@ubuntu:~/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011$
 

注意:有的linux操作系统默认没有安装gcc,如Fedora 14,需要先配置gcc

su root

yum -i gcc

如果是bin安装包,则如下操作:

例如:安装ati-driver

dgd@dgd-ThinkPad-X120e:~/Downloads$ sudo chmod +x ati-driver-installer-11-5-x86.x86_64.run

dgd@dgd-ThinkPad-X120e:~/Downloads$ sudo ./ati-driver-installer-11-5-x86.x86_64.run 

在按照提示操作即可。

转载地址:http://ouctx.baihongyu.com/

你可能感兴趣的文章
【数据结构_浙江大学MOOC】第三四五讲 树
查看>>
Redis随笔-rename效率问题
查看>>
【推荐】jquery开发的大型web应用—H5编辑器工具
查看>>
[译] 设计一个现代的缓存
查看>>
C# 8的Ranges和递归模式
查看>>
sc 判断服务是否存在
查看>>
[MySQL FAQ]系列 -- 如何快速比较查询结果是否一致
查看>>
策略模式--红色警戒2之兵种设计
查看>>
Linux智能手机安全策略研究
查看>>
Oracle EM Express要求用户名和密码
查看>>
symantec sep 11卸载工具
查看>>
ASP.NET中常用输出JS脚本的类(改进版)
查看>>
Windows数据类型探幽——千回百转你是谁?(2)
查看>>
JavaScript 开发人员需要知道的简写技巧
查看>>
VS2010工具箱变灰解决方案
查看>>
漏洞门 国产x86处理器纷纷表态不受影响
查看>>
Postfix 电子邮件系统精要
查看>>
Android GIS开发系列-- 入门季(14)FeatureLayer之范围查询
查看>>
潮汕冬至吃甜丸
查看>>
ftrace的使用【转】
查看>>