sudo vi ~/etc/profile 报错E212:Can't open file for writing

On Linux system, when installing SPARK,
input in the command line window: sudo vi ~/etc/profile
input:
#SPARK_HOME
SPARK_HOME=/home/luoji/JAVA/spark-2.3.1-bin-hadoop2.7
PATH= SPARKHOME / bin: SPARK_HOME /bin:SPARKHOME/bin:PATH

Then press ESC and enter: wq!
Error E212: Can't open file for writing to
check all the materials, and found that the permissions are incorrect. The creator of the profile is local, so the permissions need to be changed.
Command line input: sudo chown user name: group name file name For
example: sudo chown luoji profile
and then find the file like windows operating system,
Insert picture description here
right click, click properties, and give permissions.
Insert picture description here

Then you can edit it with the textb editor. Insert picture description here
After that, add it in and save.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43290383/article/details/82861529