Installing Odoo 10 on Smallest Linode Instance without FQDN

Follow Linode docs for Installing Odoo 10 on Ubuntu, but am going to run it on Debian.

Also Linode docs for Getting Started and securing the server, including Fail2Ban.

Using gmail for SMTP with sendmail:

NOTE: editing mail configs done as super user with sudo su, otherwise cd is not recognized when run with sudo cd.

Since I am running this server without a FQDN, I also need to fake one:

root@yemaya:/etc/mail# cat /etc/hosts   localhost   localhost.localdomain   localhost
# Remove following line
# server_name    hostname.home.local server_name


root@yemaya:/etc/mail# cat /etc/hostfile
hostname.home.local server_name

May set up an Iptables firewall, but first will get things up and running.

Now for Odoo.

sudo apt install git
sudo git clone --depth 1 --branch 10.0 --single-branch /opt/odoo
sudo apt install python-pip
sudo pip install -r /opt/odoo/doc/requirements.txt
sudo pip install -r /opt/odoo/requirements.txt

Get an error

    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?


sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml

More errors on installing /opt/odoo/requirements.txt:

/usr/bin/ld: cannot find -lz
  In file included from Modules/LDAPObject.c:9:0:
  Modules/errors.h:8:18: fatal error: lber.h: No such file or directory
   #include "lber.h"
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  Failed building wheel for python-ldap

This seems to be because libxml2-dev was not yet installed. Here I install it with other libraries some of which are already installed.

sudo apt-get install libxml2-dev libxslt-dev python-dev lib32z1-dev

Then, run pip install lxml which probably hadn’t worked the first time.

Also had to apt-get install libldap2-dev and libsasl2-dev.

Then there were errors installing Wkhtmltopdf:

dpkg: dependency problems prevent configuration of wkhtmltox:

Which were NOT SOlved this way:

sudo apt-get -f install

SOlution ended up being:

apt --fix-broken install
sudo apt-get install gdebi-core

Then if you ran sudo gdebi wkhtmltox-0.12.1_linux-trusty-amd64.deb you would get the message that the requirement is already satisfied.

Oh. Not quite. Missing libpng12-0! Couldn’t find source for apt so:

sudo gdebi libpng12-0_1.2.54-1ubuntu1_amd64.deb 
sudo wget
sudo gdebi libjpeg-turbo8_1.4.2-0ubuntu3_amd64.deb
sudo wget
sudo gdebi libssl1.0.0_1.0.2g-1ubuntu4.10_amd64.deb

Now I can finally run sudo gdebi wkhtmltox-0.12.1_linux-trusty-amd64.deb successfully.

More missing dependencies. Adding debian source to /etc/apt/sources.list:

## Manually added for libpng12-0 and others.
deb stretch main contrib non-free
deb-src stretch main contrib non-free

What a pain. I was able to install

sudo apt install git python-pip postgresql python-all-dev python-dev python-setuptools libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev pkg-config libtiff5-dev  libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev liblcms2-utils libwebp-dev tcl8.6-dev tk8.6-dev python-tk libyaml-dev fontconfig


E: Unable to locate package postgresql-server-dev-9.5
E: Couldn't find any package by glob 'postgresql-server-dev-9.5'
E: Couldn't find any package by regex 'postgresql-server-dev-9.5'
E: Package 'libjpeg8-dev' has no installation candidate

One down: sudo apt install postgresql-server-dev-9.6, and it looks like we don’t need to install libjpg8-dev because we have libjpeg62-turbo-dev:

Package libjpeg8-dev is not available, but is referred to by another package...
However the following packages replace it:

Up and running. Now to configure the database through the GUI.

What’s the database name?

sudo -u postgres psql postgres
# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(3 rows)