Apr 6, 2011

Forcing 32bit packages on 64bit Debian/Ubuntu/Mint

A very common problem for someone who plays with CAD on Linux is the mismatch between the package's and the system's architecture.
My suggestion is to use 32bit OS with ARES/Bricscad/DraftSight
but this is not always possible.
Some reasons are:
  • You have already installed a 64bit OS and you don't want to perform a new clean install of 32bit OS
  • You have already bought a commercial application that is 64bit only like Abaqus, NX, Maya.
  • Your common tasks include stuff that perform much better on 64bit architecture, like rendering, and you don't like to loose this benefit.
So let's take a look how to fix this simple problem:
I want to mention that Bricscad is marked as architecture independent package so it could be installed via gdebi/software center like any package that has common architecture with your system. However it's recommended to take a look on how dependencies work because different packaging within different versions may cause problems.

1. Working directory
First you have to understand how terminal works and especially the working directory. For a successful installation of a package you need to define the full path to the package or the directory that contains the package to be your working directory in terminal.You can change working directories with the command cd. There are some tweaks like the package nautilus-open-terminal which allows you to open a directory in terminal directly from Nautilus, (XFCE and KDE file managers have this option by default), drag 'n' drop the package into the terminal (so the full path to the package is defined). I prefer a different way.
Just move your .deb package into your home folder !! Now the default working directory of the terminal and the directory that contains the package are the same. You don't have to use cd or other tweaks.

2. Super user
In order to install a package on a Linux system you need administrative privileges. When working with terminal this means using sudo before the command (Mint/Ubuntu) or changing the user to root with su (Debian). Tip: when typing your password in terminal you will not see anything. Don't worry, this happens for security reasons.

3. Dependencies
Package dependencies are installed automatically when your package and your system have the same architecture but when you want to "--force" packages this doesn't happen. A very useful command is
dpkg-deb -I package_name  (where package_name the full name of your deb package. Tip: just type the first 2-3 letters and press tab, the full name appears automatically) which gives you a full description of the package that includs the dependencies.
You will have to install manually any missing dependencies.


4. Installing the package
Make the system to skip the architecture check with the command
sudo dpkg -i --force-architecture package_name

Troubleshooting:
Missing dependency: your system informs you that a needed package is missing:
Install it with sudo apt-get install missing_package (where missing_package the name of your missing package) or via synaptic/software center.
Dependency that cannot be found: The sudo apt-get install missing_package returns an error that your demanding package does not exist. This will be caused by different reasons. 1) the CAD vendor marked a dependency with wrong name, the package exists on your distro's repositories but with a different name : for example libc6-i386 and libc6-i686 is the same package with two different names. This bug affected an older version of ARES CE. If you are in this case simply make your system to ignore this dependency with adding the "--ingnore-depends=missing_package" but make sure that the correct-named needed package is already installed.
2) Your distro updated the packages and the dependency doesn't exist any more on the repositories. This is going to happen when you try to install your CAD packages  in a newer OS. Currently this doesn't affect CAD packages like ARES/Bricscad/DraftSight that are new and fit to current distros. But you cannot be sure that the CAD package which you bought in early 2011 will fit in a distro of 2015. And probably you don't want to spend extra money to update your CAD software. This case has 2 solutions: a) Find, download and install the older package manually. You can use packages.debian.org or packages.ubuntu.com as sources. b) create a symlink that points from the newer to the older version of the missing library (for more experienced users, "ln -s" command).

No comments:

Post a Comment