UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [Solved] How to download and install Apps from OpenStore via CLI?

    Scheduled Pinned Locked Moved Support
    5 Posts 3 Posters 1.2k Views 4 Watching
    Loading More Posts
    • 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.
      • C Offline
        Custello
        last edited by Custello

        I want to write a small bash script which can be used to auto-configure my Ubuntu Touch devices after resets to factory defaults.

        Is there any option available to download and install newest versions of desired apps from OpenStore via command line interface (CLI)? For example, how to install Dekko 2 via CLI?

        Maybe something like...

        • wget https://open-store.io/api/v3/apps/dekko2.dekkan/download/xenial/dekko2_armhf.click
        • pkcon install-local --allow-untrusted /Downloads/dekko2_armhf.click
        D 1 Reply Last reply Reply Quote 0
        • D Offline
          doniks @Custello
          last edited by

          @custello said in How to download and install Apps from OpenStore via CLI?:

          Maybe something like...

          looks ok. does it work?

          C 1 Reply Last reply Reply Quote 0
          • C Offline
            Custello @doniks
            last edited by Custello

            @doniks said in How to download and install Apps from OpenStore via CLI?:

            @custello said in How to download and install Apps from OpenStore via CLI?:

            Maybe something like...

            looks ok. does it work?

            • Let's assume I always want to downoad the newest version of respective .click-packages. Therefore I can not use the URL of a specific version, but have to use the overall URL to the package. Hereby I am not sure if this attempt could work with wget, because the following user prompt appears when opening the URL https://open-store.io/api/v3/apps/dekko2.dekkan/download/xenial/ in browser:

              0_1541148744700_Screenshot from 2018-11-02 08-51-44.png

              It seems that opening the URL in browser will forward the user to the actual file. I am not sure if wget could handle that request correctly, because the URL does not refer to the file directly. I've tried it in terminal, hereby wget mistakenly downloaded the index.html-file instead of the desired .click-file. 🙂 Funny fact: The index.html file has exactly 6.53 MB (what would be the same size as Dekko's .click package). Maybe wget just renamed the downloaded file as index.html?

            • Do I need to use pkcon install-local --allow-untrusted or would it work without allow-antrusted as well?

            dobeyD 1 Reply Last reply Reply Quote 0
            • dobeyD Offline
              dobey @Custello
              last edited by

              @custello said in How to download and install Apps from OpenStore via CLI?:

              Do I need to use pkcon install-local --allow-untrusted or would it work without allow-antrusted as well?

              The --allow-untrusted is required, because by simply downloading a click directly, you are missing the additional metadata, and are not verifying that what was downloaded, is trusted.

              C 1 Reply Last reply Reply Quote 1
              • C Offline
                Custello @dobey
                last edited by Custello

                @custello said in How to download and install Apps from OpenStore via CLI?:

                Funny fact: The index.html file has exactly 6.53 MB (what would be the same size as Dekko's .click package). Maybe wget just renamed the downloaded file as index.html?

                Thanks to @Ingo's knowledge, this is partly true! wget will ignore the response headers, because this is an experimental feature at that time. Therefore wget uses a standard name for the downloaded file, and this one will be a classic index.html. 🙂

                @dobey said in How to download and install Apps from OpenStore via CLI?:

                The --allow-untrusted is required, because by simply downloading a click directly, you are missing the additional metadata, and are not verifying that what was downloaded, is trusted.

                Okay, thanks a lot!

                So the final (working) command should be:

                • wget https://open-store.io/api/v3/apps/dekko2.dekkan/download/xenial/ -O /home/phablet/Downloads/dekko2.dekkan_armhf.click

                Afterwards:

                • pkcon install-local --allow-untrusted /home/phablet/Downloads/*.click
                1 Reply Last reply Reply Quote 2
                • First post
                  Last post