Display Moon Phases in Ubuntu

Published: November 17, 2022

Display Moon Phases in Ubuntu

In this article, we cover how to display moon phases in Ubuntu through moonphases command-line utility. There are mainly four primary phases of Moon - New Moon, First Quarter, Full Moon, and Last Quarter. These phases gradually change over lunar month of nearly 29.53 days.

The utility moonphases is available through undertime package. So, we have to install that first.

Note: Following operations require superuser privileges. In case you don't have one then, we advise you to contact your System Administrator for assistance.

Install undertime in Ubuntu

The package is available through standard Ubuntu repository therefore, update the repository first. This ensures we get to have the latest version of the package. Hence, open a terminal and issue the following -

sudo apt update

Next, to install undertime -

sudo apt install undertime

Moon Phases in Ubuntu

With the package installed, we can now use moonphases command-line utility. With the help of moonphases, we can get the Moon phases for a given time interval. Use the following syntax -

moonphases <start> <end>

If we just enter the following command -

moonphases

It shows the results for current cycle. But, if we want to know all the Moon phases between 2023-01 and 2023-04 -

moonphases 2023-01 2023-04

Similarly, we can do that for number of years as well, Moon phases between 2024 and 2027 -

moonphases 2024 2027

Even for specific dates, we can get the data. Moon phases between 2023-01-10 and 2023-01-30 -

moonphases 2023-01-10 2023-01-30

In conclusion, we have covered how to display Moon phases in Ubuntu here. The command-line utility is moonphases and it is available through undertime package.

Additional Info -

Apart from moonphases command-line utility, we also have wmmoonclock package through which we can get required data. To install it -

sudo apt update
sudo apt install wmmoonclock

It can be launched through our Systems' main menu. It would be available as dockable clock. If you want more details, then left-click the wmMoonClock and it shows a different page with a different set of data.