读完本文后问题我做到了:
gsamaras@gsamaras:~$ sudo apt-get install postgresql
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version.
The following packages were automatically installed and are no longer required:
account-plugin-windows-live asymptote asymptote-doc freeglut3 gdebi-core
gksu latex-beamer latex-xcolor libgksu2-0 libgsl0ldbl liblouis-data
liblouis2 libpoppler-qt4-4 libsigsegv2 libupstart1 linux-headers-3.16.0-30
linux-headers-3.16.0-30-generic linux-headers-3.16.0-40
linux-headers-3.16.0-40-generic linux-image-3.16.0-30-generic
linux-image-3.16.0-40-generic linux-image-extra-3.16.0-30-generic
linux-image-extra-3.16.0-40-generic pgf preview-latex-style prosper ps2eps
python-imaging-tk python3-brlapi python3-louis python3-pyatspi
python3-speechd texlive-extra-utils texlive-font-utils
texlive-generic-recommended texlive-lang-english texlive-latex-extra
texlive-latex-extra-doc texlive-latex-recommended
texlive-latex-recommended-doc texlive-pictures texlive-pictures-doc
texlive-pstricks texlive-pstricks-doc texmaker-data
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
gsamaras@gsamaras:~$ sudo service postgres restart
postgres: unrecognized service
gsamaras@gsamaras:~$ sudo apt-get install postgresql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'postgresql-server' has no installation candidate
任何想法?
答案1
在我的笔记本电脑上,正确的服务是postgresql
且否postgres
。
检查service --status-all | grep postgres
所以你应该尝试service postgresql start