I would like to create a site with hugo.
In the installation phase, I am stuck with an error message. Could you please help me?
Thanks in advance.
Here is the message:
Deltas resolution: 100% (1467/1467), done.
m9@m9-Lenovo-B50-50:~$ echo “theme = ‘ananke’” >> config.toml
m9@m9-Lenovo-B50-50:~$ hugo server
Error: add site dependencies: create deps: failed to create file caches from configuration: mkdir /tmp/hugo_cache/m9: permission denied
m9@m9-Lenovo-B50-50:~$ hugo new site quickstart
Error: /home/m9/quickstart already exists and is not empty. See --force.
)
The quickstart folder already exists, so there are multiple theme keys inside the config file, since you performed the echo command multiple times on the same folder.
You can remove or rename the quickstart folder and try again. Or remove the duplicate theme keys from the config.toml file.
I am a beginner and do not understand everything.
Could you please correct what is wrong with this command? It will be easier for me.
Thanks in advance.
In short, rename or remove the previous folder first, and then perform the commands you posted should work.
mv quickstart quickstart-bak
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> config.toml
hugo server
Explanations:
You’re performing the same commands on the same folder multiple times, and the echo "theme = 'ananke'" >> config.toml appends the content at the end of the config file, so that there are multiple theme key inside the configuration, which is not allowed. You can fix it by one of following ways:
Rename or remove the previous folder.
Modify the config.toml to remove the duplicate theme keys.