qt安装-环境ubuntu+arm64-:安装一个低版本的

1.概要

2.内容

在 Ubuntu 上安装特定版本的 Qt 可能需要一些额外的步骤,因为通常通过包管理器(如 apt)安装的版本是 Ubuntu 仓库中提供的版本。如果你需要安装一个特定(较低)版本的 Qt,通常有几种方法:

方法一:从官方 Qt 网站下载并编译

  1. 下载 Qt 源代码
  2. 安装编译依赖
    • 打开终端,安装必要的编译工具和库:

      sudo apt-get update
      sudo apt-get install build-essential perl python git
      sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
      sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
      sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev
      sudo apt-get install libxrandr-dev libfontconfig1-dev libcap-dev libbz2-dev libgcrypt20-dev libpcre3-dev libpci-dev libnss3-dev libxcursor-dev libxcomposite-dev libxdamage-dev
      sudo apt-get install libxrandr-dev libdrm-dev libfontconfig1-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libegl1-mesa-dev gperf bison
  3. 解压和配置
    • 解压下载的 Qt 源代码:
      tar -xvf qt-everywhere-src-<version>.tar.xz
      cd qt-everywhere-src-<version>
    • 配置构建选项:
      ./configure -prefix $HOME/Qt/<version>/gcc_64 -nomake examples -nomake tests
      • -prefix 指定安装路径。
      • -nomake examples 和 -nomake tests 可以加快编译速度,如果你不需要示例和测试。
  4. 编译和安装
    • 编译 Qt(这一步可能需要较长时间):

      make -j$(nproc)

    • 安装 Qt:

      make install

  5. 设置环境变量
    • 将 Qt 的 bin 目录添加到 PATH 环境变量中:

      export PATH=$HOME/Qt/<version>/gcc_64/bin:$PATH

    • 你可以将这一行添加到 ~/.bashrc 或 ~/.profile 中,以便每次启动终端时自动设置。

方法二:使用 Qt 在线安装器

  1. 下载 Qt 在线安装器
  2. 运行安装器
    • 给安装器执行权限并运行:
      chmod +x qt-installer-noninteractive.run
      ./qt-installer-noninteractive.run
    • 在线安装器会启动一个图形界面,你可以选择需要的组件和版本进行安装。

方法三:使用第三方 PPA(如果有)

有时社区会维护一些 PPA(个人软件包存档),提供特定版本的 Qt。不过,这种方法不一定总是可行,具体取决于是否有适合你需求的 PPA。

  1. 添加 PPA
    • 查找并添加合适的 PPA(假设有一个):
       
      sudo add-apt-repository ppa:<ppa-name>
      sudo apt-get update

  2. 安装 Qt
    • 通过 apt 安装特定版本的 Qt:

      sudo apt-get install qt<version>-*

注意事项

  • 编译 Qt 需要较多的磁盘空间和内存,确保你的系统资源足够。
  • 安装多个版本的 Qt 可能会导致环境变量冲突,需要小心管理。
  • 如果你只是需要某个特定功能或修复,可以考虑在现有版本上打补丁或查找是否有相关的库可以提供该功能。

希望这些方法能帮助你在 Ubuntu 上安装所需版本的 Qt。

3.关联链接

ubuntu qt 的安装方式有多少种-优快云博客

环境ubuntu+arm64:qt,旧版本下载和安装-优快云博客

qt-everywhere-src-6.7.3.zip 如何安装-优快云博客

ubuntu 如何安装一个低版本的qt-优快云博客

4.关联知识

1.ubuntu如何下载一共离线安装包,在国内镜像中下载

在 Ubuntu 上下载 Qt 的离线安装包,可以通过国内镜像站点来提高下载速度。以下是详细的步骤:

一、选择国内镜像站点

国内有多个镜像站点提供 Qt 的离线安装包,例如:

这些镜像站点通常会同步 Qt 官方网站上的安装包,并且下载速度更快。

二、下载 Qt 离线安装包

以下以清华大学开源软件镜像站为例,说明如何下载 Qt 离线安装包:

  1. 打开镜像站点
  2. 选择版本
    • 在页面上找到你需要的 Qt 版本,例如 Qt 5.14.2。
  3. 下载离线安装包
    • 在对应版本目录下,找到以 .run 结尾的离线安装包文件,例如 qt-opensource-linux-x64-5.14.2.run
    • 点击下载链接,将安装包下载到你的本地计算机。

三、验证安装包

下载完成后,可以通过以下命令验证安装包的完整性(如果提供了 MD5 或 SHA256 校验码):

d5sum qt-opensource-linux-x64-5.14.2.run

或者

sha256sum qt-opensource-linux-x64-5.14.2.run

将输出值与提供的校验码进行比较,以确保下载的文件完整无损。

四、安装 Qt

