Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs

Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs

Scheduled Pinned Locked Moved Solved Installation and Deployment
14 Posts 5 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J JonB
    1 May 2021, 19:53

    @C-Cubed
    Unless you built Qt yourself before, why not just install from the distro? I think you get 5.12 IIRC. It was fine for me.

    C Offline
    C Offline
    C-Cubed
    wrote on 2 May 2021, 03:13 last edited by
    #3

    @JonB I tried installing from distro using synaptic. It installed but I couldn't get my projects from my 18.04 LTS into new version of Qt on 20.04.02 LTS distro.
    Also qt creator didn't have any of the sample apps.
    I'm going to try installing via installer on qt site.

    J 1 Reply Last reply 2 May 2021, 07:19
    0
    • C C-Cubed
      2 May 2021, 03:13

      @JonB I tried installing from distro using synaptic. It installed but I couldn't get my projects from my 18.04 LTS into new version of Qt on 20.04.02 LTS distro.
      Also qt creator didn't have any of the sample apps.
      I'm going to try installing via installer on qt site.

      J Offline
      J Offline
      JonB
      wrote on 2 May 2021, 07:19 last edited by
      #4

      @C-Cubed
      I don't know what "synaptic" is. I have always done all my Qt installs via apt get, as I do with everything else under Ubuntu, and it has been good. I had no trouble moving from 16.04 -> 18.04 -> 20.04, and things in between.

      I don't think I did anything outside of this. I'm not certain, but if you take stuff from the Qt site it won't be prebuilt for Ubuntu? I don't care about examples/docs as they are all available online if I wanted them.

      There are probably many hits if you Google for this. I came across https://stackoverflow.com/a/48147461/489865

      sudo apt-get install build-essential

      sudo apt-get install qtcreator

      sudo apt-get install qt5-default

      Read that post and the others there. I see there is a comment for 20.04. And a mention of how to address "QtCreator examples and API docs missing"

      Or at one point in the past from my notes it seems I used Ubuntu Software Center for Creator

      Ubuntu Software Centre, Developer Tools, IDEs:

      Qt Creator > Install.

      Qt Creator > Tools > Options > Help > Documentation > Add > /usr/share/qtcreator/doc/ choose qtcreator.qch

      Hope the above notes help you.

      J 1 Reply Last reply 2 May 2021, 13:53
      1
      • J JonB
        2 May 2021, 07:19

        @C-Cubed
        I don't know what "synaptic" is. I have always done all my Qt installs via apt get, as I do with everything else under Ubuntu, and it has been good. I had no trouble moving from 16.04 -> 18.04 -> 20.04, and things in between.

        I don't think I did anything outside of this. I'm not certain, but if you take stuff from the Qt site it won't be prebuilt for Ubuntu? I don't care about examples/docs as they are all available online if I wanted them.

        There are probably many hits if you Google for this. I came across https://stackoverflow.com/a/48147461/489865

        sudo apt-get install build-essential

        sudo apt-get install qtcreator

        sudo apt-get install qt5-default

        Read that post and the others there. I see there is a comment for 20.04. And a mention of how to address "QtCreator examples and API docs missing"

        Or at one point in the past from my notes it seems I used Ubuntu Software Center for Creator

        Ubuntu Software Centre, Developer Tools, IDEs:

        Qt Creator > Install.

        Qt Creator > Tools > Options > Help > Documentation > Add > /usr/share/qtcreator/doc/ choose qtcreator.qch

        Hope the above notes help you.

        J Online
        J Online
        JKSH
        Moderators
        wrote on 2 May 2021, 13:53 last edited by
        #5

        @JonB said in Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs:

        I don't know what "synaptic" is.

        It's a GUI for apt :-) https://www.nongnu.org/synaptic/

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • C Offline
          C Offline
          C-Cubed
          wrote on 2 May 2021, 14:40 last edited by
          #6

          Thanks for the suggestions. So here is what I've done so far with some success and the rational.
          If anyone has a better approach, please let me know. The thorny part is moving the Qt project from 18.04 LTS to 20.04.2 LTS.

          1. Using dd I restored my 20.04.2 LTS installation to to state prior to installing Qt creator with synaptic.
            Why? Because I'm developing using Qt 3D I need all the 3D components. Trying to figure out what these
            are was too confusing.
          2. Installed Qt and Qt creator from Qt web site using Qt installer.
            https://download.qt.io/official_releases/online_installers/
            Why? This installs qt and a host of examples including examples for Qt 3D.
            The example project files (pro) and (pri) provide good templates for generating a Qt 3D app.
          3. Tried to build and run the Planets-qml example.
            Why? Its a Qt 3D app. If I could successfully build it, I would know
            my Qt Creator installation was correct.
            Initially building it generated a number of errors relating to missing libraries and include files.
          4. Used "apt-file search" to find packages for missing libraries and includes.
          5. Used apt update, apt upgrade, apt install to install missing libraries
          6. Successfully built and ran Planets-qml example.
            My next step is to try moving my project from 18.04 LTS to 20.04.2 LTS. Unfortunately Qt creator does not have an option for really importing a project. The import option only imports files for editing. It does not do a full import that would allow a successful build.
            So my planned approach is
          7. Create a new empty Qt desktop project.
          8. Copy all my .cpp and .h files from 18.04 LTS to new 20.04.2 LTS project.
          9. Open the new project using 20.04.2 LTS Qt creator.
          10. Try build.
          11. I expect to get errors relating to missing libraries and include files.
          12. Scrum through the Qt 3D example .pro and .pri files patching stuff into my .pro files until I get a successful build.
          J 1 Reply Last reply 2 May 2021, 15:14
          2
          • C C-Cubed
            2 May 2021, 14:40

            Thanks for the suggestions. So here is what I've done so far with some success and the rational.
            If anyone has a better approach, please let me know. The thorny part is moving the Qt project from 18.04 LTS to 20.04.2 LTS.

            1. Using dd I restored my 20.04.2 LTS installation to to state prior to installing Qt creator with synaptic.
              Why? Because I'm developing using Qt 3D I need all the 3D components. Trying to figure out what these
              are was too confusing.
            2. Installed Qt and Qt creator from Qt web site using Qt installer.
              https://download.qt.io/official_releases/online_installers/
              Why? This installs qt and a host of examples including examples for Qt 3D.
              The example project files (pro) and (pri) provide good templates for generating a Qt 3D app.
            3. Tried to build and run the Planets-qml example.
              Why? Its a Qt 3D app. If I could successfully build it, I would know
              my Qt Creator installation was correct.
              Initially building it generated a number of errors relating to missing libraries and include files.
            4. Used "apt-file search" to find packages for missing libraries and includes.
            5. Used apt update, apt upgrade, apt install to install missing libraries
            6. Successfully built and ran Planets-qml example.
              My next step is to try moving my project from 18.04 LTS to 20.04.2 LTS. Unfortunately Qt creator does not have an option for really importing a project. The import option only imports files for editing. It does not do a full import that would allow a successful build.
              So my planned approach is
            7. Create a new empty Qt desktop project.
            8. Copy all my .cpp and .h files from 18.04 LTS to new 20.04.2 LTS project.
            9. Open the new project using 20.04.2 LTS Qt creator.
            10. Try build.
            11. I expect to get errors relating to missing libraries and include files.
            12. Scrum through the Qt 3D example .pro and .pri files patching stuff into my .pro files until I get a successful build.
            J Online
            J Online
            JKSH
            Moderators
            wrote on 2 May 2021, 15:14 last edited by
            #7

            Thank you for posting your detailed steps. Everything you did from #1 to #6 sounds good.

            @C-Cubed said in Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs:

            My next step is to try moving my project from 18.04 LTS to 20.04.2 LTS. Unfortunately Qt creator does not have an option for really importing a project.

            You shouldn't need to do anything special to import your project. Just copy your source code directory hierarchy from your original machine into your new machine (but don't copy the *.pro.user file, because this file contains configurations for your specific machine). Then, use Qt Creator to open your top-level *.pro file. Read and fix the error messages from top to bottom (if any).

            P.S. The better way is to use a version control system (such as Git) to store and manage your project. This helps you to track changes in your code over time, and protects you from coding mistakes. It also provides a simple way to load your project on a different machine.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            3
            • C Offline
              C Offline
              C-Cubed
              wrote on 3 May 2021, 14:32 last edited by
              #8

              Done.
              I've successfully built my Ubuntu 18.04 Qt project on Ubuntu 20.04.2 Qt.
              The process I outlined in my earlier post worked (see above).
              Thankfully I'm only a retired computer professional using Qt for for a small number of home projects .
              Again, thankfully I use the Ubuntu LTS release so I only have to suffer this every 5 years.
              If I were a commercial user, I would be very upset about the difficulty of upgrading Ubuntu 18.04 LTS and Qt to Ubuntu 20.04.02 LTS and Qt. The refactoring of libraries and classes in an incompatible way is none sense. Doing this at a large number of sites with a large number of applications, would be prohibitive.

              Upgrading base Ubuntu is very easy and requires little effort.
              Upgrading mysql, tomcat, eclipse and qt to the newest releases included in newest Ubuntu LTS is very painful.
              Gratuitous Comments:

              1. An automatic upgrade NEVER works.
              2. The major problems are refactoring of libraries and classes and changes to internals of various IDE's
                and GUI's. (eg. project files, ini files, config files etc.)

              These are the changes to my apps I needed to make to get them to build and run under Qt 5 as a result of Qt refactoring.
              1)
              The .pro and .pro.user files are incompatible and have to be redone from scratch
              2) Various classes have been refactored requiring editing include files and possibly cpp files.
              #include <QtGui/QWidget>
              This must be updated to either
              #include <QtWidgets/QWidget>
              Or more portably (Which works in Qt 4 and Qt 5):
              #include <QWidget>

              1. echo "QT += widgets" >> /fileProject.pro
                Add #include QDialog any file containing QDialog declarations
                Previously including QtGui was enough but QT5 splits widgets into more .h files, thus making necessary
                to include them. For example QtMenuBar was included in QtMenu.h but now it requires QtMenuBar.h to
                be #included
              2. This is a hack to catch any/all changes to structure of qt3d. It picks up any new include directories
                Added to .pro file:
                !include( ../Qt/Examples/Qt-5.15.2/qt3d ) {
                error( "Couldn't find the examples.pri file!" )
                }
              J 1 Reply Last reply 3 May 2021, 14:37
              0
              • C C-Cubed
                3 May 2021, 14:32

                Done.
                I've successfully built my Ubuntu 18.04 Qt project on Ubuntu 20.04.2 Qt.
                The process I outlined in my earlier post worked (see above).
                Thankfully I'm only a retired computer professional using Qt for for a small number of home projects .
                Again, thankfully I use the Ubuntu LTS release so I only have to suffer this every 5 years.
                If I were a commercial user, I would be very upset about the difficulty of upgrading Ubuntu 18.04 LTS and Qt to Ubuntu 20.04.02 LTS and Qt. The refactoring of libraries and classes in an incompatible way is none sense. Doing this at a large number of sites with a large number of applications, would be prohibitive.

                Upgrading base Ubuntu is very easy and requires little effort.
                Upgrading mysql, tomcat, eclipse and qt to the newest releases included in newest Ubuntu LTS is very painful.
                Gratuitous Comments:

                1. An automatic upgrade NEVER works.
                2. The major problems are refactoring of libraries and classes and changes to internals of various IDE's
                  and GUI's. (eg. project files, ini files, config files etc.)

                These are the changes to my apps I needed to make to get them to build and run under Qt 5 as a result of Qt refactoring.
                1)
                The .pro and .pro.user files are incompatible and have to be redone from scratch
                2) Various classes have been refactored requiring editing include files and possibly cpp files.
                #include <QtGui/QWidget>
                This must be updated to either
                #include <QtWidgets/QWidget>
                Or more portably (Which works in Qt 4 and Qt 5):
                #include <QWidget>

                1. echo "QT += widgets" >> /fileProject.pro
                  Add #include QDialog any file containing QDialog declarations
                  Previously including QtGui was enough but QT5 splits widgets into more .h files, thus making necessary
                  to include them. For example QtMenuBar was included in QtMenu.h but now it requires QtMenuBar.h to
                  be #included
                2. This is a hack to catch any/all changes to structure of qt3d. It picks up any new include directories
                  Added to .pro file:
                  !include( ../Qt/Examples/Qt-5.15.2/qt3d ) {
                  error( "Couldn't find the examples.pri file!" )
                  }
                J Offline
                J Offline
                JonB
                wrote on 3 May 2021, 14:37 last edited by
                #9

                @C-Cubed said in Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs:

                1. Various classes have been refactored requiring editing include files and possibly cpp files.
                  #include <QtGui/QWidget>
                  This must be updated to either
                  #include <QtWidgets/QWidget>
                  Or more portably (Which works in Qt 4 and Qt 5):
                  #include <QWidget>

                That was required to move from Qt4 to Qt5. What does that have to do with your change from Ubuntu 18.04 to 20.04??

                I never edited a single source file moving between those Ubuntu versions.

                1 Reply Last reply
                1
                • K Offline
                  K Offline
                  KH-219Design
                  wrote on 3 May 2021, 15:32 last edited by
                  #10

                  @C-Cubed I am glad you got it working. At least we can celebrate something, despite whatever obstacles got in the way.

                  I do find myself agreeing with @JonB , though. I have several projects that have traversed the Ubuntu 18-to-20 threshold, and all my pro and pri files continued work, and I did not edit my source code.

                  (Admittedly, I did make one small change, but it was due to a hardcoded QMAKE_CXX = g++-7 in my qmake scripts that had to be changed to a newer compiler version.)

                  However, I can think of at least two reasons why my experience would go differently than that of C-Cubed:

                  • My pro and pri files have been written by hand, not by Qt Creator.
                  • The Qt libraries I link against were ones that I either manually downloaded from the Qt website or else built myself

                  I can certainly imagine that depending on how and when the apt/aptitude/synaptic/Ubuntu Software GUI were used for managing the Ubuntu-provided copies of Qt, there could have been a much larger Qt version jump than expected.

                  My sense is that this was less a Qt problem than an issue with lack of visibility into apt activities and package versions. (But that's not to say that "Qt problems" never happen.) LTS distributions (in my understanding) are conservative, and (in my experience) tend to keep you "pinned" to very old versions of software longer than you might expect.

                  www.219design.com
                  Software | Electrical | Mechanical | Product Design

                  C 1 Reply Last reply 3 May 2021, 21:59
                  0
                  • K KH-219Design
                    3 May 2021, 15:32

                    @C-Cubed I am glad you got it working. At least we can celebrate something, despite whatever obstacles got in the way.

                    I do find myself agreeing with @JonB , though. I have several projects that have traversed the Ubuntu 18-to-20 threshold, and all my pro and pri files continued work, and I did not edit my source code.

                    (Admittedly, I did make one small change, but it was due to a hardcoded QMAKE_CXX = g++-7 in my qmake scripts that had to be changed to a newer compiler version.)

                    However, I can think of at least two reasons why my experience would go differently than that of C-Cubed:

                    • My pro and pri files have been written by hand, not by Qt Creator.
                    • The Qt libraries I link against were ones that I either manually downloaded from the Qt website or else built myself

                    I can certainly imagine that depending on how and when the apt/aptitude/synaptic/Ubuntu Software GUI were used for managing the Ubuntu-provided copies of Qt, there could have been a much larger Qt version jump than expected.

                    My sense is that this was less a Qt problem than an issue with lack of visibility into apt activities and package versions. (But that's not to say that "Qt problems" never happen.) LTS distributions (in my understanding) are conservative, and (in my experience) tend to keep you "pinned" to very old versions of software longer than you might expect.

                    C Offline
                    C Offline
                    C-Cubed
                    wrote on 3 May 2021, 21:59 last edited by
                    #11

                    @KH-219Design
                    All of my projects and project files where generated by Qt creator.
                    What does it have to do with moving from Ubuntu 18.04 to 20.04.2?

                    1. Ubuntu 18.04 LTS is going off support.
                    2. Ubuntu 20.04 LTS is the next LTS release. It will be supported for 5 years.
                    3. I tried several times to upgrade my 18.04 release using Ubuntu Software manager. I could never get it to work. The upgrade always failed, hosing my system and requiring a complete restore.
                    4. Installing 20.04.2 on a naked partition worked 1st time. Very easy, no issues. But, then I was stuck with naked system.
                    5. I had to install mysql, Eclipse, Qt , Tomcat9.
                      These installs give newer versions for 20.04.2 vs. 18.04.
                    6. That's why I had to move my applications.
                    J 1 Reply Last reply 4 May 2021, 06:32
                    0
                    • C C-Cubed
                      3 May 2021, 21:59

                      @KH-219Design
                      All of my projects and project files where generated by Qt creator.
                      What does it have to do with moving from Ubuntu 18.04 to 20.04.2?

                      1. Ubuntu 18.04 LTS is going off support.
                      2. Ubuntu 20.04 LTS is the next LTS release. It will be supported for 5 years.
                      3. I tried several times to upgrade my 18.04 release using Ubuntu Software manager. I could never get it to work. The upgrade always failed, hosing my system and requiring a complete restore.
                      4. Installing 20.04.2 on a naked partition worked 1st time. Very easy, no issues. But, then I was stuck with naked system.
                      5. I had to install mysql, Eclipse, Qt , Tomcat9.
                        These installs give newer versions for 20.04.2 vs. 18.04.
                      6. That's why I had to move my applications.
                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 4 May 2021, 06:32 last edited by
                      #12

                      @C-Cubed said in Need help moving from Ubuntu 18.04 LTS to Ubuntu 20.04.2 LTSs:

                      What does it have to do with moving from Ubuntu 18.04 to 20.04.2?

                      You misunderstood the question from @JonB
                      He asked you why you did this:

                      Various classes have been refactored requiring editing include files and possibly cpp files.
                      #include <QtGui/QWidget>
                      This must be updated to either
                      #include <QtWidgets/QWidget>
                      Or more portably (Which works in Qt 4 and Qt 5):
                      #include <QWidget>
                      

                      This was only needed when switching from Qt4 to Qt5. But your projects were already Qt5 before moving to Ubuntu 20, right?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        C-Cubed
                        wrote on 9 May 2021, 14:48 last edited by
                        #13

                        Sorry for the confustion.
                        Its a good question. I'll double check.
                        I had multiple versions of Qt installed on my Ubuntu18.04 LTS. Its possible the projects were Qt4 not Qt5. Still my earlier comment applies.
                        Why would Qt org refactor and require updates to projects? It just seems like a unnecessary change requiring users to update projects.

                        J 1 Reply Last reply 9 May 2021, 14:58
                        0
                        • C C-Cubed
                          9 May 2021, 14:48

                          Sorry for the confustion.
                          Its a good question. I'll double check.
                          I had multiple versions of Qt installed on my Ubuntu18.04 LTS. Its possible the projects were Qt4 not Qt5. Still my earlier comment applies.
                          Why would Qt org refactor and require updates to projects? It just seems like a unnecessary change requiring users to update projects.

                          J Offline
                          J Offline
                          JonB
                          wrote on 9 May 2021, 14:58 last edited by
                          #14

                          @C-Cubed
                          As suggested before, your issue sound like they come from moving major release Qt4 to Qt5, not poor Ubuntu 18.04 to 20.04, which you keep shouting at! ;-)

                          1 Reply Last reply
                          1

                          12/14

                          4 May 2021, 06:32

                          • Login

                          • Login or register to search.
                          12 out of 14
                          • First post
                            12/14
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved