Lazarus

Installation => Linux => Topic started by: geraldocg on March 21, 2017, 02:40:25 am

Title: (solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 21, 2017, 02:40:25 am
Hi,
I am using Ubuntu 16.04.2 64 bits,  just installed and updated, in a 64bits laptop .

Trying to install Lazarus-project_1.6.4-0_amd64.deb using "Ubuntu Software"   received message : "RAD tool for freepascal Lazarus is a free and opensource IDE and RAD tool for Free Pascal using the Lazarus component library LCL. The LCL is included in this package too. See http://www.lazarus.freepascal.org".

Trying to install with GDebi  the same message plus  " the dependency is not met : fpg(=3.02 | fp-compiler(=3.02)" . 'met' is for shure  a bad translation from portuguese 'dependĂȘncia' (dependency?).

There is also an info I suppose is about  RAD tool :
version 1.6.4
size 587,3 MB

Another problem is that I can't execute executables compiled  using an older Lazarus version in ubuntu 12.04-32bits (will not be able to find the version soon). Is that normal?

Thanks for any help

Geraldo


Title: Re: Error installing Lazarus in ubuntu
Post by: Handoko on March 21, 2017, 03:04:32 am
Hello geraldocg,
Welcome to this forum.

You should not use the Lazarus that come from your Ubuntu repository. For Ubuntu users, I recommend Synaptic Package Manager (instead of the default Ubuntu Software Manager).

First download the 3 debs file from Lazarus official website (via SourceForge):
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.6.4/

Because you have already tried to install Lazarus, you may need to clean up the previous installation:

01. Uninstall lazarus, fpc, fpc-src (use Ctrl+F shortcut on your Synaptic to search)
02. Delete ~/.lazarus
03. Delete /etc/fp* (fpc.bak, fpc.cfg, fppkg.bak, fppkg.cfg)
04. Delete /usr/share/fpsrc
05. Delete /usr/lib/fpc
06. Delete /usr/bin/ppc* (ppcarm, ppcross386, ppcrossarm, ppcx64)

After the cleaning up prosedure, then now Install the Lazarus:
07. Install fpc_3.0.2-170225_amd64.deb
08. Install fpc-src_3.0.2-170225_amd64.deb
09. Install lazarus-project_1.6.4-0_amd64.deb

Your Lazarus now should be able to start and run properly. But you should to lock your Lazarus/FPC to prevent Ubuntu to mess up your installation with its upgrades. To do it:

Start your Synaptic Package Manager > Select fpc, fpc-src, lazarus-project > menu item: Package > Lock Version.

Have fun!
Title: Re: Error installing Lazarus in ubuntu
Post by: JuhaManninen on March 21, 2017, 10:33:13 am
Yet another dependency problem with Ubuntu...
See also :
 http://forum.lazarus-ide.org/index.php/topic,36258.msg241382.html#msg241382

The recommendation for new Ubuntu users must be to switch their distro instead of explaining complex ways to fix the problems and then continue with it.
For some reason people keep up the hype and illusion that Ubuntu is a good desktop distro.

We recommend the latest Lazarus release!
New users should obviously choose a Linux distro that allows them to install the latest release without a hassle.
There are plenty of choices.
Title: Re: Error installing Lazarus in ubuntu
Post by: Fred vS on March 21, 2017, 06:00:45 pm
Hello.

I have installed new version of Lazarus on Linux Mint mate 64 following Handoko advices (many thanks for this).

OK, Lazarus installed and run.

But when trying to install a component (OPM), while recompiling Lazarus, there is that error:
 
Quote
Creation de l'EDI: Code de sortie 512 - Erreurs : 1
lazarus.pp(154,1) Error: Error while linking

Note that Lazarus was started with root permission:
Code: Pascal  [Select][+][-]
  1. # sudo startlazarus

Thanks.

Fre;D
Title: Re: Error installing Lazarus in ubuntu
Post by: Fred vS on March 21, 2017, 06:16:16 pm
Re-hello.

It seems that the problem comes from new fpc release.
( from https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.6.4/  )

Example:
Code: Pascal  [Select][+][-]
  1. program test;
  2. begin
  3. end.

---->
Code: Pascal  [Select][+][-]
  1. # fpc test.pas
---->
Quote
Free Pascal Compiler version 3.0.2 [2017/02/25] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld: /usr/lib/fpc/3.0.2/units/x86_64-linux/rtl/prt0.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
testnew.pas(3,1) Error: Error while linking
testnew.pas(3,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Fre;D
Title: Re: Error installing Lazarus in ubuntu
Post by: Thaddy on March 21, 2017, 06:23:26 pm
Just repeat. These linker errors are often due to lack of memory. (E.g: Rpi) Repeating the build cycle will skip everything done and has more space for linking.
Title: Re: Error installing Lazarus in ubuntu
Post by: Fred vS on March 21, 2017, 06:30:32 pm
Hello Thaddy.

Huh, after more than 100 times, same error.  :-[

I am busy to re-install fpc from http://www.freepascal.org/download.var (that was perfectly working).

So, it was only to note that this deb file has problem:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.6.4/fpc_3.0.2-170225_amd64.deb/download

Fre;D

 
Title: Re: Error installing Lazarus in ubuntu
Post by: Fred vS on March 21, 2017, 07:36:52 pm
Re-hello.

After re-installing fpc from http://www.freepascal.org/download.var ---> OK, it compiles and link perfectly.

Quote
fpc test.pas
Free Pascal Compiler version 3.0.2 [2017/02/06] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling test.pas
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
3 lines compiled, 1.3 sec

While loading Lazarus, in welcome form -->
Quote
Erreur :"fpc.cfg" manque.

Huh, /etc/fpc.cfg is there...
After ignoring the message, Lazarus load and re-compiling Lazarus was OK (including OPM new package).

Fre;D
Title: Re: Error installing Lazarus in ubuntu
Post by: Handoko on March 22, 2017, 08:23:18 am
Hi  Fred vS.

Can you tried to (re)install the older version to see if the problem is exist in the older versions? If it happens on FPC 3.0.2 only, then it may be a bug.

I remember when installing FPC, I got a warning message with red text. I said that the FPC 3.0.2 installation had conflict. I just ignored it and my Lazarus/FPC installation now seems to work correctly regardless the warning.
Title: Re: Error installing Lazarus in ubuntu
Post by: Fred vS on March 22, 2017, 12:48:04 pm
@Handoko.

Huh, all is re-working now. I t was lot of work to re-install all.
If I may there is something that I do not understand.
Why only give .deb file for installing "out of the box" Lazarus in Linux ?
For this I need to de-install all my fpc's (32/64 bit) that were working perfectly.
This because Lazarus.deb needs fpc installed via .deb.

Quote
But you should to lock your Lazarus/FPC to prevent Ubuntu to mess up your installation with its upgrades. To do it:

Then .deb is totally not needed (even worse better to not use it).

Sincerely, IMO, why Lazarus team does not do like fpc do  ---> a simple compressed file + a install.sh script that works, perfectly for all Linux distribution, without cry and without a single hair loosed.

Fre;D

Title: Re: Error installing Lazarus in ubuntu
Post by: geraldocg on March 22, 2017, 02:38:39 pm
Hi,
Thanks for your repply.
Followed Handoko instructions and Lazarus was installed without errors. Thanks !!!!!. Have not used it yet.
Regarding 16.04 not running executables compiled under 12.04 (32bits) I tried to run one of them in a terminal and got the error:

"./CAMCONT: error while loading shared libraries: libgdk_pixbuf-2.0.so.0: cannot open shared object file: No such file or directory"

Can this be corrected by installing (reinstalling) the lib cited?
If yes how?

Thanks for any help,
Geraldo
Title: Re: Error installing Lazarus in ubuntu
Post by: JuhaManninen on March 22, 2017, 02:49:16 pm
Then .deb is totally not needed (even worse better to not use it).
Yes, I don't know why there are so many problems. It seems to work in some machines though.
Fortunately there are other ways to install.

Quote
Sincerely, IMO, why Lazarus team does not do like fpc do  ---> a simple compressed file + a install.sh script that works, perfectly for all Linux distribution, without cry and without a single hair loosed.
Maybe because it is so very easy to get Lazarus from the SVN server. Just do:
 $ svn co http://svn.freepascal.org/svn/lazarus/branches/fixes_1_6 lazarus_1_6
and then "make".
As an extra bonus you get the latest backported bug fixes.
BTW, I have seen how people recommend the fpclazup tool for this simple task. I think it is misleading and even irresponsible towards new users. It is a complex tool, good for installing various versions of FPC and for cross-compilation, but for this easy task it is not needed.

The "svn co" command above is needed only once per a major release, currently for 1.6.x.
Then "svn up" will get the latest backported fixes.
Minimal hassle, minimal network traffic.
Title: Re: Error installing Lazarus in ubuntu
Post by: JuhaManninen on March 22, 2017, 03:16:12 pm
"./CAMCONT: error while loading shared libraries: libgdk_pixbuf-2.0.so.0: cannot open shared object file: No such file or directory"

Can this be corrected by installing (reinstalling) the lib cited?
If yes how?
My prediction is you will screw up the whole system.

Earlier I recommended other Linux distros for people who have such problems with Ubuntu. Maybe it was considered a joke but no, it was not a joke.
For example what is your motivation to use Ubuntu while it clearly does not work well as a desktop OS for your purposes?
Title: Re: (Solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 22, 2017, 04:41:17 pm
Copied all old project files and folders from old 12.04 HD to new, opened Nautilus, double clicked the copied  CAMCONT.lpr, Lazarus opened the project, compiled, build. Executable now 'executing'.
 Will do the same for other projects.
Thanks again,
Geraldo
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: Fred vS on March 22, 2017, 05:48:19 pm
Quote
maybe because it is so very easy to get Lazarus from the SVN server. Just do:
Yes, maybe, but (IMHO) a "out-of-the-box" compressed file (+ included install.sh script), like fpc does, has some advantages.
--> no need to install svn, you can share the zip file with everybody (without internet connection), you may look at the script and change it if you want.

Quote
For example what is your motivation to use Ubuntu while it clearly does not work well as a desktop OS for your purposes?
Because Ubuntu + Mint are the kings (I know, it is sad, see classement) ---> http://distrowatch.com

Fre;D
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: JuhaManninen on March 22, 2017, 08:00:11 pm
Yes, maybe, but (IMHO) a "out-of-the-box" compressed file (+ included install.sh script), like fpc does, has some advantages.
Yes, it is true. Somebody should only make those compressed packages during each release. Nobody has done it so far.

Quote
Because Ubuntu + Mint are the kings (I know, it is sad, see classement) ---> http://distrowatch.com
It only means that many other people use them, or at least look for information about them in distrowatch.
Those people may do it out of old habit, just like people here do.

I finally switched to a rolling distro because I wanted latest release versions of many programs. FPC was only one of them. I want latest features and security fixes for my browser. I want the best possible version of KDE. A new version of Plasma 5.x is practically always better than the previous. Why would I use a 2+ year old version?
I waited with the switch so long because I feared rolling distros are too unstable. It turned out to be the opposite. Manjaro has worked without issues. Earlier my Mint and Xubuntu got screwed when I had installed 3rd party packages. With Manjaro I don't need 3rd party packages because it already has the latest of everything. I believe I could break it by tweaking but I don't need to.
Both Arch and Manjaro have a huge selection of packages in their repos. I don't know who updates them all.

It is interesting to see how people stick with one distro because it was a cool thing over 10 years ago. Things have advanced since then.
Seeing the time wasted for discussing installation problems in this forum, the situation makes no sense.
I hope everyone with the problems will check if another distro would serve his needs better.

I have earlier mentioned SparkyLinux which is a rolling distro based on Debian testing. It updates packages too slowly for my taste but it could be a good compromise for people who are afraid of "bleeding edge" updates.
It does not have FPC 3.0.2 yet. It has now KDE frameworks 5.28, released over 4 months ago. Still much more recent than in Ubuntu derivatives. :)

Anyway, please remember that even the fast bleeding edge updates contain only released software. A new release is typically better than an old release. I don't see why a desktop system should hold back updates.
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 22, 2017, 11:18:20 pm
I know this is a Lazarus forum, but hope someone can help, or at least indicate a link related to my question, or a good Linux forum:
Even before installing Lazarus I noticed a lot of messages like " the system detected a problem in the application ..."
After I installed some programs like Gparted those messages are now much more frequent. Gparted for example blinks and disappears.
So, at Handoko's hint about Ubuntu Mate, I burned it's CD ,tried it and liked it most than Ubuntu.
When installing , "others OS"  were detected and  I choose to install alongside the others (W7,  16.04?). I was offered to resize partitions. But by the sum of the sizes offered  I concluded Mate would be installed in W7 partition. And what about 16.04? Will the sda3 extended partition be maintained and  16.04 included in grub menu?
My HD  partitions are:
Device       Inicialize    Start                 End          Sectors        Size  Id     Tipo(kind?)
/dev/sda1   *                2048           206847          204800     100M    7    HPFS/NTFS/exFAT
/dev/sda2                 206848   799921454   799714607  381,3G    7     HPFS/NTFS/exFAT
/dev/sda3          799922174   976771071   176848898    84,3G    5    extended
/dev/sda5          799922176   968581119   168658944    80,4G  83    Linux
/dev/sda6          968583168   976771071        8187904      3,9G  82    Linux swap / Sol

If Mate satisfied me I would delete the extended partition  and resize the other ones , but I am not sure what Mate will do with  sda3 and its contents.  I am afraid things get corrupted and loose a lot of time reinstalling W7 and Mate.

Thanks for any help (again),
Geraldo


Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 24, 2017, 03:18:32 pm
I apologize for reopening this post, but now it refers to installing Lazarus in Ubuntu Mate.
Ubuntu 16.04.2 started to show often the message: "system detected em error..." so I installed Ubuntu Mate.
In Mate I downloaded the three .deb packs and tried install the fpc one with DGebi. Error:" breaks the existing pack 'fpc' conflict: 'fpc'.
My big error, now I see, was deleting fpc from /user/bin.  Should have suspected that fpc was already installed.
In Synaptic fpc showed as installed and I tried total remove; error "sub-process /user/bin/fpc/dkpg returned an error (1).
I think fpc came installed in Mate, and deleting it in /user/bin messed everything.
I tried apt-get remove fpc   and apt-get purge fpc   and both commands returned the same error as Synaptic.
I tried again installing with GDebi but got the same error.
I am kind of a very cumbersome 'whitcher's apprentice".
Is there a solution?
Thanks,
Geraldo
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: JuhaManninen on March 24, 2017, 04:12:03 pm
Is there a solution?
I kind of gave you the solution but for some reason you ignored it.
The MATE desktop is also available in many distributions.
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: Handoko on March 24, 2017, 04:32:11 pm
Is there a solution?

Did you mean the conflict error message while installing FPC? I had same error too. I just simply ignored that error and the installation continued. I have tested to compile and run some projects, everything run properly, nothing bad happened.
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 24, 2017, 07:35:15 pm
JuhaManninem:
Excuse me for not replying to your suggestion on looking for another distro. I usually take the easiest  solution (bad thing), and it seemed to me that Ubuntu Mate was a tested one regarding Lazarus.
I have made only two Lazarus applications and recompiled another one made in Delphi 7, under XP. I want to have Lazarus just to make minor modification on these two. I am not very desperate because Lazarus is installed and working in Ubuntu 16.04.2 (dual boot with Mate). It is not an elegant solution, to say the least, but I can compile in UB16.04.2 and copy the executable to Mate. This is the only reason I don't erase UB 16.04.2.
Besides that I had a lot of work making Mate suit my needs, installing things and configuring then, so trying other distros is not in my near horizon  (perhaps later). I will search about  Manjaro. Thanks.

Handoko:
Ignored the error installing fpc and installed fpc-src whithout errors. Installing lazarus-project gave error: "not possible install all dependencies error found during processing of fpc".
Lazarus was not installed. Seems the mess I made was a big one.
Any other suggestion?
Thanks, Geraldo

Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: Handoko on March 24, 2017, 07:52:52 pm
Do as what I said on my very first post to clean up the installation, and reinstall again. That step-by-step I provided you never fails on my Ubuntu Mate.

Also, I guess you maybe need to install this package before you install Lazarus/FPC:
libc6-dev-x32 (use your Synaptic to search and install it)
Title: Re: (solved)Error installing Lazarus in ubuntu
Post by: geraldocg on March 25, 2017, 11:56:48 pm
Hi,
I finally could uninstall fpc and install Lazarus.
After running: sudo apt-get remove fpc, a lot of errors appeared.
Find in errors messages that the system was trying to write to files:
usr/lib/fpc/3.0.2/fpc-cross.cfg and usr/lib/fpc/samplecfg.
Well, to satisfy the system ( and crossing my fingers) I created both folders and files and send again the apt-get remove fpc command : no errors. In Synaptic fpc now appears as not installed.
Installed again, in the order Handoko suggested (didn't mind the error message installing fpc) and Lazarus is working ok; have already opened and run one of my projects.
My "solution" may not be an "by the book" one, but worked.
Thanks you all for the help, patience and good will.
Geraldo
TinyPortal © 2005-2018