歡迎您光臨本站 註冊首頁

如何通過命令行為Linux安裝驅動程序

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

一般來說,在安裝操作系統之後,系統會推薦一定的驅動更新,如果有些不合適,那麼你可以選擇手動更新.例如有的wireless無線驅動工作不正常,sudo ifconfig也不存在wlan0,那麼你就必須採取手動安裝方法.

,先判斷什麼驅動工作不正常.是音效卡,還是顯卡,還是無線模塊.

然後,在去官方網站下載驅動包,注意選擇操作系統和應用平台(i386,X86,X86_64),

再根據安裝包的不同採取操作.是需要編譯的源代碼,還是bin程序.

如果是源代碼,一定要先閱讀readme,執行

sudo make

sudo make install

sudo reboot

例如安裝realtek的無線驅動

[email protected]:~/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'
[email protected]:~/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
[email protected]:~/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 {} ;


[email protected]:~/Desktop/rtl_92ce_92se_92de_linux_mac80211_0003.0401.2011$

注意:有的linux操作系統默認沒有安裝gcc,如Fedora 14,需要先配置gcc

su root

yum -i gcc

如果是bin安裝包,則如下操作:

例如:安裝ati-driver

[email protected]:~/Downloads$ sudo chmod x ati-driver-installer-11-5-x86.x86_64.run
[email protected]:~/Downloads$ sudo ./ati-driver-installer-11-5-x86.x86_64.run

在按照提示操作即可.

本文出自 「通信,我的最愛」 博客,謝絕轉載!


[火星人 ] 如何通過命令行為Linux安裝驅動程序已經有591次圍觀

http://coctec.com/docs/linux/show-post-48360.html