OpenWrt IPK Package Installation

Source: Internet
Author: User

When make menuconfig to cut OpenWrt, in order to make the system more small, we will be part of the function in the "module" of the way to compile, that is not programmed into the kernel, only later users can install and uninstall.


Package Installation Examples

The following are configuration items about Lua:

Among them Json4lua, Lua-cjson, Lua-copas, Lua-coxpcall are not programmed into the native system.

After make is complete.

Under the bin/ar71xx/packages/path are all IPK installation packages. The corresponding installation package is in the bin/ar71xx/packages/packages/directory.

$ ls lua*lua-cjson_2.1.0-1_ar71xx.ipk lua-rs232_1.0.3-1_ar71xx.ipklua-copas_2.0.0-1_ar71xx.ipk luasocket_3.0-rc1 -20130909-3_AR71XX.IPKLUA-COXPCALL_1.15.0-1_AR71XX.IPK luasql-mysql_2.3.0-1_ar71xx.ipkluaposix_v33.2.1-4_ AR71XX.IPK LUASQL-SQLITE3_2.3.0-1_AR71XX.IPK

How to install it on OpenWrt?

First, the IPK packet is sent to the OPENWRT system using SCP. The IP of my OpenWrt is 192.168.1.2, take Luasql as an example

$ SCP luasql-mysql_2.3.0-1_ar71xx.ipk [email protected]:[email protected] ' s password: < enter password >luasql-mysql_ 2.3.0-1_AR71XX.IPK 100% 6441 6.3kb/s 00:00

SSH login OpenWrt to view the file. The LUASQL-MYSQL_2.3.0-1_AR71XX.IPK is already under the/root/directory.

# opkg Install luasql-mysql_2.3.0-1_ar71xx.ipkinstalling luasql-mysql (2.3.0-1) to root ... Collected errors: * Satisfy_dependencies_for:cannot satisfy the following dependencies for Luasql-mysql: * LIBMYSQLCL ient * * Opkg_install_cmd:cannot install package luasql-mysql.

Oops, apprenticeship weak (do not panic, this is often encountered) ~ lack of libmysqlclient library.

Let's see if the IPK bag in the Libmysqlclient library is there. If there is no bin/ar71xx/packages path, then make Menuconfig is not added. At this point, modify the configuration, and then make a bit of it.

Find it under the bin/ar71xx/packages/path.

$ find-name "libmysqlclient*"./packages/libmysqlclient_5.1.73-1_ar71xx.ipk

Yes! Then you don't have to make it again.

Similarly, the LIBMYSQLCLIENT_5.1.73-1_AR71XX.IPK file is transferred to OPENWRT with SCP.

$ SCP libmysqlclient_5.1.73-1_ar71xx.ipk [email protected]:

Then install the IPK package that you just sent over in OpenWrt SSH.

# opkg Install LIBMYSQLCLIENT_5.1.73-1_AR71XX.IPK installing libmysqlclient (5.1.73-1) to root ...  Collected errors: * Satisfy_dependencies_for:cannot satisfy the following dependencies for Libmysqlclient: * uclibcxx * * Opkg_install_cmd:cannot Install package libmysqlclient.

Oops~again,libmysqlclient also relies on the Uclibcxx library. Install the Uclibcxx library.

$ SCP base/uclibcxx_0.2.4-1_ar71xx.ipk [email protected]:
# opkg Install UCLIBCXX_0.2.4-1_AR71XX.IPK installing Uclibcxx (0.2.4-1) to root ... Configuring Uclibcxx.

Uclibcxx Library OK.

Then install the Libmysqlclient library.

# opkg Install LIBMYSQLCLIENT_5.1.73-1_AR71XX.IPK installing libmysqlclient (5.1.73-1) to root ... Configuring Libmysqlclient.

Libmysqlclient Library OK.

Finally install the Luasql library

# opkg Install luasql-mysql_2.3.0-1_ar71xx.ipkinstalling luasql-mysql (2.3.0-1) to root ... Configuring Luasql-mysql.

In this way, the Luasql library installation is complete.

In the/usr/lib/lua/directory of the OPENWRT system, there is a luasql directory with a mysql.so file in the directory.

Try to start Lua:

# LuaLua 5.1.5 Copyright (C) 1994-2012 lua.org, Puc-rio (double int32) > Require ' Luasql.mysql '

Success.


Use of opkg

Opkg is somewhat similar to the DPKG Package management tool in Ubuntu. A common use is to install and uninstall packages.

Usage: opkg [options ...]  sub-command [arguments ...] where sub-command is one of:package manipulation:    update             update list of available  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 per invocation) Informational commands:    list             list available packages    list-installed         List installed packages    list-upgradable         List 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 or description  matches <regexp&Gt;    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 versions using <= < > >= = << >>     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 those installed    -v[<level>]         Set verbosity level to <level>.    --verbosity[=< level>]    verbosity levels:                     0 errors only                     1 normal messages  (default )                      2 informative messages                     3 debug                     4 debug level 2     -f <conf_file>        Use < conf_file> as the opkg configuration file    --conf < conf_file>    --cache <directory>    use a  package cache    -d <dest_name>         use <dest_name> as the the root directory for    --dest  <dest_name>    package installation, removal, upgrading.                 <dest_name>  should be a defined dest name from                 the configuration file,  (But can  also be a                 directory name in a pinch) .    -o <dir>         Use <dir> as the root directory  For    --offline-root <dir>    offline installation  of packages. &Nbsp;  --add-arch <arch>:<prio>    register architecture  with given priority    --add-dest <name>:<path>     Register destination with given pathForce Options:     --force-depends        Install/remove despite  failed dependencies    --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&nbSp;space checks    --force-postinstall    run postinstall  scripts even in offline mode    --force-remove     remove package even if prerm script fails    -- Force-checksum    don ' t fail on checksum mismatches     --noaction        no action -- test only     --download-only    no action -- download only     --nodeps        Do not follow  Dependencies    --nocase        perform case  insensitive pattern matching    --force-removal-of-dependent-packages                 remove package and all  dependencies    --autoremove        remove  packages that were installed                 automatically to 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* '


OpenWrt IPK Package Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.