Ubuntu 13.10 Install Lazarus/FPC and everything else needed to make it all work. lazarus / 1-Linux ---------------------------------------------------------------------- Napoleon · 2014-03-27 16:13 EDIT  See my last post for the solution that made it work. Hi,   I've been trying to install Lazarus/FPC on Ubuntu 13.10 x86_64 for the last 2 hours without luck.   I won't go into the problems I've been having matching/configuring the IDE and compiler etc.  But I'm totally confused now as what I need.   I just went to SF and downloaded lazarus_1.0.14-0_amd64.deb. When I tried to install it, it told me I didn't have FPC, so I downloaded fpc-2.6.4.x86_64-linux.tar and ran the install.sh script.  Then, in accordance with the readme, I then went into the example/text folder and compiled the hello program and ran in successfully.  I checked its time-stamp to make sure the executable was created by me.   So now I went back to install lazarus_1.0.14-0_amd64.deb, but it's still complaining: Code: [Select]user@HOME:~/Downloads/Lazarus$ sudo dpkg -i lazarus_1.0.14-0_amd64.deb (Reading database ... 395817 files and directories currently installed.) Preparing to replace lazarus 1.0.14 (using lazarus_1.0.14-0_amd64.deb) ... Unpacking replacement lazarus ... dpkg: dependency problems prevent configuration of lazarus:  lazarus depends on fpc (>= 2.6.2) | fp-ide (>= 2.6.2); however:   Package fpc is not installed.   Package fp-ide is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-db (>= 2.6.2); however:   Package fpc is not installed.   Package fp-units-db is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-fv (>= 2.6.2); however:   Package fpc is not installed.   Package fp-units-fv is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-gfx (>= 2.6.2); however:   Package fpc is not installed.   Package fp-units-gfx is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-gnome1 (>= 2.6.2); however:   Package fpc is not installed.   Package fp-units-gnome1 is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-gtk (>= 2.6.2); however:   Package fpc is not installed.   Package fp-units-gtk is not installed.  lazarus depends on fpc (>= 2.6.2) | fp-units-misc (>= 2.6.2); however:   Package fpc is not installed.   Package f dpkg: error processing lazarus (--install):  dependency problems - leaving unconfigured Processing triggers for shared-mime-info ... Unknown media type in type 'all/all' Unknown media type in type 'all/allfiles' Unknown media type in type 'uri/mms' Unknown media type in type 'uri/mmst' Unknown media type in type 'uri/mmsu' Unknown media type in type 'uri/pnm' Unknown media type in type 'uri/rtspt' Unknown media type in type 'uri/rtspu' Processing triggers for desktop-file-utils ... Processing triggers for gnome-menus ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support ... Processing triggers for man-db ... Errors were encountered while processing:  lazarus Then I found this page on SF : Lazarus - Browse /Lazarus Linux amd64 DEB/Lazarus 1.0.14 at SourceForge.net and remembered that I also have to install FPC-SRC, so I downloaded the deb package from that page: fpc-src_2.6.2-0_amd64.deb, and when I tried to install it, I got the following error: Code: [Select]user@HOME:~/Downloads/Lazarus$ sudo dpkg -i fpc- src_2.6.2-0_amd64.deb (Reading database ... 395817 files and directories currently installed.) Unpacking fpc-src (from fpc-src_2.6.2-0_amd64.deb) ... dpkg: error processing fpc-src_2.6.2-0_amd64.deb (--install):  trying to overwrite '/usr/share/fpcsrc/2.6.2/rtl/nativent/tthread.inc', which is also in package fpc-source-2.6.2 2.6.2-5 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  fpc-src_2.6.2-0_amd64.deb It was then that I realised that the version of FPC-SRC didn't match the FPC version, and that Ubuntu already had v2.6.2 on it.  So I tried to find a 2.6.4 version of FPC-SRC but haven't been able to do so. Could someone please help me by explaining what steps are required to install this correctly with the latest stable version of the IDE and Compiler.  I'm prepared to start fresh again by removing the packages, downloading new ones etc.   The sticky post in this sub-forum is dated, and I cannot find a FAQ that explains how to do this. Cheers, Nap ---------------------------------------------------------------------- Rails · 2014-03-27 16:44 I use Debian, but Ubuntu should be about the same. Remove EVERYTHING Lazarus in your system. Use locate or similar to make sure you get it all. Do the same with FPC. Once it is clean, you have to make a choice. Install from svn, install from your distro's repositories, or install from the Lazarus sourceforge files (precompiled). Changing later tends to cause problems. I have no idea how up-to-date your distro's respositories tend to be, but if they don't have Laz 1.2 they are out of date. If that is the case, I suggest using Laz's current 1.2 .deb release from sourceforge. You should also make a choice for FPC. Personally, I get FPC from my distro's repositories and Laz from sourceforge. In either case, it is easiest to install FPC first, then Laz. If you get Laz from sourceforge, you MUST pin (lock) the installation or your package manager may overwrite your Laz installation, right now or at a later date. Do it before you run apt-get update or a graphical package manager equivalent. If you get FPC from sourceforge, you will probably have to pin that too. ---------------------------------------------------------------------- JuhaManninen · 2014-03-27 16:46 The main web page http://www.lazarus.freepascal.org has a "Download Now" button that leads you to the 3 needed packages: FPC, FPC sources and Lazarus. The latest version is Lazarus 1.2. ---------------------------------------------------------------------- bylaardt · 2014-03-27 16:59 Install FPC 2.6.1 first. the standart FPC in ubuntu is the 2.6.0 version Correct is: Sorry, my mistake: install  2.6.4 first. ---------------------------------------------------------------------- marcov · 2014-03-27 17:10 The current version of FPC is 2.6.4.  2.6.2 is over an year old, and 2.6.0 is ancient. ---------------------------------------------------------------------- Napoleon · 2014-03-27 17:32 Thanks for answering so quick!! lazarus 1.0.10_dfsg-1 and fpc 2.6.2-5 (which I think was already installed) are what's available from the Software Center.   When I tried using this Lazarus, it found the IDE and SRC but couldn't find the compiler, and then complained about version numbers in the file name when I found the link to it.  That's why I decided to try other ways of installing it. Quote from: Rails on March 27, 2014, 05:44:28 pmI use Debian, but Ubuntu should be about the same. Remove EVERYTHING Lazarus in your system. Use locate or similar to make sure you get it all. Do the same with FPC. Once it is clean, you have to make a choice. Install from svn, install from your distro's repositories, or install from the Lazarus sourceforge files (precompiled). Changing later tends to cause problems. I have no idea how up-to-date your distro's respositories tend to be, but if they don't have Laz 1.2 they are out of date. If that is the case, I suggest using Laz's current 1.2 .deb release from sourceforge. You should also make a choice for FPC. Personally, I get FPC from my distro's repositories and Laz from sourceforge. In either case, it is easiest to install FPC first, then Laz. If you get Laz from sourceforge, you MUST pin (lock) the installation or your package manager may overwrite your Laz installation, right now or at a later date. Do it before you run apt-get update or a graphical package manager equivalent. If you get FPC from sourceforge, you will probably have to pin that too. That's quite a task, especially since I don't know specifically which files belong to those packages.   I used the commands shown in this post @ Stackoverflow (see below) Code: [Select]sudo apt-get purge fpc lazarus sudo rm -Rf /usr/lib/fpc sudo rm -Rf /usr/lib/lazarus sudo rm -Rf /usr/share/fpcsrc sudo rm -f ~/.fpc sudo rm -Rf ~/.lazarus sudo apt-get autoremove lazarus fpc sudo apt-get --purge remove lazarus fpc sudo apt-get autoremove sudo apt-get autoclean sudo apt-get -f install sudo dpkg --configure -aBefore I attempted to install other versions.  Is they sufficient?  Any further advice? I removed a bunch of FPC related files but I'm not sure of those in the list below.  Can I remove all of these safely, or which can I leave safely? Code: [Select]/etc/alternatives/fpc /etc/alternatives/fpc-depends /etc/alternatives/fpc-depends.1.gz /etc/alternatives/fpc.1.gz /etc/alternatives/fpc.cfg /etc/alternatives/fpclasschart /etc/alternatives/fpclasschart.1.gz /etc/alternatives/fpcmake /etc/alternatives/fpcmake.1.gz /etc/alternatives/fpcmake.5.gz /etc/alternatives/fpcres /etc/alternatives/fpcres.1.gz /etc/alternatives/fpcsubst /etc/alternatives/fpcsubst.1.gz /etc/alternatives/ifpc /etc/alternatives/ifpc.1.gz /etc/alternatives/instantfpc /etc/alternatives/instantfpc.1.gz /usr/bin/fpc /usr/bin/fpc-2.6.2 /usr/bin/fpc-depends-2.6.2 /usr/bin/fpclasschart /usr/bin/fpclasschart-2.6.2 /usr/bin/fpcmake /usr/bin/fpcmake-2.6.2 /usr/bin/fpcmkcfg /usr/bin/fpcmkcfg-2.6.2 /usr/bin/fpcres /usr/bin/fpcres-2.6.2 /usr/bin/fpcsubst /usr/bin/fpcsubst-2.6.2 /usr/bin/ifpc /usr/bin/ifpc-2.6.2 /usr/bin/instantfpc /usr/lib/fpc /usr/man/man1/fpc.1.gz /usr/man/man1/fpclasschart.1.gz /usr/man/man1/fpcmake.1.gz /usr/man/man1/fpcmkcfg.1.gz /usr/man/man1/fpcres.1.gz /usr/man/man1/fpcsubst.1.gz /usr/man/man5/fpc.cfg.5.gz /usr/man/man5/fpcmake.5.gz /usr/share/doc/fpc-2.6.2 /usr/share/doc/fpc-2.6.4 /usr/share/doc/fpc-source /usr/share/doc/fpc-source-2.6.2 /usr/share/man/man1/fpc-2.6.2.1.gz /usr/share/man/man1/fpc-depends-2.6.2.1.gz /usr/share/man/man1/fpclasschart-2.6.2.1.gz /usr/share/man/man1/fpclasschart.1.gz /usr/share/man/man1/fpcmake-2.6.2.1.gz /usr/share/man/man1/fpcmake.1.gz /usr/share/man/man1/fpcmkcfg-2.6.2.1.gz /usr/share/man/man1/fpcres-2.6.2.1.gz /usr/share/man/man1/fpcres.1.gz /usr/share/man/man1/fpcsubst-2.6.2.1.gz /usr/share/man/man1/fpcsubst.1.gz /usr/share/man/man1/ifpc-2.6.2.1.gz /usr/share/man/man1/ifpc.1.gz /usr/share/man/man1/instantfpc.1.gz /usr/share/man/man3/fpclassify.3.gz /usr/share/man/man5/fpc-2.6.2.cfg.5.gz /usr/share/man/man5/fpcmake-2.6.2.5.gz /usr/share/man/man5/fpcmake.5.gz /usr/share/texmf/tex/latex/fpc-2.6.2 /usr/share/texmf/tex/latex/fpc-2.6.2/fakehtml.sty /usr/share/texmf/tex/latex/fpc-2.6.2/fpc.sty And I've done the same for LAZARUS files.  Which of these do I need to remove? Code: [Select]/usr/share/app-install/desktop/lazarus- ide-0.9.30.4:lazarus-0.9.30.4.desktop /usr/share/app-install/icons/lazarus.png /usr/share/applications/lazarus-1.0.10.desktop /usr/share/doc-base/lazarus-doc-1.0.10 /usr/share/lintian/overrides/lazarus-ide-1.0.10 /usr/share/lintian/overrides/lazarus-ide-gtk2-1.0.10 /usr/share/man/man1/lazarus-ide-1.0.10.1.gz /usr/share/man/man1/startlazarus-1.0.10.1.gz /usr/share/menu/lazarus-ide-1.0.10 /usr/share/pixmaps/lazarus-1.0.10.xpm /usr/share/pixmaps/lazarus.xpm /var/lib/doc-base/documents/lazarus-doc-1.0.10 There are some Lazarus & FPC files in: /var/cache/apt/archives/    and    /var/lib/dpkg/alternatives/ I assume it's ok to leave those as they are just part of the package database? I don't mind pinning the versions I have, just want it to work first.  But thanks for the advice.  I knew you had to pin Lazarus but wasn't aware of the need to do FPC as well. From what I understand, the IDE must be the right version for the FPC installed.  So, how does installing Lazarus 1.2 go with FPC 2.6.2-5?  Is 2.6.2-5 a higher version than 2.6.2?  And what about FPC 2.6.4, is there no FPC-SRC available for it? Also, what is the significance or cause of this error (from the second error msg I posted in the OP): Code: [Select]trying to overwrite '/usr/share/fpcsrc/2.6.2/rtl/nativent/tthread.inc', which is also in package fpc-source-2.6.2 2.6.2-5 Cheers, Nap ---------------------------------------------------------------------- Rails · 2014-03-27 18:17 I am using laz 1.2 from sourceforge with fpc 2.6.2-8 from the Debian repo. So, far I haven't run into any problems that I can attribute to not having fpc 2.6.4. However, that doesn't mean there aren't any.  The -5 in 2.6.2-5 is simply that package maintainer's way of identifying his latest build of 2.6.2. It is still FPC 2.6.2. Delete everything lazarus and fpc with your package manager. Then sudo locate lazarus | grep lazarus/ which will show all remaining lazarus directories.  Delete them all, including their contents, except those in /var/cache/apt/archives if you prefer to keep them.  Edit: You probably don't want to delete any laz or fpc package that you downloaded from sourceforge and intend to install, otherwise, you will have to download it again. Do the same thing with fpc. Run locate again without grepping anything to see if there are any random laz or fpc files hanging out. Delete them too, unless you have an overriding reason to keep them. You should now be able to install without running into problems. ---------------------------------------------------------------------- fpcoder · 2014-03-27 18:42 Nappe, you just need to download three files and run sudo dpkg -i *.deb Remove the stuff you installed. Download as usual the DEB's for latest release of fpc, fpc source and lazarus. Put them all in your home folder and it will install everything in one sweep. I learnt this from: http://lazplanet.blogspot.se/2013/03/how-to- install-lazarus.html Seems to show how to get rid earlier install too. I cut out the relevant part: "If you already have lazarus installed then uninstall it first: Press Ctrl+Alt+T to open a terminal. Run the following commands:         sudo apt-get purge fpc lazarus         sudo rm -Rf /usr/lib/fpc         sudo rm -Rf /usr/lib/lazarus         sudo rm -Rf /usr/share/fpcsrc         sudo rm -f ~/.fpc         sudo rm -Rf ~/.lazarus Now we are going to install Lazarus. Type cd  followed by a space. Drag the folder (inside which you have saved the 3 .deb files) in the terminal window. Press enter. Then run:     sudo dpkg -i *.deb You will probably see a message saying that some library is not installed (such as libgtk2.0-dev). Install the dependent libraries. For example,     sudo apt-get install libgtk2.0-dev Then run the above command again     sudo dpkg -i *.deb Now it is going to install. It takes a bit of a time. It will require almost 1.5 GB of space in your linux partition to install Lazarus in Linux. To run lazarus you can use the dash menu or on a command prompt run "startlazarus". ---------------------------------------------------------------------- Rails · 2014-03-27 19:00 Quote from: kapibara on March 27, 2014, 07:42:17 pm "If you already have lazarus installed then uninstall it first: Press Ctrl+Alt+T to open a terminal. Run the following commands:         sudo apt-get purge fpc lazarus         sudo rm -Rf /usr/lib/fpc         sudo rm -Rf /usr/lib/lazarus         sudo rm -Rf /usr/share/fpcsrc         sudo rm -f ~/.fpc         sudo rm -Rf ~/.lazarus Unfortunately, the various installation packages differ somewhat in where they install to. The above is not necessarily the exact case and can't be trusted. ---------------------------------------------------------------------- fpcoder · 2014-03-27 19:32 Thanks for the info, didn't know that. But I would run the commands anyway, and after that run the grep you described to check if it worked. ---------------------------------------------------------------------- Napoleon · 2014-03-28 05:30 Thank you all. I have deleted everything Laz & FPC related (and I hope nothing more)...  So I'm ready to install again. But, one more question which wasn't answered earlier. I haven't been able to find fpc-src greater than 2.6.2.  If I install fpc2.6.4 what do I do about the fpc-src?  As I understand it, fpc & fpc-src must match to allow the debugger to step through all the code. @Rails:  I guess going with 2.6.2 is not a problem then, but what about pinning the versions?  Would I be locking myself out of something that's just around the corner? Earlier this month Kamischi said (in another thread here) : QuoteGive me a day or two and the fink packages for fpc 2.6.4 and lazarus 1.2 are ready. MiSchi P.S. fink packages are out. GO GO GO! Anyone know where can I get them? Cheers. *Edit:  Added info and rephrased my post. ---------------------------------------------------------------------- BigChimp · 2014-03-28 09:58 fink is for OSX, not for Ubuntu. You can unpin stuff later if you want to and if necessary, no problem, so you're not locking yourself out. Yes, fpc and fpc src *must* match. 2.6.2 is ok as current lazarus stable 1.2 is built with that. ---------------------------------------------------------------------- Napoleon · 2014-03-28 12:58 Done  Having followed the advice concerning removal of all things Lazarus and FPC, I still had problems installing.  So I did the following: dpkg --get-selections | grep -v deinstall > installed_packages_passX.txt  and then searched the output file for Laz and FPC. For each Laz/FPC package mentioned;  (I also found a package called lcl-1.0.10 (and a few derivatives) that needed to be removed too.) Initially I did: sudo dpkg -r    (for some I used -P) But some packages couldn't be removed due to dependencies.  So I tried all of them, then looped back over them and got rid of a few more. Having previously deleted a lot of files manually, I invariably broke the 'lazarus' package and was told I had to reinstall it, but it couldn't find the archive.  This also broke my Software Center for a while. So for this one, I did dpkg --remove --force-remove-reinstreq lazarus (which fixed my Software Center too). Eventually dpkg --get-selections | grep -v deinstall > installed_packages_passX.txt stopped showing me Laz & FPC packages but I still couldn't install.  So I got rid of the filter and used: dpkg --get-selections > all_installed_packages.txt Now I had a shorter list of packages to remove, and I decided to use sudo apt-get remove --purge to remove them. One by one I removed all of them, repeating the dpkg --get-selections > all_installed_packages.txt command to refresh the list each time. With everything gone, I was able to install Lazarus 1.2.0 with FPC 2.6.2 (and fpc-src 2.6.2). startlazarus worked fine, and this time the IDE was able to find all the bits it needed. I hope I don't have to do this dance again. Job Done!!  Now I can do what I really want to do. Thanks for the support and advice gentlemen. Cheers, Nap ---------------------------------------------------------------------- Napoleon · 2014-03-28 13:30 @Rails,   If you would be so kind as to post the commands to perform the PIN correctly? Cheers, Nap ---------------------------------------------------------------------- Rails · 2014-03-28 13:52 Quote from: Napoleon on March 28, 2014, 01:58:44 pm For each Laz/FPC package mentioned;  (I also found a package called lcl-1.0.10 (and a few derivatives) that needed to be removed too.) Ouch, that should have been removed automatically by the purge. Obviously it wasn't. Some distros build Laz as a bunch of small packages, instead of one large package. It can be really confusing when they also change the package names. They sometimes also build FPC as multiple packages. I find it easier to find this stuff using the graphical package manager Synaptic, which makes it a snap to search both on name and description.  But good to know that you now have a working installation.   Quote from: Napoleon on March 28, 2014, 02:30:38 pm@Rails,   If you would be so kind as to post the commands to perform the PIN correctly? Cheers, Nap I use Synaptic for that (Package/Lock Version command).  As far as I know, Synaptic has its own internal mechanism for locking and doesn't rely on apt/preferences.