Adding Command to do apt-get not working


#1

Hello.

I am having trouble adding a command to install a few pre dependencies before the main dependencies are installed.

  - run:
      name: install pre dependencies
      command: apt-get update -yqq \
                && apt-get install -yqq \
                postgresql-client \
                nodejs \
                qt5-default \
                libqt5webkit5-dev \
                && apt-get -q clean \
                && rm -rf /var/lib/apt/lists

I am trying to do this and getting this error: E: The update command takes no arguments
I am unsure how to get this script to run before. As the gems to my project won’t install without items like qt5, etc… Any help is very much appreciated.


#2

I think you might need the multi-line device in YAML:

  - run:
      name: install pre dependencies
      command: |
        apt-get update -yqq
        ...

I tend to use this for everything, so I don’t have to remember how to do it if I’m expanding a single-line command to multiple lines.


#3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.