Recent

Author Topic: Installing Lazarus 1.8.4 on Ubuntu 18.04  (Read 25396 times)

henrique_cof

  • Newbie
  • Posts: 3
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #60 on: January 07, 2019, 07:59:35 pm »
I would like to thank you, follow your tutorial and get install, thank you very much.

dbannon

  • Hero Member
  • *****
  • Posts: 568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #61 on: February 02, 2019, 04:59:09 am »
After a fairly unproductive discussion with another new user (about installing on Linux) on a thread near here, I just browsed across the relevant wiki pages. Sigh...

There is no lack of information, indeed I found ten pages on installing lazarus on Linux before I stopped counting. Some dating back to Ubuntu 10.04. Most generally accurate but not really helpful ! And, obviously, not being updated.

I sure don't feel like updating them because its not clear what the overall structure is and anything I add will just add to the confusion. Been my experience that this is a normal thing to happen to any well used wiki !

This forum thread by Handoko does have most answers but, being a forum, is full of differing opinions and, dare I (?), occasional misleading statements. And asking a new user to read a 60 post thread .....

I suggest a restructure of the whole thing, its been a "back of my mind" project for some time and considering how drastic what I propose is, would not start until I have heard a few people say "good idea" !

What I'd do is replace (slowly) http://wiki.freepascal.org/Installing_Lazarus with and overview of the process, why so many models, why some are more appropriate for some uses etc. No platform specific data, nothing that goes out of date quickly.

Then, 'under' that page, we'd have platform specific pages, MacOS, Linux, Windows, Other each with a reminder that a new user should read the first page before starting. I'd reuse much wiki data and, hopefully, eventually remove a few pages but just mark them legacy for now.

I had a crack at Installing_Lazarus_on_MacOS_X in 2017, while it needs updating as we no longer need panic about gdb, its not a bad model. Much original data is still there, down under a Legacy heading, I'd be surprised if anyone has read that legacy content recently.

As well as providing new users with an easy and welcoming env, we need to avoid content that is obviously out of date. Its a problem on any wiki but a bad signal to send ....

Thoughts ? 

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3040
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #62 on: February 02, 2019, 07:30:33 am »
I saw the discussion you mentioned. People here are nice. But sometimes it isn't ended well, because of misunderstanding, miscommunication and OP impatient. Hope that won't discourage you to keep providing helps in this forum.

About your suggestion to improve the wiki page for Lazarus installation, I agree. But I'm afraid it isn't easy.

I wrote Installing Lazarus 1.8.0 on Ubuntu 17.10 on this forum, but later I found that's not longer working for Ubuntu 18.04, that's why I started this thread. I recommended to do version locking, but it still will become useless if user perform distro upgrade. That happened on me some weeks ago after I upgraded my system to Ubuntu Mate 18.10, my Lazarus won't start. >:(

I have no problem doing research and fixing it manually. After using Lazarus on Ubuntu for years, I found that the tricks that worked previously may not work on newer versions of Ubuntu. So I think on the beginning of the wiki page, we should show a warning that new users should avoid installing Lazarus on Ubuntu.

That's not good, although Ubuntu reputation is not that high as before but it still has large user base. We still provide some workarounds but we need to mention they may not work on certain versions of Ubuntu. To make it worse, Ubuntu itself has many distributions.

:D I still will use Ubuntu Mate, it's not the best but I'm okay with it.

I'm now waiting for the release of the next version of Lazarus, so I will write an installation guide again.

--edit--
The red colored text above should be:
new users should avoid installing Lazarus on Ubuntu using deb files
« Last Edit: February 02, 2019, 09:42:21 am by Handoko »

dbannon

  • Hero Member
  • *****
  • Posts: 568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #63 on: February 02, 2019, 08:27:34 am »
Wow, Handoko, I must admit I am surprised at that. I have, over the last 12 months installed lots of working copies of Lazarus on a range of Linuxes, mostly VMs while trying to understand what Gnome has done to the SystemTrayIcon.

That includes several Ubuntu flavours and versions.

My model is to use distro's package manager to install FPC and SRC and then pull down Lazarus source with SVN and compile (make bigide). No problems generally. I believe that most people who do have problems download the binary kits from SourceForge and install with dpkg - as you and I know, that does not resolve dependencies.

That compile model does not, of course put icons and menu entries in the right place ...

And I still don't understand why the Gnome Developers hate SystemTrayIcons !

;-)

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3040
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #64 on: February 02, 2019, 09:34:29 am »
My model is to use distro's package manager to install FPC and SRC and then pull down Lazarus source with SVN and compile (make bigide). No problems generally.

Did you meant you manually built your FPC? I install Lazarus and FPC using the deb files. Reason? Simple, because the download link at the left side of this forum suggests Ubuntu users to use the deb files. And that's the problem. The FPC installed using the deb files often conflicts with Ubuntu own repository.

Me and most users pick the easiest. If you can simply download, click and install, why should we manually build it from the source using Terminal?!

Maybe we should consider to remove the deb files if it often causes problems.
« Last Edit: February 02, 2019, 09:47:38 am by Handoko »

