Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Ubuntu 22.04 how to reset QT_PLUGIN_PATH to correct value?
QtWS25 Last Chance

Ubuntu 22.04 how to reset QT_PLUGIN_PATH to correct value?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 3.3k 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.
  • Q Offline
    Q Offline
    qt77
    wrote on last edited by qt77
    #1

    I am using Ubuntu 22.04 and all my applications (Konsole, P4V and WIreshark) which use Qt are segfaulting.

    The error is they try locating metadata by looking for libraries but cannot find the libraries. This is the debug logging from Konsole:

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqminimal.so"
    "Failed to extract plugin meta data from '/usr/lib/plugins/platforms/libqminimal.so'" 
             not a plugin
    

    I established my QT_PLUGIN_PATH must be wrong. It seems to be pointing to /usr/lib/plugins/platforms. If I export this to /usr/lib/x86_64-linux-gnu/qt5/plugins/ all the applications work.

    However, I don't understand why this happened.

    Could someone please advise how I can re-install my Qt so the above is fixed?

    C 1 Reply Last reply
    0
    • Q qt77

      I am using Ubuntu 22.04 and all my applications (Konsole, P4V and WIreshark) which use Qt are segfaulting.

      The error is they try locating metadata by looking for libraries but cannot find the libraries. This is the debug logging from Konsole:

      QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/plugins/platforms" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqminimal.so"
      "Failed to extract plugin meta data from '/usr/lib/plugins/platforms/libqminimal.so'" 
               not a plugin
      

      I established my QT_PLUGIN_PATH must be wrong. It seems to be pointing to /usr/lib/plugins/platforms. If I export this to /usr/lib/x86_64-linux-gnu/qt5/plugins/ all the applications work.

      However, I don't understand why this happened.

      Could someone please advise how I can re-install my Qt so the above is fixed?

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @qt77 If you only have the Ubuntu-supplied Qt then you would not normally have a QT_PLUGIN_PATH in your environment. If you have one then you should look in /etc/environment.d/ for a file that is setting it.

      What is the output of:

      which qmake
      qmake -query
      env | grep QT
      

      Have you installed a separate Qt environment that you have added to the PATH, LD_LIBRARYPATH, etc?

      Q 1 Reply Last reply
      1
      • C ChrisW67

        @qt77 If you only have the Ubuntu-supplied Qt then you would not normally have a QT_PLUGIN_PATH in your environment. If you have one then you should look in /etc/environment.d/ for a file that is setting it.

        What is the output of:

        which qmake
        qmake -query
        env | grep QT
        

        Have you installed a separate Qt environment that you have added to the PATH, LD_LIBRARYPATH, etc?

        Q Offline
        Q Offline
        qt77
        wrote on last edited by qt77
        #3

        @ChrisW67 Hi Chris, before the problem started I had never explicitly installed qt. Presumably it came with Konsole.

        After the problem occurred I think I may have tried re-installing qtwayland5 out of desperation.

        The output:

        which qmake
        /usr/bin/qmake
        
        qmake -query
        qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory
        
        env | grep QT
        QT_ACCESSIBILITY=1
        QT_QPA_PLATFORM=wayland
        QT_IM_MODULE=ibus
        QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/
        

        QT_PLUGIN_PATH is what I just added, so I could test Konsole.
        QT_QPA_PLATFORM is in my bashrc and my bashrc was copied from a previous Ubuntu installation.

        I literally just need the bog-standard Qt installation so Konsole, P4V and Wireshark function normally.

        I'd like to undo anything stupid I may have done and just reset the installation.

        C Q 2 Replies Last reply
        0
        • Q qt77

          @ChrisW67 Hi Chris, before the problem started I had never explicitly installed qt. Presumably it came with Konsole.

          After the problem occurred I think I may have tried re-installing qtwayland5 out of desperation.

          The output:

          which qmake
          /usr/bin/qmake
          
          qmake -query
          qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory
          
          env | grep QT
          QT_ACCESSIBILITY=1
          QT_QPA_PLATFORM=wayland
          QT_IM_MODULE=ibus
          QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/
          

          QT_PLUGIN_PATH is what I just added, so I could test Konsole.
          QT_QPA_PLATFORM is in my bashrc and my bashrc was copied from a previous Ubuntu installation.

          I literally just need the bog-standard Qt installation so Konsole, P4V and Wireshark function normally.

          I'd like to undo anything stupid I may have done and just reset the installation.

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          @qt77 OK. You do not Qt development tool installed, which is fine for a generic user setup.

          You should look in /etc/environment.d/ for a file that is setting QT_PLUGIN_PATH and/or QT_IM_MODULE

          grep -l QT /etc/environment.d/*
          
          1 Reply Last reply
          0
          • Q qt77

            @ChrisW67 Hi Chris, before the problem started I had never explicitly installed qt. Presumably it came with Konsole.

            After the problem occurred I think I may have tried re-installing qtwayland5 out of desperation.

            The output:

            which qmake
            /usr/bin/qmake
            
            qmake -query
            qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory
            
            env | grep QT
            QT_ACCESSIBILITY=1
            QT_QPA_PLATFORM=wayland
            QT_IM_MODULE=ibus
            QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/
            

            QT_PLUGIN_PATH is what I just added, so I could test Konsole.
            QT_QPA_PLATFORM is in my bashrc and my bashrc was copied from a previous Ubuntu installation.

            I literally just need the bog-standard Qt installation so Konsole, P4V and Wireshark function normally.

            I'd like to undo anything stupid I may have done and just reset the installation.

            Q Offline
            Q Offline
            qt77
            wrote on last edited by
            #5

            @qt77 Only result was this:

            grep -l QT /etc/environment.d/*
            /etc/environment.d/90qt-a11y.conf
            
            cat /etc/environment.d/90qt-a11y.conf
            QT_ACCESSIBILITY=1
            
            JoeCFDJ 1 Reply Last reply
            0
            • Q qt77

              @qt77 Only result was this:

              grep -l QT /etc/environment.d/*
              /etc/environment.d/90qt-a11y.conf
              
              cat /etc/environment.d/90qt-a11y.conf
              QT_ACCESSIBILITY=1
              
              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              @qt77 qmake --version?

              Q 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @qt77 qmake --version?

                Q Offline
                Q Offline
                qt77
                wrote on last edited by qt77
                #7

                @JoeCFD Hi,

                qmake --version
                qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory
                

                I think path (/usr/lib/) is the same path Konsole was unsuccessfully trying to find the shared libraries in.

                FYI I still have this set as an environment variable:

                QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/
                
                JoeCFDJ 1 Reply Last reply
                0
                • Q qt77

                  @JoeCFD Hi,

                  qmake --version
                  qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory
                  

                  I think path (/usr/lib/) is the same path Konsole was unsuccessfully trying to find the shared libraries in.

                  FYI I still have this set as an environment variable:

                  QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/
                  
                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #8

                  @qt77 you have not installed qt.
                  sudo apt install -y qtcreator qtbase5-dev qt5-qmake cmake

                  or qt6:
                  sudo apt install -y qtcreator qtbase6-dev qt6-qmake cmake

                  or you can install both of them.

                  Q 1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    @qt77 you have not installed qt.
                    sudo apt install -y qtcreator qtbase5-dev qt5-qmake cmake

                    or qt6:
                    sudo apt install -y qtcreator qtbase6-dev qt6-qmake cmake

                    or you can install both of them.

                    Q Offline
                    Q Offline
                    qt77
                    wrote on last edited by qt77
                    #9

                    @JoeCFD Just to confirm: I am not a Qt developer. I just use Konsole, P4V and Wireshark, which require Qt.

                    So originally those apps would have installed Qt as a dependency (or it was already part of Ubuntu).

                    I should still install it/them?

                    And what do I need to uninstall first, to undo the mess?

                    JoeCFDJ 1 Reply Last reply
                    0
                    • Q qt77

                      @JoeCFD Just to confirm: I am not a Qt developer. I just use Konsole, P4V and Wireshark, which require Qt.

                      So originally those apps would have installed Qt as a dependency (or it was already part of Ubuntu).

                      I should still install it/them?

                      And what do I need to uninstall first, to undo the mess?

                      JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by JoeCFD
                      #10

                      @qt77 I guess you do not need it. Simply export
                      QT_PLUGIN_PATH to the right location.

                      Since you do not install qt development packages, the apps you use need qt libs which are installed by dependency. But the plugins path is not set automatically. I think it is good enough to set QT_PLUGIN_PATH(add it in bashrc).

                      You can purge the installations. Be careful that you do not remove the libs your apps need.

                      You can check which extra libs were installed. Simply purge these libs. But these libs do not hurt you if you leave them there. No worries.

                      you can purge qtcreator and qmake for sure.

                      1 Reply Last reply
                      0

                      • Login

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