Can you try it with only 1 of these $ at the beginning of each line.
Example, if you have entered sudo, and when asked, your password, then it will already have the $ displayed on each line.
Example, if you have entered sudo, and when asked, your password, then it will already have the $ displayed on each line.