Recent

Author Topic: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?  (Read 6268 times)

Hartmut

  • Sr. Member
  • ****
  • Posts: 280
During an automatic System-Update my Lazarus Installation was automaticilly deinstalled. In Synaptic I can still see fpc, fpc-3.0.4 and fpc-source-3.0.4, but fpc-source and Lazarus are missing. I am not amused.

This is the way how I installed Lazarus 1.8.4 with fpc 3.0.4 less then 2 days ago:
1) uninstalled all fpc* and lazarus* packages
2) downloaded 3 packages (fpc, fpc-src and lazarus) from the web site (http://www.lazarus-ide.org/)
3) moved this 3 packages to my home folder
4) installed package "libgtk2.0-dev"
5) executed "sudo dpkg -i ~/*.deb" in my home folder

Bevor I repeat the next installation, I want to learn how to prevent another automatic deinstallation.

I heared about version locking with Synaptic, but did this never before. I found there Menu "Package / Lock version". Is this the right way? Which packages exactly must I lock (there are so many after Lazarus/fpc is installed)?

I am a bloody beginner on Linux (started just a week ago). So please be a little more detailed with your answers. My Ubuntu is 18.04. Thanks a lot in advance.
« Last Edit: August 31, 2018, 09:36:19 pm by Hartmut »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
Uhhh... you are not the first one. :(
There is another active thread about the issue as you may have noticed:
 http://forum.lazarus-ide.org/index.php/topic,42387.0.html

A short answer is: avoid .dep packages.
Longer answers are in the other thread.

People, we should add a sticky forum post explaining the easiest ways to install FPC and Lazarus in Debian related systems.
Only the last option would be to use .deb packages. They must not be recommended for new Linux users, or maybe not for anybody.

Handoko

  • Hero Member
  • *****
  • Posts: 3185
  • My goal: build my own game engine using Lazarus
@Hartmut

I only version locked the fpc package. So far never have any issue.

On Synaptic Package Manager, the version-locked item can be found by clicking Status > Pinned. That item usually marked red and has a padlock icon at its side.

Note:
This thread is similar with:
https://forum.lazarus.freepascal.org/index.php/topic,42387.0.html
Moderator, please merge them together.
« Last Edit: August 30, 2018, 11:02:23 am by Handoko »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
This thread is similar with:
https://forum.lazarus.freepascal.org/index.php/topic,42387.0.html
Moderator, please merge them together.
IIRC there are hundreds of similar threads. Then we should merge them all. Not realistic.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 831
This thread is similar with:
https://forum.lazarus.freepascal.org/index.php/topic,42387.0.html
Moderator, please merge them together.
IIRC there are hundreds of similar threads. Then we should merge them all. Not realistic.
Maybe create a wiki page with explanation and possible solutions? Maybe a FAQ?

Hartmut

  • Sr. Member
  • ****
  • Posts: 280
There is another active thread about the issue as you may have noticed:
http://forum.lazarus-ide.org/index.php/topic,42387.0.html

A short answer is: avoid .dep packages.
Longer answers are in the other thread.

I walked through that topic twice and for me as an absolute beginner to Linux it is extremely hard to understand. What I learned is, that installation of Lazarus on Ubuntu is a common problem and that most people say "avoid *.deb files".

But the problem of dfergfla was an automatic update of his FPC, my problem was the  automatic deinstall of Lazarus.

From that topic I could not extract clear instructions about the right way to install Lazarus on Ubuntu. Only for Manjaro, but I don't want to change my distribution now. So I hope for clear and easy instructions for Ubuntu 18.04, that an absolute beginner can master. Thanks in advance.
« Last Edit: August 30, 2018, 01:16:32 pm by Hartmut »

Hartmut

  • Sr. Member
  • ****
  • Posts: 280
I only version locked the fpc package. So far never have any issue.

@Handoko: hello again.

Are you sure that a lock on fpc is my solution? My problem was the deinstall of Lazarus, not an update of fpc.

And what would you recommend how to repeat my Lazarus installation?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7499
To me it sounds like a conflict between external repo and in-repo packages.

That could be avoided by renaming the external (lazarus site) packages to set them clearly apart. (renaming at the package file level, not just the filename)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
But the problem of dfergfla was an automatic update of his FPC, my problem was the  automatic deinstall of Lazarus.
Makes no difference. The system got screwed after using external packages. I have seen that many times.

Quote
So I hope for clear and easy instructions for Ubuntu 18.04, that an absolute beginner can master. Thanks in advance.
Here comes:
First uninstall the external FPC and Lazarus packages. Then:
Code: [Select]
sudo apt-get install subversionif you don't have subversion installed already. Then:
Code: [Select]
sudo apt-get install fpcThis gives you the distro's "official" FPC, either 3.0.2 or 3.0.4. They are good for compiling Lazarus. Then in your home dir:
Code: [Select]
svn co https://svn.freepascal.org/svn/lazarus/branches/fixes_1_8/ lazarus_1_8
cd lazarus_1_8
make
./lazarus
...and there you go!
Actually it requires GTK2 related development packages but I guess you already have them after your experiments.
« Last Edit: August 30, 2018, 01:34:50 pm by JuhaManninen »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
To me it sounds like a conflict between external repo and in-repo packages.
That could be avoided by renaming the external (lazarus site) packages to set them clearly apart. (renaming at the package file level, not just the filename)
Let's not confuse him more. :)

Handoko

  • Hero Member
  • *****
  • Posts: 3185
  • My goal: build my own game engine using Lazarus
I only version locked the fpc package. So far never have any issue.
Are you sure that a lock on fpc is my solution? My problem was the deinstall of Lazarus, not an update of fpc.

Your case might be different. But what happened on my case was my Ubuntu was holding a broken package (which caused by the software update), I knew it because I checked using Synaptic Package Manager. I simply uninstalled that broken package, reboot the computer, remove all the lazarus/fp* related items and reinstall the things I want ... everything just back to normal.



For you information. You should use the installation provided by Ubuntu, it is the most easiest thing to do. Unless, you want to use the version you that has not been available on the Ubuntu repository yet. For example, Lazarus just makes a new release available.

All this Lazarus-Ubuntu troubles only happen because you're not using the installation packages provided by your Ubuntu. I'm not sure but I guess Lazarus 1.8.4 should now already been available on Ubuntu repository.

So for ubuntu users: don't use the deb files downloaded from SourceForge.

But if you're adventurous :D, here are my advices:

Make sure you have some knowledge in using Linux Terminal or at least you've already installed some tools to make it easier. I'm not very good in using Linux Terminal, so I prefer the GUI tools. I recommend Synaptic Package Manager and GDebi.

Pay attention and write down all the steps you're doing. So you can review and roll back if anything goes wrong.

You may need to disconnect the Internet. Not always but it ever happened on my test, Ubuntu automatically downloaded and forced me to use the packages from its repository when installing Lazarus/FPC from the deb files I got from SourceForge.

And don't forget doing version locking.



My solution is not the only solutions. You may tried @JuhaManninen suggestion to manually build your own Lazarus or @bylaardt trick to modify the deb files. I haven't tried them but they should work.

JuhaManninen's how to build your own Lazarus from source:
https://forum.lazarus.freepascal.org/index.php/topic,42393.msg295887.html#msg295887

bylaardt's how to modify the deb files:
https://forum.lazarus.freepascal.org/index.php/topic,41333.msg287683.html#msg287683
« Last Edit: August 30, 2018, 02:37:53 pm by Handoko »

Hartmut

  • Sr. Member
  • ****
  • Posts: 280
You should use the installation provided by Ubuntu, it is the most easiest thing to do ... All this Lazarus-Ubuntu troubles only happen because you're not using the installation packages provided by your Ubuntu.

My very 1st Lazarus Installation was by "sudo apt-get install lazarus" which I think is the "official Ubuntu way", or not? But exactly with this installation we had so much trouble, see http://forum.lazarus.freepascal.org/index.php/topic,42364.0.html. So for now I wanted to go another way.

First uninstall the external FPC and Lazarus packages. Then:
Code: [Select]
sudo apt-get install subversionif you don't have subversion installed already. Then:
Code: [Select]
sudo apt-get install fpcThis gives you the distro's "official" FPC, either 3.0.2 or 3.0.4. They are good for compiling Lazarus. Then in your home dir:
Code: [Select]
svn co https://svn.freepascal.org/svn/lazarus/branches/fixes_1_8/ lazarus_1_8
cd lazarus_1_8
make
./lazarus
...and there you go!

Thank you for this easy to follow instructions. I could execute them without problems. As a test I did an IDE rebuild and got no errors.

To be able to cross compile 32 bit programs then I tried the 9 steps from Handoko in http://forum.lazarus.freepascal.org/index.php/topic,42364.0.html reply #1, but step 7 gave me the same error message then 3 days before: "make: *** Keine Regel, um „clean“ zu erstellen.  Schluss". This means "no rule to create "clean". Finish" (see attached screenshot).

That meens my installation now has the same problem then my very 1st installation by "sudo apt-get install lazarus" :-((

My folder /usr/share/fpcsrc/3.0.4/ contains 4 folders and 2 files, but no Makefile (see screenshot).

What shall I do?
« Last Edit: August 30, 2018, 06:29:15 pm by Hartmut »

Handoko

  • Hero Member
  • *****
  • Posts: 3185
  • My goal: build my own game engine using Lazarus
I guess the problem is on step #6:
06. cd /usr/share/fpcsrc/3.0.4

The fpcsrc is not on the location. Where do you save the downloaded file? Is it on [your_home_folder]/lazarus_1_8 ?


Please ignore this post. :-[
« Last Edit: August 30, 2018, 07:26:10 pm by Handoko »

Hartmut

  • Sr. Member
  • ****
  • Posts: 280
Sorry, I don't understand your question.
Folder /usr/share/fpcsrc/3.0.4/ contains about 360 MB files.

The fpcsrc is not on the location. Where do you save the downloaded file?
Which location and which downloaded file do you mean? I followed the instructions of JuhaManninen exactly. Do you mean his svn-command? I used
"lazarus_1_8" as recommended. Thanks for your help!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
My folder /usr/share/fpcsrc/3.0.4/ contains 4 folders and 2 files, but no Makefile (see screenshot).
Maybe they are in a devel package, fpc-dev or similar. I don't have Ubuntu around now.
I did not know you need a cross-compiler. It is always more tricky than just installing a native compiler. I have not learned the cross-compiler stuff really, I always compile in a native OS using a virtual machine or so.