Recent

Author Topic: LUBUNTU (ubuntu) Installed perfect : add complnent printer4lazarus --fail  (Read 507 times)

Llewellyna44

  • Newbie
  • Posts: 1
Hi Guys,
Any help on this would be great lazarus was working very well -- created a large project -- needed to print -- printers4lazarus component would not get permissions.
So in my infinite wisdom I ran lazarus as root to install :::  filled in the required boxes -- not really sure what i was answering but it appeared to work .
Went back to lazarus as non root  -- now broken  on compile Write error: Unable to create file "/usr/share/lazarus/3.2.0/components/printers/printer4lazarus.pas": Permission denied
File: /usr/share/lazarus/3.2.0/components/printers/printer4lazarus.pas
package main source file any help would be great thanks in advance. (I realize it is probably a full re install ++) but i do need printers4lazarus

cdbc

  • Hero Member
  • *****
  • Posts: 2254
    • http://www.cdbc.dk
Hi
Quote
So in my infinite wisdom I ran lazarus as root to install :::
Hmmm.... Wisdom is something else than that  ;)
The entire Lazarus directory tree is write protected in the root-domain!
There are plenty of 'Debian'ers in here, so I'm sure they'll chime in to help you out...
I personally use 'trunk/trunk' as my daily driver, installed with 'FpcUpDeluxe' in a /not write protected area/ of my /home/me/ dir.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

dbannon

  • Hero Member
  • *****
  • Posts: 3410
    • tomboy-ng, a rewrite of the classic Tomboy
OK, so I suppose you have guessed that you should not run Lazarus as root ?

The issue is that as Lazarus runs it creates lots of files in various places. You do that as root and those files are owned but root, cannot be overwritten as yourself.

This is a particular problem when running a repo install of Lazarus. While you could fix the problem by looking for and removing certain files, I'd suggest it will be easier in the long run to start again. Otherwise, every time something goes wrong, you will suspect owner ship issues.

So, first, remove all of your existing Lazarus install (leave FPC where it is, its fine for now).  Use app to do a complete uninstall but that may have issues about the files it installed having been changed. So, let it do what it can then manually remove the remainder. Thats the only hard part.  Then, important, remove the files that Lazarus may have made in your home directory, probably in ~/.lazarus. them, check to see if a similar dir existing in /root

Not sure how old your LUbuntu is, but I suggest rather than the repo one, please use a current copy, either 3.8 or 4.0rc2, download the source, build. Its dead easy, lazarus routinely rebuilds itself when you add packages for example.

Basicly, download and unzip a file, cd into the dir, "make clean bigide".  I suggest you download a zip rather than using git unless you are a git user already.

See https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source

Having lazarus downloaded and built (don't bother to install) in your home directory avoids a whole lot of ownership issues.

Davo

EDIT : if you are feeling really brave, you could try this script to install. If it works, its easy, it will download Lazarus, unzip, build, install a desktop file and icon (so menus work). But no guarantee.
https://github.com/davidbannon/FPC_Laz_Install/blob/main/make-lazarus.bash

Mind you, installing is easy anyway, the hard part is removing all remnants of your first Lazarus. Note the Lazarus developers have absolutely no say in how Ubuntu packages it.

Good Luck.
« Last Edit: March 08, 2025, 08:07:57 am by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

cdbc

  • Hero Member
  • *****
  • Posts: 2254
    • http://www.cdbc.dk
Thanks Davo  :)
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

dsiders

  • Hero Member
  • *****
  • Posts: 1453
Mind you, installing is easy anyway, the hard part is removing all remnants of your first Lazarus. Note the Lazarus developers have absolutely say in how Ubuntu packages it.

I think you missed the no in that last sentence? ;)
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

dbannon

  • Hero Member
  • *****
  • Posts: 3410
    • tomboy-ng, a rewrite of the classic Tomboy
I think you missed the no in that last sentence? ;)
(here was I hoping I'd fixed it before someone noticed !)

Thanks Don !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018