gbs chroot

Use the chroot subcommand to chroot to the build root directory, which is generated by the GBS build.

For command usage details, enter:

$ gbs chroot --help


The default location of the build root is located in ~/GBS-ROOT/local/scratch.{arch}.*. The location is different if the -B option is specified while running the GBS build.


  • Create a build root with extra packages added to the build root:

    $ gbs build --extra-packs=zypper,vim -A i586 # install zypper,vim to build root

    For more GBS build options, see gbs build.

  • Chroot to the build root:

    $ gbs chroot ~/GBS-ROOT/local/scratch.i686.0/
  • Chroot as a “root” user:

    $ gbs chroot -r ~/GBS-ROOT/local/scratch.i686.0/

    If the command fails with a “su: user root does not exist” error, it is caused by a Tizen repository. Fix the problem by adding a root user manually by editing the following 2 files:

    $ echo "root:x:0:0:root:/root:/bin/bash" >>path/to/buildroot/etc/passwd
    $ echo "root:x:0:" >>path/to/buildroot/etc/group
  • Chroot and install extra packages into the build root directory for development purposes:

    chroot as 'root':
    $ gbs chroot -r ~/GBS-ROOT/local/scratch.i686.0/
    Configure tizen repo in the chroot env:
    # zypper ar<release_id>/repos/main/ia32/packages tizen-main
    # zypper ar<release_id>/repos/base/ia32/packages tizen-base
    Install extra packages, for example, install gdb.
    # zypper refresh
    # zypper -n install gdb gcc

    For https repositories, you must specify the ssl_verify=no option:

    # zypper ar<release_id>/repos/main/ia32/packages/?ssl_verify=no tizen-main


  • To use the gbs chroot command as “root”, specify the -r option. Then zypper can be used to install and remove packages.
  • To install packages in the build root environment, specify the -n option:
    zypper -n install gdb