热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

HowtoInstallLazarusIDEinUbuntu20.04,18.04,21.10

Ubuntu20.04LTShasbeenreleasedrecently,butinstallingLazarustherefromtheofficialreposwontget

Ubuntu 20.04 LTS has been released recently, but installing Lazarus there from the official repos won't get you up and running. Let's see how Lazarus can be installed on 20.04 without issues.

You can install Lazarus from Ubuntu Software. But wait till you see it burp a surprize error message!

Apparantly the package for Lazarus available from Ubuntu Software, the official Ubuntu "software center", shows a "Can't find the lazarus executable /usr/lib/lazarus/2.0.6/lazarus" message on startup. The bug has been reported and will be updated in future, but at the time of writing this, it was broken. So you'll need a guide to install it properly. Let me show you how you can install Lazarus on your Ubuntu 20.04 LTS installation without any hassle.

Don't worry, I have made this easy for anyone to follow. So come along!

There is even a video available to make things easier for you...

Note: If you don't have the issue above and you are satisfied with 1 or 2 version old package that you get from official repos, ignore this guide and stick to the version from Ubuntu Software.


Step 0: Completely Remove Previous Lazarus Installs

Open Ubuntu Software from Activities overview. Search for "lazarus" and remove if any package is installed.

Even after removing the packages, there might be some other packages or residual files from previous installs. So we remove all of those with:

?










1

2

3

4

5

6

7

8

9

10

11


sudo sh -c "apt autoremove fpc lazarus lazarus-ide \

lazarus-ide-2.0 lazarus-project fpc-source && \

rm -Rf /usr/lib/fpc && \

rm -Rf /usr/lib/lazarus && \

rm -Rf /usr/share/fpcsrc && \

rm -Rf /etc/lazarus && \

rm -rf /etc/fpc.* && \

rm -rf /etc/fpc-* && \

rm -rf /etc/fppkg* && \

rm -f ~/.fpc && \

rm -Rf ~/.lazarus"


Run above on the Terminal app. (Open Activities overview, search "term", launch Terminal app, then copy and paste these commands in.)

* You will need to provide your root password of the system when you run sudo commands.


Step 1: Update Your System

First update your system. You can use the **Software Updater** tool by launching it from Activities overview or run this on the Terminal app:

sudo apt update && sudo apt upgrade

* You will need to provide your root password of the system when you run sudo commands or add/remove software.

An update and upgrade is needed so that the dependencies we will be installing in a minute does not conflict with the currently installed versions.


Step 2: Get the DEB Files

Download the deb files for Lazarus from https://lazarus-ide.org

(It should automatically detect your system architecture and offer you the appropriate files.)

You will need to download all the 3 deb files for lazarus-projectfpc-src and fpc-laz.

Now put the deb files in a separate directory. Only keep those 3 deb files in that folder and nothing else. This is because we'll run a magic command later.


Step 3: Install Them

Before installing, it is a good practice to uninstall the previous version of Lazarus to get a problem free installation. If you have a previous version of Lazarus installed, uninstall it. If you don't have it installed, follow along...

Open the terminal on the directory with the 3 deb files. (Click the folder name on the top location bar and choose **Open in Terminal**.) Then run:

sudo apt install binutils libgtk2.0-dev

This will install all the dependencies for Lazarus. Then this to install Lazarus:

sudo dpkg -i *

This is the magic command I was talking about. It will install all 3 of those DEB files.


Step 4: After Installing

After the installation finished, you can run it from the Activities overview. You can go there and then search for "lazarus" and it should show up. It will launch when you click the icon.

After it launched, you will see a dialog box titled Welcome to Lazarus IDE. If it doesn't show any red icons you are fine. You can click Start IDE on that dialog box. This will make Lazarus appear on screen.

You can right click the Lazarus icon on Dash and select Add to Favorites to add the icon on Dash for you to later access it from there.


Bottom Line

