Openwrt安裝軟件的方法

轉自:http://blog.csdn.net/jk110333/article/details/8753825    node

web軟件:web

Naken Web

Openwrt安裝軟件服務器

簡介

Openwrt是個很自由的開源路由器系統,軟件包支持幾千個,功能很強大!ssh

安裝的方法主要有兩種,telnet或者ssh鏈接後臺安裝和 頁面安裝。ide

下面的全部步驟的前提是當前的路由器已經聯網!post

telnet或ssh

原始的openwrt默認是沒有密碼的,只開啓了telnet沒有開啓ssh,當第一次配置完用戶名和密碼後,關閉了telnet開啓了ssh,用戶能夠隨時連上路由器,下面我用ssh鏈接的。ui

Openwrt管理軟件包的命令是opkg,下面是命令的幫助spa

 

[plain]  view plain copy
 
  1. root@Jack:/tmp/opkg-lists# opkg--help  
  2. opkg:unrecognized option `--help'  
  3. opkgmust have one sub-command argument  
  4. usage:opkg [options...] sub-command [arguments...]  
  5. wheresub-command is one of:  
  6. PackageManipulation:  
  7.         update           升級       Update list ofavailable packages  
  8.         upgrade <pkgs>     升級某一個軟件     Upgrade packages  
  9.         install <pkgs>     安裝某一個軟件     Install package(s)  
  10.         configure <pkgs>    配置某一個軟件    Configure unpacked package(s)  
  11.         remove <pkgs|regexp>  刪除軟件  Remove package(s)  
  12.         flag <flag> <pkgs>      Flag package(s)  
  13.         <flag>=hold|noprune|user|ok|installed|unpacked (one perinvocation)  
  14.    
  15. InformationalCommands:  
  16.         list       列出openwrt全部支持的軟件包   List availablepackages  
  17.         list-installed     列出本機已經安裝的軟件包     List installed packages  
  18.         list-upgradable  列出能夠升級的軟件包  ist installed and upgradable packages  
  19.         list-changed-conffiles  List user modified configuration files  
  20.         files <pkg>             List files belonging to<pkg>  
  21.         search <file|regexp>    List package providing <file>  
  22.         find <regexp>           List packages whose name ordescription matches <regexp>  
  23.         info[pkg|regexp]    顯示軟件包的信息   Display all info for <pkg>  
  24.         status [pkg|regexp]   顯示軟件包的狀態  Display all status for <pkg>  
  25.         download<pkg> 下載一個軟件包到當前目錄 Download<pkg> to current directory  
  26.         compare-versions <v1> <op><v2>  
  27.                             compare versionsusing <= < > >= = << >>  
  28.         print-architecture      List installable package architectures  
  29.         depends [-A] [pkgname|pat]+  
  30.         whatdepends [-A] [pkgname|pat]+  
  31.         whatdependsrec [-A] [pkgname|pat]+  
  32.         whatrecommends[-A] [pkgname|pat]+  
  33.         whatsuggests[-A] [pkgname|pat]+  
  34.         whatprovides [-A] [pkgname|pat]+  
  35.         whatconflicts [-A] [pkgname|pat]+  
  36.         whatreplaces [-A] [pkgname|pat]+  
  37.    
  38. Options:  
  39.         -A            Query all packages not just thoseinstalled  
  40.         -V[<level>]       Set verbosity level to <level>.  
  41.         --verbosity[=<level>]   Verbosity levels:  
  42.                                         0errors only  
  43.                                         1normal messages (default)  
  44.                                         2informative messages  
  45.                                         3 debug  
  46.                                         4 debuglevel 2  
  47.         -f <conf_file>          Use <conf_file> as the opkgconfiguration file  
  48.         --conf <conf_file>  
  49.         --cache <directory>     Use a package cache  
  50.         -d <dest_name>          Use <dest_name> as the the rootdirectory for  
  51.         --dest <dest_name>      package installation, removal, upgrading.  
  52.                                 <dest_name>should be a defined dest name from  
  53.                                 theconfiguration file, (but can also be a  
  54.                                 directory namein a pinch).  
  55.         -o <dir>                Use <dir> as the rootdirectory for  
  56.         --offline-root <dir>    offline installation of packages.  
  57.         --add-arch<arch>:<prio>        Registerarchitecture with given priority  
  58.         --add-dest<name>:<path>        Registerdestination with given path  
  59.    
  60. ForceOptions:  
  61.         --force-depends         Install/remove despite faileddependencies  
  62.         --force-maintainer      Overwrite preexisting config files  
  63.         --force-reinstall       Reinstall package(s)  
  64.         --force-overwrite       Overwrite files from other package(s)  
  65.         --force-downgrade       Allow opkg to downgrade packages  
  66.         --force-space           Disable free space checks  
  67.         --force-postinstall     Run postinstall scripts even in offlinemode  
  68.         --force-remove  Remove package even if prerm script fails  
  69.         --noaction              No action -- test only  
  70.         --download-only No action -- downloadonly  
  71.         --nodeps                Do not follow dependencies  
  72.         --nocase                Perform case insensitivepattern matching  
  73.         --force-removal-of-dependent-packages  
  74.                                 Remove packageand all dependencies  
  75.         --autoremove            Remove packages that were installed  
  76.                                 automaticallyto satisfy dependencies  
  77.         -t                      Specify tmp-dir.  
  78.         --tmp-dir               Specify tmp-dir.  
  79.  regexp could be something like 'pkgname*''*file*' or similar  
  80.  e.g. opkg info 'libstd*' or opkg search'*libop*' or opkg remove 'libncur*'  
  81. root@Jack:/tmp/opkg-lists#  



 

若是你想要安裝一個軟件,可是不知道什麼具體的名字,能夠用命令獲取到軟件包的名字(opkg list |grep 軟件名),而後安裝,好比我想要安裝tftp.net

 

[plain]  view plain copy
 
  1. root@Jack:/tmp/opkg-lists# opkg list|grep tftp  
  2. atftp- 0.7-1 - TFTP client  
  3. atftpd- 0.7-1 - TFTP server  
  4. erlang-inets- 5.8 - Erlang/OTP is a general-purpose programming language and runtimeenvironment. Erlang has built-in support for concurrency, distribution  and fault tolerance. . This Erlang/OTPpackage provides a container for Internet clients and  servers. Currently a FTP client, a HTTPclient and server, and a tftp  client andserver have been incorporated in Inets.  
  5. iputils-tftpd- 20101006-1 - Program tftpd from iputils Trivial File Transfer Protocolserver.  
  6. kmod-ipt-nathelper- 3.7.10-1 - Default Netfilter (IPv4) Conntrack and NAT helpers Includes: - ftp- irc - tftp  
  7. tftp-hpa- 0.48-3 - An enhanced version of the BSD TFTP client  
  8. tftpd-hpa- 0.48-3 - An enhanced version of the BSD TFTP server  



 

經過上面的命令我找到我想要的tftp服務器的名字爲tftpd-hpa,這樣就能夠先用debug

 

[plain]  view plain copy
 
  1. #opkgdownload tftpd-hpa  



 

下載軟件包,而後用

 

[plain]  view plain copy
 
  1. #opkginstall tftpd-hpa  



 

來安裝。也能夠直接用

 

[plain]  view plain copy
 
  1. #opkg installtftpd-hpa  



 

會直接先下載再自動安裝。最後用

 

[plain]  view plain copy
 
  1. #opkglist-installed |grep tftpd-hpa  



 

來查看是否是已經安裝上了!

 

頁面安裝

進入頁面system->software

在filter裏面輸入「tftpd」,點擊「find package」,在下面的框中就顯示出當前openwrt支持的軟件包,找到須要的,點擊install便可。見下圖

相關文章
相關標籤/搜索