Hi Jaskaran,
I assume you are referring to Describe Azure compute and networking services - Unit 3 Exercise - Create an Azure Virtual Machine. Please correct me if my assumption is wrong.
In this exercise it is not intended for you to run apt-get update command manually. This command gets executed inside the VM automatically when you copy/paste/enter the az vm extension set command into the cloud shell window.
If you want to manually run the apt-get update command you can, however, first you need to connect to the VM using ssh.
Please Activate a new sandbox and complete the exercise again. Please note that you need to complete both this exercise as well as the exercise of Unit 9 within the 1 hour time limit the sandbox is active. If you do not you will need to go back to this exercise, Activate new sandbox, complete exercise, then jump back to Unit 9 exercise.
Please click Accept Answer if the above was useful. If something is unclear or you still need assistance, add a comment.
Thanks.
-TP