Search code examples
bashpostgresqlubuntu-14.04createfile

Ubuntu 14 creating file under /etc/apt/sources.list.d


I am trying to install postgree on Ubuntu 14 as explained here: http://www.postgresql.org/download/linux/ubuntu/

And trying to create file inside /etc/apt/sources.list.d directory:

sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list

but get this error:

bash: /etc/apt/sources.list.d/pgdg.list: Permission denied

How I should do that?


Solution

  • You should refer to this answered question : "The redirection is done by the shell before sudo is even started. "