Downloading the Android support library from command line
sdkmanager "extras;android;m2repository"
worked for me.
I ran in to the error: Warning: File /var/root/.android/repositories.cfg could not be loaded.
so I had to create that file before running the above command.
touch ~/.android/repositories.cfg
echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
android
command is deprecated now
You can use sdkmanager
instead like so:
sdkmanager --install "extras;android;m2repository"