Skip to content

Installing lazarus replaces fpc with version from debian

Hello, i need to crosscompile lazarus project on docker to windows, but debian package of fpc does not allow for cross compilation. Therefore im using your image. But it does not contain lazarus. When i try to install lazarus, it does pull fpc from debian as dependency, which denies the reason why i was using your image in the first place...

Is there way to install lazarus while still being able to crosscompile from debian to windows?

This is example of what goes wrong. Note different fpc version before and after:

# podman run -it --rm freepascal/fpc:3.2.2-bookworm-full /bin/bash
# fpc
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
# apt update
# apt install lazarus

..... TRUNCATED ......

Setting up fp-compiler-3.2.2:amd64 (3.2.2+dfsg-20) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
Configuring fp-compiler-3.2.2:amd64
-----------------------------------

FPC now supports having multiple versions installed on the same system. The update-alternatives command can be used to set a default version for
 * fpc (the compiler);
 * fpc.cfg (the configuration file);
 * fp-utils (the helper tools).


Whatever version you may choose as default, the configuration files are always backward compatible, so it should always be safe to use the latest version.

In order to use the alternatives system on the system wide FPC configuration file you must accept renaming "/etc/fpc.cfg"; otherwise you will need to manage this manually by yourself.

Rename "/etc/fpc.cfg" to "/etc/fpc.cfg.bak"? [yes/no] yes

update-alternatives: using /usr/bin/x86_64-linux-gnu-fpc-3.2.2 to provide /usr/bin/fpc (fpc) in auto mode
update-alternatives: warning: not replacing /usr/bin/fpc with a link
update-alternatives: warning: not replacing /usr/bin/fpcres with a link
update-alternatives: warning: not replacing /usr/bin/fpcmkcfg with a link
update-alternatives: using /etc/fpc-3.2.2.cfg to provide /etc/fpc.cfg (fpc.cfg) in auto mode
update-alternatives: using /usr/bin/fpc to provide /usr/bin/pc (pc) in auto mode

..... TRUNCATED ......

# fpc
Free Pascal Compiler version 3.2.2+dfsg-20 [2023/03/30] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others

Thanks for your time.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information