ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Brew.sh retry failed installations

    IT Discussion
    brew osx mac apple setup
    2
    8
    1.2k
    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.
    • DustinB3403D
      DustinB3403
      last edited by DustinB3403

      How are you guys using brew and getting programs that fail to download to retry?

      IE: brew cask install adobe-acrobat-pro failed to download.

      Yet if I open a new shell and run the same command it works, any pointers?

      PS. I realize that this is likely an Internet performance related issue, but there isn't much that I can do to address the underlying cause.

      1 Reply Last reply Reply Quote 3
      • DustinB3403D
        DustinB3403
        last edited by

        I do have this whole setup process scripted, which makes life easier. But it's such a nusiance to have to go back and reinstall the items that failed.

        What I've been doing is just rerunning the script as running the install command doesn't effect things already installed. But this seems sloppy.

        1 Reply Last reply Reply Quote 0
        • M
          marcinozga
          last edited by

          Delete cached packages in ~/Library/Caches/Homebrew/ - this will also wipe plain brew package cache, if you want to limit this to cask, then delete just content of Cask subfolder. That usually solves all installation problems for me.

          DustinB3403D 1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403 @marcinozga
            last edited by

            @marcinozga yeah that works for the imcomplete downloads, but how would I automate this? And while I've had a few incomplete downloads to clear out (namely Filezilla) this doesn't appear to be the main issue.

            How would I automate retrying to install the failed items?

            M 1 Reply Last reply Reply Quote 0
            • M
              marcinozga @DustinB3403
              last edited by

              @DustinB3403 With Ansible for example, there's a module for brew package installation, and you can specify task to retry until you get desired result.

              DustinB3403D 1 Reply Last reply Reply Quote 0
              • DustinB3403D
                DustinB3403 @marcinozga
                last edited by

                @marcinozga I've not played with ansible, but maybe I can find something.

                M 1 Reply Last reply Reply Quote 0
                • M
                  marcinozga @DustinB3403
                  last edited by marcinozga

                  @DustinB3403 See this:

                  https://github.com/geerlingguy/ansible-role-homebrew

                  it's a rather complex role, and it covers complete brew installation, clearing cache and the whole nine yards. If you want to retry it, add following parameters to Cask task, in main.yml file

                  retries: 2
                  delay: 5
                  register: result
                  until: result.rc == 0
                  

                  so it looks like this

                  # Cask.
                  - name: Install configured cask applications.
                    homebrew_cask:
                      name: "{{ item }}"
                      state: present
                      install_options: "appdir={{ homebrew_cask_appdir }}"
                      accept_external_apps: "{{ homebrew_cask_accept_external_apps }}"
                    with_items: "{{ homebrew_cask_apps }}"
                    retries: 2
                    delay: 5
                    register: result
                    until: result.rc == 0
                    notify:
                      - Clear homebrew cache
                  

                  You might have to adjust delay, but that should do the trick.

                  1 Reply Last reply Reply Quote 1
                  • DustinB3403D
                    DustinB3403
                    last edited by

                    Now I'm getting Unexpected end of File

                    FML. . . what changed!

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post