You will be able to install Lazarus without any problems. But there is a caveat. It will not automatically update with your system. Since you've manually installed this, you'll have to manually update this yourself. Updating is easy though. Just download the deb files, keep them in a folder, then run `sudo dpkg -i *` on that folder and you're done!

Although I would recommend switching to the Ubuntu Software version when this issue is fixed.

Note: If system upgrades trying to replace deb versions to repo versions on your system, you may need to hold the packages to their current version. (Thanks to Tony for pointing this out.) You may need to run sudo sh -c "apt-mark hold lazarus-project && apt-mark hold fpc-src && apt-mark hold fpc-laz". If you want to revert this back, run the command with "unhold" instead of "hold". Details here. 

 


http://lazplanet.blogspot.com/2020/04/install-lazarus-ubuntu-20-04.html

 



推荐阅读
  • ubuntu用sqoop将数据从hive导入mysql时,命令: ... [详细]
  • Vagrant虚拟化工具的安装和使用教程
    本文介绍了Vagrant虚拟化工具的安装和使用教程。首先介绍了安装virtualBox和Vagrant的步骤。然后详细说明了Vagrant的安装和使用方法,包括如何检查安装是否成功。最后介绍了下载虚拟机镜像的步骤,以及Vagrant镜像网站的相关信息。 ... [详细]
  • 本文介绍了在Android Studio中使用命令行build gradle的方法,并解决了一些常见问题,包括手动配置gradle环境变量和解决External Native Build Issues的方法。同时提供了相关参考文章链接。 ... [详细]
  • 【技术分享】一个 ELF 蠕虫分析
    【技术分享】一个 ELF 蠕虫分析 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • iOS超签签名服务器搭建及其优劣势
    本文介绍了搭建iOS超签签名服务器的原因和优势,包括不掉签、用户可以直接安装不需要信任、体验好等。同时也提到了超签的劣势,即一个证书只能安装100个,成本较高。文章还详细介绍了超签的实现原理,包括用户请求服务器安装mobileconfig文件、服务器调用苹果接口添加udid等步骤。最后,还提到了生成mobileconfig文件和导出AppleWorldwideDeveloperRelationsCertificationAuthority证书的方法。 ... [详细]
  • 本文介绍了如何在使用emacs时去掉ubuntu的alt键默认功能,并提供了相应的操作步骤和注意事项。 ... [详细]
  • 本文介绍了在Ubuntu 11.10 x64环境下安装Android开发环境的步骤,并提供了解决常见问题的方法。其中包括安装Eclipse的ADT插件、解决缺少GEF插件的问题以及解决无法找到'userdata.img'文件的问题。此外,还提供了相关插件和系统镜像的下载链接。 ... [详细]
  • Ubuntu 用户安装 Linux Kernel 3.15 RC1
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 现在比较流行使用静态网站生成器来搭建网站,博客产品着陆页微信转发页面等。但每次都需要对服务器进行配置,也是一个重复但繁琐的工作。使用DockerWeb,只需5分钟就能搭建一个基于D ... [详细]
  • pc电脑如何投屏到电视?DLNA主要步骤通过DLNA连接,使用WindowsMediaPlayer的流媒体播放举例:电脑和电视机都是连接的 ... [详细]
  • 树状笔记软件for linux,Ubuntu 14.04安装开源树状笔记管理软件 WikidPad 2.2
    WikidPad是一款开源免费的wiki风格的树状笔记管理软件,类似于Notepad。基于Python,支持Windows、Mac、Linux等平台。W ... [详细]
  • docker安装到基本使用
    记录docker概念,安装及入门日常使用Docker安装查看官方文档,在"Debian上安装Docker",其他平台在"这里查 ... [详细]
  • 本人在Python3.6的环境下,安装了Jupyterpip3installjupyter进入到JupyterNotebook后,点击Kernel菜单的 ... [详细]
author-avatar
小变态徒
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有