根据Linuxize.com的做法成功了,但是在centos8上失败了。ubuntu的想安装的,照抄保证能够运行。
#sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
#sudo useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15
#sudo apt install postgresql
#sudo su - postgres -c “createuser -s odoo15”
#sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
(注。github无法访问,直接官网下载,cps命令上传,参考: scp -r /Users/maxmacu/Downloads/wkhtmltox_0.12.6-1.focal_amd64.deb max@10.84.1.176:/home/max)
#sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
(参考:sudo apt-get install /home/max/wkhtmltox_0.12.6-1.focal_amd64.deb)
#sudo su - odoo15
#git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 /opt/odoo15/odoo
#cd /opt/odoo15
#python3 -m venv odoo-venv
#source odoo-venv/bin/activate
#(venv)$ pip3 install wheel
#(venv)$ pip3 install -r odoo/requirements.txt
(换源加速pip install -r requirements.txt -i (https://pypi.tuna.tsinghua.edu.cn/simple)e)
#(venv)$ deactivate
#mkdir /opt/odoo15/odoo-custom-addons
#exit
#sudo nano /etc/odoo15.conf
[options]
; This is the password that allows database operations:
admin_passwd = my_admin_passwd
db_host = False
db_port = False
db_user = odoo15
db_password = False
addons_path = /opt/odoo15/odoo/addons,/opt/odoo15/odoo-custom-addons
#sudo nano /etc/systemd/system/odoo15.service
[Unit]
Description=Odoo15
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo15
PermissionsStartOnly=true
User=odoo15
Group=odoo15
ExecStart=/opt/odoo15/odoo-venv/bin/python3 /opt/odoo15/odoo/odoo-bin -c /etc/odoo15.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
#sudo systemctl daemon-reload
#sudo systemctl enable --now odoo15
#sudo systemctl status odoo15
#sudo journalctl -u odoo15