lucamar

  • Hero Member
  • *****
  • Posts: 1536
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #65 on: February 02, 2019, 02:00:59 pm »
Maybe we should consider to remove the deb files if it often causes problems.

Please, don't! I've been using Ubuntu and other Debian-based distros since 2006 and never had any problems with the "official" Lazarus debs; removing them would mean we'd have to "invent" other ways to install Lazarus as easily as now (when it works, it works!).

Some (ok, maybe lots of) people have problems and those are who we hear from, but there are lots of others who simply install and done, and--of course--we don't hear about them. You'd leave them out in the cold by removing the DEBs.

What is clear, and I agree with it, is that the wiki pages need a serious overhaul even if just to explain the why and what-for of the various ways of installing FPC/Lazarus. I think that's a very good idea you have, Davo.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Handoko

  • Hero Member
  • *****
  • Posts: 3040
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #66 on: February 02, 2019, 03:25:21 pm »
I've been using Ubuntu and other Debian-based distros since 2006 and never had any problems with the "official" Lazarus debs.

But why me and some other users are having bad luck installing Lazarus on Ubuntu using the deb files?

Generally, these are the issues that may happen when installing Lazarus on Ubuntu using the deb files:
1. Double clicking the deb files but nothing happens
2. Fails to install and it says dependency not satisfied
3. Able to install both FPC and Lazarus but the Lazarus won't run
4. Able to install and run Lazarus but it won't run after Ubuntu update/upgrade

Synaptic version locking may solve issue #4 but I remember someone ever said it doesn't work on Kubuntu. And I'm sure it does not work to prevent distribution upgrade to replace the FPC with the one on its repository.

I remember you ever posted your workaround, I haven't tried but will be sure to test it on the next Lazarus release. I think I should re-share your workaround:
https://forum.lazarus.freepascal.org/index.php/topic,41524.msg295276.html#msg295276

Also JuhaManninen's build from source installation instruction:
https://forum.lazarus.freepascal.org/index.php/topic,42393.msg295887.html#msg295887

Similar but a bit different from dbannon:
https://forum.lazarus.freepascal.org/index.php/topic,41524.msg295226.html#msg295226

Workaround by bylaardt:
https://forum.lazarus.freepascal.org/index.php/topic,41333.msg287683.html#msg287683

And not forget garlar27's list of dependencies: 
https://forum.lazarus.freepascal.org/index.php/topic,41524.msg288242.html#msg288242

~~off topic~~

Addition to garlars27's list:
  • libssl-dev or libssl1.0-dev if you do secure network programming
  • libgles2-mesa-dev for developing modern 3D games
  • libgtk2.0-dev, libncurses-dev to solve some compilation issues
« Last Edit: February 02, 2019, 03:52:52 pm by Handoko »

VTwin

  • Hero Member
  • *****
  • Posts: 664
  • Former Turbo Pascal 3 user
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #67 on: February 02, 2019, 04:22:36 pm »
I also ask that deb files not be removed, as it works fine for me. I have done quite a few successful installs on Ubuntu VMs using dpkg and the Lazarus deb files.

Admittedly it took me a while to figure out, such as installing libgtk2.0-dev, not using the default package manager, and setting up shared media on VBox. I completely agree that it needs to be more straightforward.

The next time I do a clean Ubuntu install (upgrading always seems problematic, so I create a new virtual disk each time), I'll write down all the steps in detail.

Something like this though:

Code: [Select]
sudo apt-get -f install
sudo apt-get install libgtk2.0-dev
sudo dpkg -i *.deb

cd /media
sudo mount -t vboxsf PA01 sf_PA01
sudo usermod -aG vboxsf frederick
« Last Edit: February 02, 2019, 04:43:39 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.11.6: Lazarus 2.1.0 svn 61357M (64 bit Cocoa trunk)
Ubuntu 18.04.2: Lazarus 2.0.0 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.0 (64 bit on VBox)

lucamar

  • Hero Member
  • *****
  • Posts: 1536
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #68 on: February 02, 2019, 07:02:44 pm »
Handoko, most of the problems people have come about because they don't really know what they are doing. They just follow someone's instructions which may work in one machine but not quite the same way (or at all!) in another.

Debian packaging and installation is quite complex; after all it was created at a time when to install anything you had to download the sources, configure, build and install, and it was meant to automate that. To avoid confronting the final user with this complexity is why there exist more or less standard "package managers": dpkg as the base-line and then dselect, apt, aptitude, synaptic, muon, etc.; and why it's recommended to use official repositories.

That's also why I use a local repository to install Lazarus (and other things): It allows me to override the default repository packages with my own without more ado. It works and it works well, without version locking or any other special handling.

As for distro upgrades, I never had any problems either. Of course, I've yet to find the situation where the distro has the same (but artificially upped) version of Lazarus/FPC that is installed; that may give problems, I guess ...
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

dbannon

  • Hero Member
  • *****
  • Posts: 568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #69 on: February 02, 2019, 11:55:09 pm »
