title: "E: Invalid operation update" error while running shell scripts in WSL
body: <p>I have a shell script called <code>setup_wsl.sh</code> which contains:</p>
  
  <pre><code>#!/bin/bash
  
  echo "hai"
  sudo apt-get update
  sudo apt-get install \
      apt-transport-https \
      ca-certificates \
      curl \
      gnupg-agent \
      software-properties-common
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  sudo apt-key fingerprint 0EBFCD88
  sudo add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \
     stable"  
  sudo apt-get update
  sudo apt-get install docker-ce docker-ce-cli containerd.io
  </code></pre>
  
  <p>When i run the script as ./setup_wsl.sh in WSL ( installed distro is ubuntu 18.04), errors occur as:</p>
  
  <pre><code>hai
  E: Invalid operation update
  E: Unable to locate package
  ./setup_wsl.sh: 4: ./setup_wsl.sh: apt-transport-https: not found
  ./setup_wsl.sh: 5: ./setup_wsl.sh: ca-certificates: not found
  curl: (3) Illegal characters found in URL
  ./setup_wsl.sh: 7: ./setup_wsl.sh: gnupg-agent: not found
  : not found ./setup_wsl.sh: software-properties-common
  : not found ./setup_wsl.sh:
  </code></pre>
  
  <p>The first command of the script works fine as it gives output "hai".</p>
  
  <p>Can someone help me to find why these errors occured?  </p>