下载完成后,可以按照以下步骤安装 Qt:

  1. 打开终端
    • 在 Ubuntu 上,可以通过快捷键 Ctrl+Alt+T 打开终端。
  2. 赋予安装包执行权限
    • 在终端中,导航到下载 Qt 安装包的目录,并赋予安装包执行权限:

      chmod +x qt-opensource-linux-x64-5.14.2.run

  3. 运行安装程序
    • 执行以下命令启动 Qt 的安装程序:

      sudo ./qt-opensource-linux-x64-5.14.2.run

    按照安装向导完成安装
    • 在安装过程中,你需要输入 Qt 账号的用户名和密码(如果尚未注册,可以在 Qt 官方网站 注册)。
    • 选择安装路径和组件,然后点击“安装”按钮。
  4. 验证安装
    • 安装完成后,你可以在 Ubuntu 的应用程序菜单中找到 Qt Creator,并打开它以验证安装是否成功。

注意事项

  • 版本兼容性:确保下载的 Qt 版本与你的开发需求和系统架构(如 x86_64)兼容。
  • 网络问题:如果下载过程中遇到网络问题,可以尝试更换不同的镜像站点或使用下载工具(如 aria2wget)来提高下载速度。
  • 安装依赖:在安装 Qt 之前,确保你的系统已经安装了必要的依赖项,例如 gccg++ 等编译器和构建工具。

通过以上步骤,你应该能够在 Ubuntu 上成功下载并安装 Qt 的离线安装包。

2.ubuntu如何下载一共离线安装包,在国内镜像中下载,arm64的下载地址 

要在国内镜像中下载适用于 arm64 架构的 Ubuntu 离线安装包,您可以按照以下步骤操作。以下是一些提供 Ubuntu 镜像的国内源,以及下载 arm64 架构离线安装包的方法:

国内镜像源推荐

  1. 清华大学开源软件镜像站

  2. 阿里云开源镜像站

  3. 中国科学技术大学开源镜像站

下载 arm64 架构的 Ubuntu 离线安装包

以下以清华大学开源软件镜像站为例,说明如何下载适用于 arm64 架构的 Ubuntu 离线安装包:

  1. 访问清华大学开源软件镜像站

  2. 导航到 Ubuntu 镜像页面

    • 在镜像站首页,找到并点击“Ubuntu”链接。
  3. 选择 Ubuntu 版本

    • 在 Ubuntu 镜像页面,选择您需要的 Ubuntu 版本,例如 Ubuntu 20.04 LTS。
  4. 找到 arm64 架构的镜像

    • 在所选版本的镜像列表中,找到适用于 arm64 架构的镜像文件。这些文件通常以 .iso 结尾,例如 ubuntu-20.04.5-live-server-arm64.iso
  5. 下载镜像文件

    • 点击镜像文件旁边的下载链接,将文件下载到您的本地计算机。

其他镜像站的操作步骤

如果您选择使用其他镜像站(如阿里云开源镜像站或中国科学技术大学开源镜像站),操作步骤大致相同:

  1. 访问镜像站

    • 在浏览器中打开您选择的镜像站。
  2. 导航到 Ubuntu 镜像页面

    • 在镜像站首页,找到并点击“Ubuntu”或相关链接。
  3. 选择 Ubuntu 版本和架构

    • 在 Ubuntu 镜像页面,选择您需要的版本和架构(arm64)。
  4. 下载镜像文件

    • 找到适用于 arm64 架构的镜像文件,并点击下载链接。

注意事项

  • 镜像文件的选择:确保下载的镜像文件适用于 arm64 架构,并且与您计划安装的 Ubuntu 版本相匹配。
  • 下载速度:由于国内镜像站通常位于国内,下载速度会比从官方网站下载更快。
  • 镜像文件的完整性:下载完成后,建议验证镜像文件的完整性,以确保文件在下载过程中没有损坏。您可以使用 md5sum 或 sha256sum 命令来验证文件的校验和。

通过以上步骤,您应该能够顺利下载适用于 arm64 架构的 Ubuntu 离线安装包。

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: linux-aarch64-gnu-g++ (arm64, CPU features: neon) Target compiler: gcc 6.3.1 Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++14 Using ccache ........................... no Using gold linker ...................... yes Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. yes Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... no Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Tracing backend ........................ Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... yes SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ no EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ no AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D Job traces ................. no Output Qt3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... no Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... yes Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... no Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. no Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ no Building v8 snapshot supported ......... yes Use ALSA ............................... no Use PulseAudio ......................... no Optional system libraries used: re2 .................................. no icu .................................. no libwebp, libwebpmux and libwebpdemux . no opus ................................. no ffmpeg ............................... no libvpx ............................... no snappy ............................... no glib ................................. no zlib ................................. yes minizip .............................. no libevent ............................. no jsoncpp .............................. no protobuf ............................. no libxml2 and libxslt .................. no lcms2 ................................ no png .................................. no JPEG ................................. no harfbuzz ............................. no freetype ............................. no x11 .................................. no Required system libraries: fontconfig ........................... no dbus ................................. no nss .................................. no khr .................................. no glibc ................................ yes Required system libraries for qpa-xcb: libdrm ............................... no xcomposite ........................... no xcursor .............................. no xi ................................... no xrandr ............................... no xtst ................................. no Note: Also available for Linux: linux-clang linux-icc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值