Recent

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

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
I just tried to install the fpc packages provided by Ubuntu. And these are what I found:

- There is no fpc-dev or similar packages in Ubuntu repository.
- There are no makefiles in .../fpcsrc/3.0.4 if installing FPC using Ubuntu repository.
- Currently Ubuntu only provides Lazarus version 1.8.2.

I checked fpc's trunk, yes I can see the makefiles are there:
https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/

>:( It seems Ubuntu guys remove the makefiles or hide them to somewhere we cannot find.



@Hartmut

Sad, but I have to tell you. This is the only last thing you can do ... remove all your Lazarus/FPC related installations and then install them again using the steps I provided here:
https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html

Of course you can abandon Ubuntu and use other distros if you want.
Most people here recommend Manjaro.
 ;D
« Last Edit: August 31, 2018, 07:16:20 am by Handoko »

Hartmut

  • Hero Member
  • *****
  • Posts: 844
I just tried to install the fpc packages provided by Ubuntu. And these are what I found:

- There is no fpc-dev or similar packages in Ubuntu repository.
- There are no makefiles in .../fpcsrc/3.0.4 if installing FPC using Ubuntu repository.
- Currently Ubuntu only provide Lazarus version 1.8.2.

I checked fpc's trunk, yes I can see the makefiles are there:
https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/

I seems Ubuntu guys remove the makefiles or hide them to somewhere we cannot find.
Thank you for that valuable information, also for other people.

I will follow your installation steps in https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html (like I started 2 days ago and then stuck in step 6, where you told me to do this step twice: once with internet connection enabled and once without).

As soon as I have a result I will report it here, but this might be tomorrow.

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
I've just reinstalled back my Lazarus 1.8.4 and I can saw the makefiles are back now.

FYI, I just found the GDebi now behaves differently, which I guess was caused by Ubuntu update. If you click the 'install' button on GDebi, it will exit immediately. You need to start the GDebi as the superuser if you want to install a new package.

If this behavior also happens on you, here is what you need to:
Instead of double clicking the deb file, you start the GDebi by using Linux Terminal
sudo gdebi-gtk, then use File > Open to open the deb file.

Hartmut

  • Hero Member
  • *****
  • Posts: 844
FYI, I just found the GDebi now behaves differently, which I guess was caused by Ubuntu update. If you click the 'install' button on GDebi, it will exit immediately. You need to start the GDebi as the superuser if you want to install a new package.
Thank you for that info, so I could postpone the GDebi update and do it the old way.

Hartmut

  • Hero Member
  • *****
  • Posts: 844
Now it works!

I installed Lazarus according to https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html:
 - Step 6 I did without internet connection, which was only possible, because a couple of packages had been downloaded already on an earlier try.
 - Steps 7..9 were not neccessary.
 - In Step 12 I locked "fpc" and "fpc-src"

Then I could do the steps to be able to cross compile 32 bit programs with a 64 bit Lazarus, which are described in reply #1 of http://forum.lazarus.freepascal.org/index.php/topic,42364.15.html (take care of the correction for steps 2 and 3 in reply #3).

After all I started a System-Update, but nothing was deinstalled or destroyed :-)

Thank you very much to all who helped me, especially to Handoko for his continuous help. This is a great forum!

Update:
If you use KDE-Plasma desktop, then this might be important:
Version locking via Synaptic seems not to be the right way on KDE-Plasma desktop.
I did it, but update of fpc package was still offered during system update. KDE-Plasma desktop seems to use Muon package manager. I repeated version locking in Muon and update of fpc package was not longer offered :-)

I'm an absolute beginner on Linux, so I am not sure. Maybe one of the experts can prove this?
« Last Edit: September 10, 2018, 08:20:37 pm by Hartmut »

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
Thank you reporting the result.

Someone recently said it didn't work. But I tried to reproduce the issue yesterday, reinstalled and did version locking. It seems to work, everything is just okay. I now lock the fpc only, lets see what will happen.

If anything bad happen with your Lazarus-Ubuntu installation, please let us know.

prof7bit

  • Full Member
  • ***
  • Posts: 163
Re: Ubuntu: Lazarus-Installation lost by System-Update - how to prevent this?
« Reply #21 on: September 10, 2018, 08:54:35 pm »
@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.

Version locking in synaptic does not work. It only affects upgrades made through synaptic itself, it does not have any influence on command line apt-get. Real pinning should be done in /etc/apt/preferences.d/ and synaptic does not store the pinned packages anywhere in that folder, it apparently uses its own private database for these settings and apt-get cannot see it and will know nothing about these pseudo "pins" in synaptic.

I am still investigating how this ugly problem can be solved without too much trouble. If I can not find any graphical apt frontend that supports real apt pinning it probably must be done manually in the /etc/apt/prefereces.d/


---

The following contents in /etc/apt/preferences (or in any file in the folder /etc/apt/preferences.d) will prevent the problem:

Code: [Select]
Package: fpc
Pin: version 3.0.4
Pin-Priority: 1000

it can be tested with the following command:

Code: [Select]
apt list --upgradeable

this will output a list of packages that would be upgraded, if fpc is in the list it did not work, if fpc disappears from the list after the above file has been created then it is safe again to do do apt-get dist-upgrade.

---

Upstream devs should choose a version number for their deb package that is safe from being regarded as older than any Ubuntu repo versions, or maybe even give it a different name to avoid collisions altogether, there should be possibilities to do this within the rules of the naming conventions, maybe I'm going to file a bug after I have studied the version number formatting conventions and rules and figured out a way.
« Last Edit: September 10, 2018, 09:30:05 pm by prof7bit »

Hartmut

  • Hero Member
  • *****
  • Posts: 844
