Can't start Postgresql I am unable to start postgresql on Ubuntu 

postgres@DESKTOP-1TPO12P:~$ /etc/init.d/postgresql start
     * Starting PostgreSQL 10 database server                                                                                * Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o  -c config_file="/etc/postgresql/10/main/postgresql.conf"  exited with status 1:
    2019-04-30 14:58:57.825 DST [123] LOG:  listening on IPv4 address "127.0.0.1", port 5432
    2019-04-30 14:58:57.837 DST [123] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    2019-04-30 14:58:57.891 DST [124] LOG:  database system was interrupted; last known up at 2019-04-30 14:44:15 DST
    2019-04-30 14:58:57.891 DST [124] PANIC:  could not flush dirty data: Function not implemented
    2019-04-30 14:58:57.891 DST [123] LOG:  startup process (PID 124) was terminated by signal 6: Aborted
    2019-04-30 14:58:57.891 DST [123] LOG:  aborting startup due to startup process failure
    2019-04-30 14:58:57.901 DST [123] LOG:  database system is shut down
    pg_ctl: could not start server
    Examine the log output.


I installed it using apt-get install postgresql-10
Given the error message, this is most probably happening under WSL (Windows Subsystem for Linux).

There have been recent changes in PostgreSQL related to fsync that turn out to be problematic with WSL. The specific PANIC error mentioned and a candidate solution is discussed in detail here:

WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2

Except it's not just 11.2 because the changes were made in other supported versions like the 10.7 you're probably using if you're up to date in the 10.x branch.

Note that the workaround suggested in the subject, turning fsync to off, is not for production use. It's only okay if you're playing around with Postgres on WSL, and don't really care about the durability of your data. Some say that WSL itself is not for production use anyway.

As you're using PostgreSQL 10, it's possible that this problem will be mitigated in the next bugfix release, version 10.8. Two fixes have been committed in the 10.x branch last February that look like they might address the issue.