Man Linux: Main Page and Category List


       dpkg-cross - manage libraries for cross compiling

Copyright and Licence

        Copyright (C) 1997-2000  Roman Hodek <>
        Copyright (C) 2000-2002  Colin Watson <>
        Copyright (C) 2002-2004  David Schleef <>
        Copyright (C) 2004  Nikita Youshchenko <>
        Copyright (C) 2004  Raphael Bossek <>
        Copyright (c) 2007-2008  Neil Williams <>

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


        dpkg-cross [ -v | --verbose ] [ -q | --quiet ] [ -A | --convert-anyway ]
        [ -X | --exclude PACKAGE ] [ -k | --keep-temp ] { -i | --install
        | -b | --build | -r | --remove | --purge | -s | --status | -l | --list
        | -L | --list-files | -u | --update | -Q | --query }
        { -a | --arch architecture} package [package ... ]


       dpkg-cross is a tool to install and manage libraries and header files
       for cross compiling. dpkg-cross converts native Debian packages for the
       target architecture to cross compiling support packages that can be
       installed on any architecture, but in different paths to avoid
       conflicts. It then calls dpkg to install the converted package. The
       conversion step alone can be done with the --build option. Other
       options are wrappers around corresponding dpkg functionality.

       dpkg-cross is intended to make it easier for you to keep your cross
       compiling libraries up-to-date, as it works directly on Debian
       packages. It saves you copying the libs and headers from a machine with
       your target  architecture, or extracting them via dpkg-deb

       dpkg-cross also collects and install the .shlibs files in -dev
       packages, which are needed by dpkg-shlibdeps.

       dpkg-cross works in the directories defined in
       /etc/dpkg-cross/cross-compile; see cross-compile(5) for more


       CMake cross-building support is experimental!

       CMake requires a little support from dpkg-cross to cross-build. The
       included cmake support file is an example for Linux kernels.  Use:

        rm CMakeCache.txt
        cmake -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt

       The  main changes involve setting PKG_CONFIG_LIBDIR within CMake an
       setting the include directories to locate the cross libraries installed
       by dpkg-cross e.g.

        #Make pkg-config look in the right place

       Packages using cmake may need some tweaks to debian/rules, e.g.

        ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
        export CC=$(DEB_HOST_GNU_TYPE)-gcc
        export CXX=$(DEB_HOST_GNU_TYPE)-g++
        export CMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt
        export CC=gcc
        export CXX=g++


       dpkg-cross follows the usual GNU command line syntax, with long options
       starting with two dashes ('-').


       Show summary of options.


       Be more verbose.


       Be more quiet.

        -a|--arch architecture

       Install for architecture architecture.


       Install Debian packages (.deb) named on the command line. Only files in
       the directories /lib, /usr/lib, /usr/X11R6/lib, /usr/include and
       /usr/X11R6/include are extracted, since only they can be relevant for
       cross compiling. In the lib directories, also no subdirectories are


       Convert Debian package even if it does not provide any files useful for
       cross-compile environment.

        -X|--exclude PACKAGE

       Removes the specified package from the dependencies of the current
       package. Typically used to drop dependencies on packages that are not
       required within a cross-build environment, e.g. packages containing
       only executables or architecture independent files.

       dpkg-cross can only check the current package and information about a
       dependency is not available (for that, use apt-cross). By default,
       dpkg-cross converts all dependencies to specify the cross version of
       the dependency package.

       If you know that a particular dependency should not be converted (it
       provides no useful files or is architecture  independent), that
       dependency can be excluded and dpkg-cross will remove that package from
       the dependency information of the cross package. -X has replaced the
       use of keepdeps and removedeps in /etc/dpkg-cross/cross-compile.

       -X|--exclude PACKAGE needs to be repeated for each package to be


       Keep the built and installed package instead of deleting it. Useful
       with apt-cross -k. Requires --install.


       Just build the converted Debian package, but do not install it with


       Remove the cross compiling packages named on the command line.


       Print status of the named packages.


       Print short version of status of named packages or package name


       List files belonging to the named packages.


       Update current cross-installation with Debian packages found in/under
       the paths given as arguments. Will check all packages there if they are
       installed already as cross-compiling packages and if they are really
       updates. Those packages will be installed as with -i.


       Much like --update, but just prints available update packages and does
       not install them.


       /etc/dpkg-cross/cross-compile defines some settings for dpkg-cross and
       can be overridden by an optional file in your home directory:
       $HOME/.dpkg-cross/cross-compile - see also apt-cross.

       Only default_arch is used routinely.

        default_arch (default: none)

       The default architecture for dpkg-cross is normally set by debconf.  To
       change the system-wide value, use:

        $ sudo dpkg-reconfigure dpkg-cross

       Alternatively, the default can be overridden on a per-user basis using
       the optional file in $HOME/.dpkg-cross/

       Other values previously used in this file for legacy code are now

Multiarch behaviour


       Any file in this directory will be expected to contain a simple list of
       binary package names which are multiarch-compliant for all uses of
       dpkg-cross on that system.

       apt-cross includes a helper script to identify these packages
       (/usr/share/apt-cross/ or you can use:

        grep-aptavail -s Package -F Multi-Arch same
        grep-aptavail -s Package -F Multi-Arch foreign
        grep-aptavail -s Package -F Multi-Arch allowed


       o   Absolute and total reliance on the accuracy of a config file
           created, updated and maintained by a separate process, e.g.
  from apt-cross.

       o   If this package name exists in that config file, create a multiarch

       o   multiarch versions have NO files in the package of any kind.

       o   multiarch versions have a mangled description indicating a zombie

       o   multiarch versions depend on the multiarch native package, i.e.
           libfoo-ARCH-cross depends on libfoo at or greater than the version
           of libfoo that first includes multiarch support.

       o   multiarch versions include a new control field: X-Multiarch: delete