Re: Ubuntu: Lazarus-Installation lost by System-Update - how to prevent this?
« Reply #22 on: September 10, 2018, 10:08:58 pm »
I am still investigating how this ugly problem can be solved without too much trouble. If I can not find any graphical apt frontend that supports real apt pinning it probably must be done manually in the /etc/apt/prefereces.d/

After I locked package "fpc" via Muon package manager (see reply #19) I entered
Code: [Select]
apt list --upgradeableand package "fpc" was not listed. So mybe your graphical frontend is found. I tried it on Ubuntu 18.04 with KDE-Plasma Desktop.
« Last Edit: September 10, 2018, 10:22:54 pm by Hartmut »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Ubuntu: Lazarus-Installation lost by System-Update - how to prevent this?
« Reply #23 on: September 10, 2018, 10:51:07 pm »
I am still investigating how this ugly problem can be solved without too much trouble. If I can not find any graphical apt frontend that supports real apt pinning it probably must be done manually in the /etc/apt/prefereces.d/

Aparently, Muon does it right (?). As said in a previous post:

Version locking via Synaptic seems not to be the right way on KDE-Plasma desktop.
I did it, but update of fpc package was still offered during system update. KDE-Plasma desktop seems to use Muon package manager. I repeated version locking in Muon and update of fpc package was not longer offered :-)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
Re: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?
« Reply #24 on: September 11, 2018, 04:06:40 am »
Thank you for reporting back. I never use KDE Plasma Desktop, I will later investigate the problem. What distro should I try? Kubuntu?

Hartmut

  • Hero Member
  • *****
  • Posts: 844
Re: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?
« Reply #25 on: September 11, 2018, 10:59:54 am »
Thank you for reporting back. I never use KDE Plasma Desktop, I will later investigate the problem. What distro should I try? Kubuntu?

KDE Plasma desktop comes with Kubuntu. But I installed first Ubuntu 18.04 (which came with Gnome3 desktop) and switched later to KDE Plasma desktop via "sudo apt install kubuntu-desktop".

prof7bit

  • Full Member
  • ***
  • Posts: 163
Re: Ubuntu: Lazarus-Installation lost by System-Update - how to prevent this?
« Reply #26 on: September 11, 2018, 01:20:44 pm »
Version locking via Synaptic seems not to be the right way on KDE-Plasma desktop.
I did it, but update of fpc package was still offered during system update. KDE-Plasma desktop seems to use Muon package manager.

Apparently Muon uses the proper way[TM] to pin a package which is adding an entry to apt preferences, that way *every* updater tool that uses apt and also plain old apt-get on the command line will respect this setting.

prof7bit

  • Full Member
  • ***
  • Posts: 163
Re: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?
« Reply #27 on: September 11, 2018, 07:00:57 pm »
There is an even more generic way than pinning by version number:

create a new file
/etc/apt/preferences.d/fpc
Code: [Select]
Package: fpc*
Pin: release a=now
Pin-Priority: 1001

The a=now filter matches manually installed packages that were installed with dpkg and the priority >1000 ensures that it will always have higher priority than every other package source, even those with higher versions. And because we don't mention a specific version number it would stay that way and still work if you later install the next version manually and Ubuntu then releases an even higher version number too.

If you issue the command
apt-cache policy
you will see the following output:
Code: [Select]
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=multiverse,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=universe,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 100 http://de.archive.ubuntu.com/ubuntu bionic-backports/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=multiverse,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/multiverse i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=multiverse,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/restricted i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=i386
     origin de.archive.ubuntu.com
Pinned packages:
     fpc -> 3.0.4 with priority 1001
     fpc-src -> 3.0.4 with priority 1001

In the last two lines you can see that it has matched my manually installed fpc-3.0.4 and fpc-src-3.0.4 and gave them priority 1001 (which means always keep this, even if higher versions from other repositories are available)

An alternative way that also works would be to match release o=Ubuntu and give it priority of -1 which means "never install", this has the effect of effectively blacklisting all fpc packages that originate from Ubuntu and also works for our purpose.

---

btw the reason it uninstalled lazarus was probably that lazarus-project depends on fpc-src and fpc-src-3.0.4 depends on fpc-3.0.4 from upstream but the Ubuntu version of fpc did not satisfy these dependencies and now fpc-src and lazarus-project had to be uninstalled automatically. I have also tried to pin lazarus-project with 1001 to enforce this dependency chain from the other end but this did not work.

rjhover50

  • New member
  • *
  • Posts: 8
Re: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?
« Reply #28 on: September 28, 2018, 05:20:01 am »
I was having the same problem after upgrading to Ubuntu 18.04 from 16.04.

I tried what JuhaManninen suggested and it worked!

Thanks!!!!!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: [SOLVED] Ubuntu: Lazarus-Installation lost by System-Update - how to prevent?
« Reply #29 on: September 28, 2018, 09:50:50 am »
I was having the same problem after upgrading to Ubuntu 18.04 from 16.04.
I tried what JuhaManninen suggested and it worked!
Heh, at least somebody tries my instructions!
Most people seem to have an obsession for .deb packages regardless of how much you try to warn them.
I still think Handoko and others do a bad disservice when promoting the external .deb packages.

A related comment in this thread:
Maybe create a wiki page with explanation and possible solutions? Maybe a FAQ?
The wiki page would also soon promote using external .deb packages. It would also be a disservice.
Even if I create a page without that info, somebody would very likely add it.

P.S.
@rjhover50, as an extra bonus you get the latest bug fixes of the SVN branch by running "svn up" sometimes.
You could also start using the fixes 2.0 branch already which was forked recently. It will get bug fixes for many years to come. Recommended.
 https://svn.freepascal.org/svn/lazarus/branches/fixes_2_0/
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018