When i run
sudo repo init -u https://github.com/LineageOS/android.git -b lineage-18.1
I am getting error -
File "/home/rahul/android/lineage/.repo/repo/main.py", line 79
file=sys.stderr)
^ SyntaxError: invalid syntax
if i run above command without sudo, i am getting following error -
/snap/git-repo/18/usr/bin/python: can't open file '/home/rahul/android/lineage/.repo/repo/main.py': [Errno 13] Permission denied
I am having python3 on my system.
Any idea how to fix?
sudodoesn't cause syntax errors. There must be more to this. What is the code actually getting executed? What isrepo? How does it use Git? Have you tried running in verbose mode (see documentation) to find out more? That said, it's often wrong to usesudo. In other words: This might be a bug inrepo, it could be faulty use on your side. I don't see a programming question though, so I'd be tempted to close this as off-topic.repoitself uses Python; your setup is probably causingrepoitself to use the wrong version of Python (as run bysudo).