Files
weewx/docs_src/quickstarts/debian.md

161 lines
4.4 KiB
Markdown

# Installation on Debian systems
This is a guide to installing WeeWX from a DEB package on systems based on
Debian, including Ubuntu, Mint, and Raspberry Pi OS.
WeeWX V5 requires Python 3.7 or greater, which is only available on Debian 10
or later. For older systems, either use WeeWX V4, or install Python 3.7 then
[install WeeWX V5 using pip](../pip).
## Configure `apt`
The first time you install WeeWX, you must configure `apt` so that it will
trust weewx.com, and know where to find the WeeWX releases.
1. Tell your system to trust weewx.com.
```{.shell .copy}
wget -qO - https://weewx.com/keys.html | \
sudo gpg --dearmor --output /etc/apt/trusted.gpg.d/weewx.gpg
```
2. Tell `apt` where to find the WeeWX repository.
```{.shell .copy}
echo "deb [arch=all] https://weewx.com/apt/python3 buster main" | \
sudo tee /etc/apt/sources.list.d/weewx.list
```
If you encounter errors, please consult the
[FAQ](https://github.com/weewx/weewx/wiki/faq-apt-key-problems).
## Install
Use `apt` to install WeeWX. The installer will prompt for a location,
latitude/longitude, altitude, station type, and parameters specific to your
station hardware. When you are done, WeeWX will be running in the background
as a daemon.
```{.shell .copy}
sudo apt update
sudo apt install weewx
```
## Verify
After about 5 minutes (the exact length of time depends on your archive
interval), copy the following and paste into a web browser:
/var/www/html/weewx/index.html
You should see your station information and data.
Check the system log `/var/log/syslog` for problems.
## Configure
If you chose the simulator as your station type, then at some point you will
probably want to switch to using real hardware. This is how to reconfigure.
```{.shell .copy}
# Stop the daemon
sudo systemctl stop weewx
# Reconfigure to use your hardware
sudo weectl station reconfigure
# Delete the old database
sudo rm /var/lib/weewx/weewx.sdb
# Start the daemon
sudo systemctl start weewx
```
## Customize
To enable uploads or to customize reports, modify the configuration file.
See the [*Customization Guide*](../../custom/introduction) for instructions,
and the [application](../../reference/weewx-options/introduction) and
[skin](../../reference/skin-options/introduction) references for all of
the options.
Use any text editor, such as `nano`:
```shell
sudo nano /etc/weewx/weewx.conf
```
WeeWX must be restarted for the changes to take effect.
```{.shell .copy}
sudo systemctl restart weewx
```
## Upgrade
Upgrade to the latest version like this:
```{.shell .copy}
sudo apt update
sudo apt install weewx
```
The upgrade process will not modify the WeeWX databases.
Unmodified files will be upgraded. If modifications have been made to the
WeeWX configuration, you will be prompted whether you want to keep the
existing configuration or accept the new configuration. Either way, a copy of
the option you did not choose will be saved.
For example, if `/etc/weewx/weewx.conf` was modified, you will see a message
something like this:
```
Configuration file `/etc/weewx/weewx.conf'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** weewx.conf (Y/I/N/O/D/Z) [default=N] ?
```
Choosing `Y` or `I` (install the new version) will place your old
configuration in `/etc/weewx/weewx.conf.dpkg-old`, where it can be
compared with the new version in `/etc/weewx/weewx.conf`.
Choosing `N` or `O` (keep the current version) will place the new
configuration in `/etc/weewx/weewx.conf.X.Y.Z`, where `X.Y.Z` is the
new version number. It can then be compared with your old version which
will be in `/etc/weewx/weewx.conf`.
!!! Note
In most cases you should choose `N` (the default).
## Uninstall
To uninstall WeeWX, but retain configuration files and data:
```{.shell .copy}
sudo apt remove weewx
```
To uninstall WeeWX, deleting configuration files but retaining data:
```{.shell .copy}
sudo apt purge weewx
```
To delete data:
```{.shell .copy}
sudo rm -r /var/lib/weewx
sudo rm -r /var/www/html/weewx
```