Openwrt安裝軟體的方法

來源:互聯網
上載者:User

Openwrt安裝軟體

簡介

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

安裝的方法主要有兩種,telnet或者ssh串連後台安裝和 頁面安裝。

下面的所有步驟的前提是當前的路由器已經連網!

telnet或ssh

原始的openwrt預設是沒有密碼的,只開啟了telnet沒有開啟ssh,當第一次配置完使用者名稱和密碼後,關閉了telnet開啟了ssh,使用者可以隨時連上路由器,下面我用ssh串連的。

Openwrt管理軟體包的命令是opkg,下面是命令的協助

root@Jack:/tmp/opkg-lists# opkg--helpopkg:unrecognized option `--help'opkgmust have one sub-command argumentusage:opkg [options...] sub-command [arguments...]wheresub-command is one of:PackageManipulation:        update           升級       Update list ofavailable packages        upgrade <pkgs>     升級某一個軟體     Upgrade packages        install <pkgs>     安裝某一個軟體     Install package(s)        configure <pkgs>    配置某一個軟體    Configure unpacked package(s)        remove <pkgs|regexp>  刪除軟體  Remove package(s)        flag <flag> <pkgs>      Flag package(s)        <flag>=hold|noprune|user|ok|installed|unpacked (one perinvocation) InformationalCommands:        list       列出openwrt所有支援的軟體包   List availablepackages        list-installed     列出本機已經安裝的軟體包     List installed packages        list-upgradable  列出可以升級的軟體包  ist installed and upgradable packages        list-changed-conffiles  List user modified configuration files        files <pkg>             List files belonging to<pkg>        search <file|regexp>    List package providing <file>        find <regexp>           List packages whose name ordescription matches <regexp>        info[pkg|regexp]    顯示軟體包的資訊   Display all info for <pkg>        status [pkg|regexp]   顯示軟體包的狀態  Display all status for <pkg>        download<pkg> 下載一個軟體包到目前的目錄 Download<pkg> to current directory        compare-versions <v1> <op><v2>                            compare versionsusing <= < > >= = << >>        print-architecture      List installable package architectures        depends [-A] [pkgname|pat]+        whatdepends [-A] [pkgname|pat]+        whatdependsrec [-A] [pkgname|pat]+        whatrecommends[-A] [pkgname|pat]+        whatsuggests[-A] [pkgname|pat]+        whatprovides [-A] [pkgname|pat]+        whatconflicts [-A] [pkgname|pat]+        whatreplaces [-A] [pkgname|pat]+ Options:        -A            Query all packages not just thoseinstalled        -V[<level>]       Set verbosity level to <level>.        --verbosity[=<level>]   Verbosity levels:                                        0errors only                                        1normal messages (default)                                        2informative messages                                        3 debug                                        4 debuglevel 2        -f <conf_file>          Use <conf_file> as the opkgconfiguration file        --conf <conf_file>        --cache <directory>     Use a package cache        -d <dest_name>          Use <dest_name> as the the rootdirectory for        --dest <dest_name>      package installation, removal, upgrading.                                <dest_name>should be a defined dest name from                                theconfiguration file, (but can also be a                                directory namein a pinch).        -o <dir>                Use <dir> as the rootdirectory for        --offline-root <dir>    offline installation of packages.        --add-arch<arch>:<prio>        Registerarchitecture with given priority        --add-dest<name>:<path>        Registerdestination with given path ForceOptions:        --force-depends         Install/remove despite faileddependencies        --force-maintainer      Overwrite preexisting config files        --force-reinstall       Reinstall package(s)        --force-overwrite       Overwrite files from other package(s)        --force-downgrade       Allow opkg to downgrade packages        --force-space           Disable free space checks        --force-postinstall     Run postinstall scripts even in offlinemode        --force-remove  Remove package even if prerm script fails        --noaction              No action -- test only        --download-only No action -- downloadonly        --nodeps                Do not follow dependencies        --nocase                Perform case insensitivepattern matching        --force-removal-of-dependent-packages                                Remove packageand all dependencies        --autoremove            Remove packages that were installed                                automaticallyto satisfy dependencies        -t                      Specify tmp-dir.        --tmp-dir               Specify tmp-dir. regexp could be something like 'pkgname*''*file*' or similar e.g. opkg info 'libstd*' or opkg search'*libop*' or opkg remove 'libncur*'root@Jack:/tmp/opkg-lists#

如果你想要安裝一個軟體,但是不知道什麼具體的名字,可以用命令擷取到軟體包的名字(opkg list |grep 軟體名),然後安裝,比如我想要安裝tftp

root@Jack:/tmp/opkg-lists# opkg list|grep tftpatftp- 0.7-1 - TFTP clientatftpd- 0.7-1 - TFTP servererlang-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.iputils-tftpd- 20101006-1 - Program tftpd from iputils Trivial File Transfer Protocolserver.kmod-ipt-nathelper- 3.7.10-1 - Default Netfilter (IPv4) Conntrack and NAT helpers Includes: - ftp- irc - tftptftp-hpa- 0.48-3 - An enhanced version of the BSD TFTP clienttftpd-hpa- 0.48-3 - An enhanced version of the BSD TFTP server

通過上面的命令我找到我想要的tftp伺服器的名字為tftpd-hpa,這樣就可以先用

#opkgdownload tftpd-hpa

下載軟體包,然後用

#opkginstall tftpd-hpa

來安裝。也可以直接用

#opkg installtftpd-hpa

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

#opkglist-installed |grep tftpd-hpa

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

 

頁面安裝

進入頁面system->software

在filter裡面輸入“tftpd”,點擊“find package”,在下面的框中就顯示出當前openwrt支援的軟體包,找到需要的,點擊install即可。見

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.