Quote
because they don't really know what they are doing.
I'm not sure thats right, I have seen people who plainly do have sufficient understanding get into trouble. I do think previous failed installs are an issue. And Handoko taught us about locking a version in apt, that was new to me and made a big difference.

I also really don't think that, normally, an install is really complex.  I've used massive scripts to run auto installs of entire systems and, once debugged, reliable. Scripting is backbone of Unix. But I do agree with lucamar that that end users need to be able to understand whats happening, following blindly is a bad thing.

Quote
I also ask that deb files not be removed,
Totally agree. Pull down debs from sourceforge is probably second easiest and probably more useful than using all distro's package manager. I want to present users with a set of options so they can make informed choice.

Quote
1. Double clicking the deb files but nothing happens
2. Fails to install and it says dependency not satisfied
3. Able to install both FPC and Lazarus but the Lazarus won't run
4. Able to install and run Lazarus but it won't run after Ubuntu update/upgrade

1 and 2 are (perhaps) because gdebi or something similar is not installed / used. And dpkg is not a suitable tool for 'average' linux user IMHO.
3. Don't know ! Undocumented dependencies ?
4. Yeah, thats an issue for sure. Library issues, dependencies again. Only time I have seen that problem is U18.4 messed up the 32bit libraries I use for cross compiling. Had some bad symlinks that needed redoing. I acknowledge thats beyond average user to find.

I prefer the DIY model for Lazarus because -
1. I usually have three or more versions of Lazarus installed. eg 184, Fixes, trunk
2. I like having lazarus and LCL in user space. While Lazarus is clever when rebuilding when write protected, it worries me. And I like being able to put (eg) debug line in LCL sometimes.
3. By taking Lazarus out of apt's reach, we avoid part of problem 4 that Handoko mentions. Because the compiler gets a good workout, probably helps with 3 too
4. Its easier IMHO.
5. It a very good test of dependencies. Debs depend on the author spotting all the likely dependencies that need be mentioned, build it yourself and it rubs you nose in any problem.

I advise people wanting to build my project to follow https://github.com/tomboy-notes/tomboy-ng/wiki/Building-tomboy-ng  Its going to be stinking hot here today, I'll spend the day inside, might bring up a couple of VMs
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #70 on: February 03, 2019, 07:53:46 am »
OK, I have just run three VM, all 64bit all Ubuntu, 17.10, 18.04, 18.10 with this script -
Code: [Select]
#!/usr/bin/bash
TAG="fixes_2_0"
for i in fpc fpc-src fpc-source subversion git; do
    echo "---- Installing $i ------"
sudo apt-get -y install "$i";
done
mkdir -p $HOME/bin/Lazarus
cd $HOME/bin/Lazarus
svn checkout https://svn.freepascal.org/svn/lazarus/branches/"$TAG"
cd "$TAG"
make clean
make bigide
if [ ! -f lazbuild ]; then
    echo "Sorry, build failed lazbuild not present, exiting..."
    exit 1
fi
echo "------------------------------------"
echo "OK, you can now start Lazarus with -"
echo "$HOME/bin/Lazarus/$TAG/lazarus"

In each case all worked fine (17.10 delivered fpc302). Now, I would not suggest a new user run this script, there is far too much going on screen and no sanity checks. But it does prove that a Lazarus install this way is not really a problem. But remember, all three VMs were clean, new builds. So, I believe that when people have problems, its because of the system's history ???

Anyway, my point is that this approach deserves to be one of several we'll suggest.

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Zoran

  • Hero Member
  • *****
  • Posts: 1387
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #71 on: February 03, 2019, 01:10:43 pm »
Handoko, for completness, I would like to add the link to what I wrote once. It was written for Mint (I have used this way of installing for years on different versions of Mint), but I believe it works for Ubuntu the same:
https://forum.lazarus.freepascal.org/index.php/topic,35214.msg246573.html#msg246573

Handoko

  • Hero Member
  • *****
  • Posts: 3040
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #72 on: February 03, 2019, 02:51:12 pm »
Good to know everyone shares their workaround here. :)

dbannon

  • Hero Member
  • *****
  • Posts: 568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #73 on: February 04, 2019, 06:21:40 am »

OK, I have drafted up a Installing_Lazarus_on_Linux page, comments and contributions are very welcome.

I have not linked the page yet (except from my own page) - after a bit of a review, I might look at just what Linux content can be removed from Installing_Lazarus if we decide to use my new page.

Please see http://wiki.freepascal.org/Installing_Lazarus_on_Linux

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3040
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #74 on: February 04, 2019, 06:57:20 am »
That's look good. But maybe you should mention:
  • Ubuntu users can use Ubuntu Software Center. It is the easiest, just click and wait, no need to deal with the Terminal.
  • Ubuntu is slow to update its repository for Lazarus, the version provided usually is not the latest stable version of Lazarus.
  • User can manually download and install the latest version but it usually may cause conflict with Ubuntu own repository. Several workarounds are available.

Actually installing Lazarus on Ubuntu is very easy. As long as you don't mind to use the version provided by Ubuntu, which usually is outdated.
« Last Edit: February 04, 2019, 07:13:35 am by Handoko »