Before I start let me say that there may be easier or more direct ways to do this. This has the advantage of being pretty easy for me to do. I’m not going to discuss why you might want to do this, or what a jail is, etc..
You can get the most recent osc and build tools from the openSUSE:Tools repository. You will also need an account on the build service.
Create an empty directory
Go into that directory and create a dummy RPM .spec file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
BuildRequires: tag is where you specify which packages you want installed
in your jail, what I have listed there is just an example.
Also create an empty .osc directory (this prevents an ugly bug where the jail
tries to delete itself)
You’ll need to be logged in to OBS if you aren’t already
Enter your credentials at the prompts.
If for some reason that didn’t work you may need to put your password into your
Toward the bottom…
1 2 3
If your password changed you may need to delete any lines that say
passx=<GARBAGE>, or manipulate your GNOME Keyring.
Now you should be ready to build a jail
osc build --local-package --root=</path/to/new/jail> --alternative-project=openSUSE:<VERSION> <ARCH>
<VERSION> is, for example,
<ARCH> is only needed if you want a different arch (
i586 on an
</path/to/new/jail> is where you want the tool to put your jail (not the
directory you’re in!), I use
You may be prompted for your root password
When the jail is built (assuming it worked) it will fail complaining about an empty package, ignore that and get on with your life: you only wanted a jail, not a package.
At this point you can chroot into your jail
sudo chroot /path/to/new/jail
or if you are changing architectures…
sudo linux32 chroot /path/to/new/jail
Yay, you’re done!