How to define a permission to save a file on Ubuntu [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
-1
down vote

favorite













This question already has an answer here:



  • How do I get permissions to edit system configuration files?

    8 answers



I am trying to install postgreSQL



I open terminal and type the



gedit /etc/apt/sources.list.d/pgdg.list


then in Gedit I enter this line



deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main


The when I try to save the file red colored text appears saying:




Could not save the file “/etc/apt/sources.list.d/pgdg.list”.
you do not have the permission necessary to save the file. Please check that you typed the location correctly and try again




How do I solve this problem?










share|improve this question















marked as duplicate by steeldriver, Eric Carvalho, user535733, Zanna, karel Feb 28 at 0:24


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
    – user535733
    Feb 27 at 16:46















up vote
-1
down vote

favorite













This question already has an answer here:



  • How do I get permissions to edit system configuration files?

    8 answers



I am trying to install postgreSQL



I open terminal and type the



gedit /etc/apt/sources.list.d/pgdg.list


then in Gedit I enter this line



deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main


The when I try to save the file red colored text appears saying:




Could not save the file “/etc/apt/sources.list.d/pgdg.list”.
you do not have the permission necessary to save the file. Please check that you typed the location correctly and try again




How do I solve this problem?










share|improve this question















marked as duplicate by steeldriver, Eric Carvalho, user535733, Zanna, karel Feb 28 at 0:24


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
    – user535733
    Feb 27 at 16:46













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite












This question already has an answer here:



  • How do I get permissions to edit system configuration files?

    8 answers



I am trying to install postgreSQL



I open terminal and type the



gedit /etc/apt/sources.list.d/pgdg.list


then in Gedit I enter this line



deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main


The when I try to save the file red colored text appears saying:




Could not save the file “/etc/apt/sources.list.d/pgdg.list”.
you do not have the permission necessary to save the file. Please check that you typed the location correctly and try again




How do I solve this problem?










share|improve this question
















This question already has an answer here:



  • How do I get permissions to edit system configuration files?

    8 answers



I am trying to install postgreSQL



I open terminal and type the



gedit /etc/apt/sources.list.d/pgdg.list


then in Gedit I enter this line



deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main


The when I try to save the file red colored text appears saying:




Could not save the file “/etc/apt/sources.list.d/pgdg.list”.
you do not have the permission necessary to save the file. Please check that you typed the location correctly and try again




How do I solve this problem?





This question already has an answer here:



  • How do I get permissions to edit system configuration files?

    8 answers







permissions postgresql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 27 at 22:55









Zanna

48.2k13120228




48.2k13120228










asked Feb 27 at 14:03









kashif naqvi

1




1




marked as duplicate by steeldriver, Eric Carvalho, user535733, Zanna, karel Feb 28 at 0:24


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by steeldriver, Eric Carvalho, user535733, Zanna, karel Feb 28 at 0:24


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
    – user535733
    Feb 27 at 16:46

















  • Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
    – user535733
    Feb 27 at 16:46
















Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
– user535733
Feb 27 at 16:46





Downvoting due to apparent lack of research. How to install postgresql properly is clearly documented.
– user535733
Feb 27 at 16:46











1 Answer
1






active

oldest

votes

















up vote
1
down vote













You need to modify this file as root. From the terminal, type



sudo -H gedit /etc/apt/sources.list.d/pgdg.list


Then you can modify inside gedit and save it as you tried before



The sudo command means that you will run the command as root and it will ask you for your password






share|improve this answer






















  • thanks solve that problem further you tell me how to install postgresql
    – kashif naqvi
    Feb 27 at 14:11






  • 1




    Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
    – pa4080
    Feb 27 at 14:11











  • @kashif sudo apt-get install postgresql
    – Félicien
    Feb 27 at 14:15










  • Installation completely continued but a error fond that
    – kashif naqvi
    Feb 27 at 14:22

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













You need to modify this file as root. From the terminal, type



sudo -H gedit /etc/apt/sources.list.d/pgdg.list


Then you can modify inside gedit and save it as you tried before



The sudo command means that you will run the command as root and it will ask you for your password






share|improve this answer






















  • thanks solve that problem further you tell me how to install postgresql
    – kashif naqvi
    Feb 27 at 14:11






  • 1




    Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
    – pa4080
    Feb 27 at 14:11











  • @kashif sudo apt-get install postgresql
    – Félicien
    Feb 27 at 14:15










  • Installation completely continued but a error fond that
    – kashif naqvi
    Feb 27 at 14:22














up vote
1
down vote













You need to modify this file as root. From the terminal, type



sudo -H gedit /etc/apt/sources.list.d/pgdg.list


Then you can modify inside gedit and save it as you tried before



The sudo command means that you will run the command as root and it will ask you for your password






share|improve this answer






















  • thanks solve that problem further you tell me how to install postgresql
    – kashif naqvi
    Feb 27 at 14:11






  • 1




    Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
    – pa4080
    Feb 27 at 14:11











  • @kashif sudo apt-get install postgresql
    – Félicien
    Feb 27 at 14:15










  • Installation completely continued but a error fond that
    – kashif naqvi
    Feb 27 at 14:22












up vote
1
down vote










up vote
1
down vote









You need to modify this file as root. From the terminal, type



sudo -H gedit /etc/apt/sources.list.d/pgdg.list


Then you can modify inside gedit and save it as you tried before



The sudo command means that you will run the command as root and it will ask you for your password






share|improve this answer














You need to modify this file as root. From the terminal, type



sudo -H gedit /etc/apt/sources.list.d/pgdg.list


Then you can modify inside gedit and save it as you tried before



The sudo command means that you will run the command as root and it will ask you for your password







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 27 at 14:14

























answered Feb 27 at 14:06









Félicien

8471516




8471516











  • thanks solve that problem further you tell me how to install postgresql
    – kashif naqvi
    Feb 27 at 14:11






  • 1




    Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
    – pa4080
    Feb 27 at 14:11











  • @kashif sudo apt-get install postgresql
    – Félicien
    Feb 27 at 14:15










  • Installation completely continued but a error fond that
    – kashif naqvi
    Feb 27 at 14:22
















  • thanks solve that problem further you tell me how to install postgresql
    – kashif naqvi
    Feb 27 at 14:11






  • 1




    Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
    – pa4080
    Feb 27 at 14:11











  • @kashif sudo apt-get install postgresql
    – Félicien
    Feb 27 at 14:15










  • Installation completely continued but a error fond that
    – kashif naqvi
    Feb 27 at 14:22















thanks solve that problem further you tell me how to install postgresql
– kashif naqvi
Feb 27 at 14:11




thanks solve that problem further you tell me how to install postgresql
– kashif naqvi
Feb 27 at 14:11




1




1




Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
– pa4080
Feb 27 at 14:11





Don't use GUI applications with sudo (without additional parameters) this will change some file's permissions in the user's home directory, that will cause errors in the future. Use: sudo -H, or sudo -i, or gksu (gksudo). The best approach is to learn to work with some terminal based editor as nano - sudo nano /path/to/file is correct. To recover from previous wrong usage: sudo chown $USER:USER $HOME.
– pa4080
Feb 27 at 14:11













@kashif sudo apt-get install postgresql
– Félicien
Feb 27 at 14:15




@kashif sudo apt-get install postgresql
– Félicien
Feb 27 at 14:15












Installation completely continued but a error fond that
– kashif naqvi
Feb 27 at 14:22




Installation completely continued but a error fond that
– kashif naqvi
Feb 27 at 14:22


Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491