PureOS + Buster 32bit HOWTO


#1

Abstract

PureOS support for running i386 binaries is broken by the absence of i386 architecture in the distribution. This can be worked around in the following fashion:

  • Install Debian buster (i386 architecture) inside the chroot
  • Configure dynamic linker to look for shared libraries also in the chroot
  • Leverage the chroot environment to install all needed shared libraries and keep them updated.

The gory details follow.

1. setup a chroot

Launch terminal, get root by sudo su, and do:

root@ayers2:~# apt-get install debootstrap
root@ayers2:~# mkdir /srv/busteri386
root@ayers2:~# debootstrap --arch i386 buster /srv/busteri386 http://deb.debian.org/debian
You may want to use another debian mirror

Instead of http://deb.debian.org/debian, you may want to use another mirror. It might be faster. Refer to Debian mirror list or use netselect-apt. Be careful with netselect-apt though, as it will happily overwrite /etc/apt/sources.list if you don’t tell it to write the result somewhere else.

edit /srv/busteri386/etc/apt/sources.list so it contains:

deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian-security buster/updates main

Make sure the chroot is up to date

root@ayers2:~# chroot /srv/busteri386
root@ayers2:/# apt-get update
root@ayers2:/# apt-get upgrade
root@ayers2:/# exit

2. Configure dynamic linker

The magic commands are:

root@ayers2:~# cd /lib
root@ayers2:/lib# ln -s /srv/busteri386/lib/ld-linux.so.2 .
root@ayers2:/lib# ln -s /srv/busteri386/lib/i386-linux-gnu .
root@ayers2:/lib# cd
root@ayers2:~# cp /srv/busteri386/etc/ld.so.conf.d/i386-linux-gnu.conf /etc/ld.so.conf.d/.
root@ayers2:~# rm /etc/ld.so.cache
root@ayers2:~# ldconfig

And that is it. The core support for i386 applications is installed.

3. Example usage: make Drox Operative game run.

This game is simple to setup because it consists of single executable.
First step is to enumerate missing shared librarires:

dwaff@ayers2:~/games/drox/Drox-Operative$ ldd DroxOperative | grep 'not found'
        libGL.so.1 => not found
        libopenal.so.1 => not found

Next, find out which packages they are in. Go to https://www.debian.org/distrib/packages#search_contents, enter libGL.so.1 in the keyword field, choose distribution stable, architecture 32-bit PC (i386), click search. Repeat for the other library. In this example case the packages in question are:
libgl1 (for libGL.so.1) and libopenal1 (for libopenal.so.1).

Install them:

dwaff@ayers2:~/games/drox/Drox-Operative$ sudo su
root@ayers2:/home/dwaff/games/drox/Drox-Operative# chroot /srv/busteri386
root@ayers2:/# apt-get install libgl1 libopenal1
root@ayers2:/# exit
root@ayers2:/home/dwaff/games/drox/Drox-Operative# exit

The game now can be run. Screenshot or it did not happen :slight_smile:

4. Keeping chroot up-to-date.

I have no good solution for this part. For now, I enter the chroot when I remember it and do apt-get update; apt-get upgrade in there. I’m looking for suggestions how to plug that into the Gnome Software, so it does that for me automatically.


#2

yes but sudo su first requires that the account you are using to issue this command from to be into the sudoers file … no? at least this is how it is on my machine …

good initiative for x86 arch …


#3

Yes it does. And it is so by default on fresh PureOS install.


#4

Thanks @Dwaff for this. Good piece of information here.


#5

:heart: :laughing: I love that aside type inline commentary.


#6

and HOWTO in CAPS … :smiley:


#7

@Dwaff
Hi Sir,
I try to install crossover 19.0.1
it needs i386 architecture
so i followed your instructions.
I wonder if you could please help with the following output from my terminal:

sherabk@sherab-VM-PureOS:~/Downloads$ sudo apt-get install ./crossover_19.0.0-1.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'crossover:i386' instead of './crossover_19.0.0-1.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 crossover:i386 : Depends: libc6:i386 (>= 2.11) but it is not installable
                  Depends: libx11-6:i386 but it is not installable or
                           xlibs:i386 but it is not installable
                  Depends: libxext6:i386 but it is not installable or
                           xlibs:i386 but it is not installable
                  Depends: libxi6:i386 but it is not installable
                  Depends: libfreetype6:i386 but it is not installable
                  Depends: libpng12-0:i386 but it is not installable or
                           libpng16-16:i386 but it is not installable
                  Depends: libz1:i386 but it is not installable
                  Depends: libnss-mdns:i386 but it is not installable or
                           lib32nss-mdns:amd64 but it is not installable
                  Depends: libcups2:i386 but it is not installable
                  Depends: liblcms2-2:i386 but it is not installable
                  Depends: libglu1-mesa:i386 but it is not installable
                  Depends: libxcursor1:i386 but it is not installable
                  Depends: libxrandr2:i386 but it is not installable
E: Unable to correct problems, you have held broken packages.
sherabk@sherab-VM-PureOS:~/Downloads$ 

Many thanks in advance


#8

My instructions allow for 32bit support, but they do not integrate it with apt. On the contrary, they work around package conflicts by installing 32bit libs inside a chroot.

So you can’t install 32bit debs on your main system. It will trigger a lot of conflicts, as you are seeing with crossover, and installation will fail.

But there is a way:

  1. Install crossover.deb inside a chroot. This will pull a whole lot of 32bit dependencies in.
  2. Download install-crossover-19.0.0.bin from codeweavers and run this one on the main system.

And there may be other gotchas. For example when setting up Neverhood, the setup program shows in advanced options that additional packages need to be installed:


Those two packages libsane and libxslt1.1 need to be installed inside the chroot, and the checkbox saying The following Unix pacakges… needs to be unchecked.

Other programs may of course need different extra packages. Everything 32bit must go into the chroot.

The Neverhood screenshot

That’s how it worked for me, with crossover trial version.