Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues running on Arch Linux #137

Closed
chriscoxe opened this issue May 16, 2023 · 7 comments
Closed

Issues running on Arch Linux #137

chriscoxe opened this issue May 16, 2023 · 7 comments

Comments

@chriscoxe
Copy link

I had to do the following two workarounds in order to successfully run it on Arch Linux:

  1. sudo pihole-updatelists assumes that the directory /etc/bash_completion.d already exists. I had to create it (I did sudo mkdir /etc/bash_completion.d), otherwise it fails with an error message about it when I run it. Maybe it should create it if it doesn't already exist?
  2. sudo pihole-updatelists fails with an error message on my OS (Arch Linux) because it assumes pihole exists at /usr/local/bin/pihole. On my OS (Arch Linux), it exists at /usr/bin/pihole, not /usr/local/bin/pihole. To work around this, I did sudo ln -s /usr/bin/pihole /usr/local/bin/pihole. I'm not sure if this way was the proper/best way to work around it, so I'm not sure what the best way to solve this in pihole-updatelists would be?

After I made those two changes, it started working.

If it matters, FYI I'm using pi-hole-standalone which I installed via the instructions at https://wiki.archlinux.org/title/Pi-hole.

Thanks for writing/maintaining this great tool - it's just what I wanted and seems to be working fine after the workarounds.

@jacklul
Copy link
Owner

jacklul commented May 16, 2023

  1. sudo pihole-updatelists assumes that the directory /etc/bash_completion.d already exists. I had to create it (I did sudo mkdir /etc/bash_completion.d), otherwise it fails with an error message about it when I run it. Maybe it should create it if it doesn't already exist?

I believe you meant install script instead. Fixed in 3ecf053.

2. sudo pihole-updatelists fails with an error message on my OS (Arch Linux) because it assumes pihole exists at /usr/local/bin/pihole. On my OS (Arch Linux), it exists at /usr/bin/pihole, not /usr/local/bin/pihole. To work around this, I did sudo ln -s /usr/bin/pihole /usr/local/bin/pihole. I'm not sure if this way was the proper/best way to work around it, so I'm not sure what the best way to solve this in pihole-updatelists would be?

Added PIHOLE_CMD config variable, simply set it to /usr/bin/pihole in the config file. (388d3b2)
Your symlink will no longer be required once you set that variable.

Tagging #136 as something similar was requested there.

@chriscoxe
Copy link
Author

Thanks for the quick response!

FYI only: for posterity, here are all the commands I used to successfully install & run it (note: I'm not using docker) on Arch Linux (and/or for pihole standalone as opposed to pihole server, if it makes any difference) after I had installed & configured pihole standalone. It includes the two workarounds. I only did the workarounds today though, so I haven't had time to evaluate whether my adlists/whitelists/regex blacklists are blocking stuff that I intend to use.

# Ensure that sqlite is installed. Check via:
pacman -Q | grep sqlite
# Then:
sudo pacman -S php php-sqlite
sudo vim /etc/php/php.ini
# Uncomment these two lines so that they become the following, then save and close:
extension=pdo_sqlite
extension=sqlite3
# Note: the first workaround for pihole-updatelists (should not be needed in future versions):
sudo mkdir /etc/bash_completion.d
# Run the following command, as per the instructions at the time of writing at https://github.com/jacklul/pihole-updatelists/blob/master/README.md :
wget -O - https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/install.sh | sudo bash
# It's optional, but I want to have my own extended adlists, so create a file e.g.:
sudo vim /etc/pihole-updatelists.adlists-extended.txt
# ... containing my own list-of-lists that I will try (i.e. in addition to 3rd party list-of-lists that I will also use):
https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt 
https://www.github.developerdan.com/hosts/lists/tracking-aggressive-extended.txt
https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt
https://blocklistproject.github.io/Lists/tracking.txt
https://blocklistproject.github.io/Lists/malware.txt
https://blocklistproject.github.io/Lists/ads.txt
https://blocklistproject.github.io/Lists/fraud.txt
https://blocklistproject.github.io/Lists/phishing.txt
https://blocklistproject.github.io/Lists/ransomware.txt
https://blocklistproject.github.io/Lists/scam.txt
# ... then save and close.
# It's optional, but I want to have my own regex blacklist in addition to using curated regex blacklist(s), so create a file e.g.:
sudo vim /etc/pihole-updatelists.regex_blacklist-extended.txt
# ... containing the desired regexes in the same format as e.g. https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list, then save and close.
# Note: the second workaround for pihole-updatelists (should be able to edit PIHOLE_CMD instead in future versions):
sudo ln -s /usr/bin/pihole /usr/local/bin/pihole
# Configure adlists/whitelists/blacklists/regex blacklists as follows (i.e. I followed the advice at https://github.com/jacklul/pihole-updatelists/blob/master/README.md and am additionally using my own adlist and additionally using my own regex blacklist; I haven't tried additionally using my own whitelist yet):
sudo vim /etc/pihole-updatelists.conf
# ... and change the following line:
ADLISTS_URL=""
# ... to:
ADLISTS_URL="https://v.firebog.net/hosts/lists.php?type=tick /etc/pihole-updatelists.adlists-extended.txt"
# ... and change the following line:
WHITELIST_URL=""
# ... to:
WHITELIST_URL="https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt https://github.com/mmotti/pihole-regex/raw/master/whitelist.list"
# ... and change the following line:
REGEX_BLACKLIST_URL=""
# ... to:
REGEX_BLACKLIST_URL="https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list /etc/pihole-updatelists.regex_blacklist-extended.txt"
# ... then save and close.
sudo pihole-updatelists

@jacklul
Copy link
Owner

jacklul commented May 16, 2023

I'm curious: does the Pi-hole official installer not work on Arch?

@chriscoxe
Copy link
Author

chriscoxe commented May 16, 2023

I haven't tried - I followed the official instructions for Arch Linux at https://wiki.archlinux.org/title/Pi-hole but I didn't need pihole's server nor GUI so (in true Arch Linux fashion...) I installed the pihole standalone variant using the instructions on that page. For packages, I tend to follow the Arch-specific instructions if Arch Linux has a page about a package.

Some other feedback/queries based on my experience installing for pihole standalone (on Arch Linux) in case you're interested:

  • The README.md says:

If you don't plan on updating adlists or want to keep Pi-hole's gravity update schedule you should skip this section and set UPDATE_GRAVITY=false in the configuration file.
Do you mean "updating", or "editing"?

  • My impression is that you don't want pihole to update gravity if pihole-updatelists updates gravity. If I am correct, is it simply because it's unnecessary, or is it more serious, such as because e.g. it could cause corruption etc if it happens at the same time that pihole-updatelists (running manually) or its schedule updates gravity?
  • I installed pihole standalone but on my OS anyway (Arch Linux), it seems to use systemd for scheduling, not cron. The instructions under section "Disable default gravity update schedule" only mention cron, not systemd, so I didn't know what to do, and I was unclear what harm might be caused if pihole-updatelists and pihole updated gravity at the same time, so I decided to risk it and not change anything (let them both individually update gravity when run manually or scheduled). Any comment?

@jacklul
Copy link
Owner

jacklul commented May 16, 2023

  • My impression is that you don't want pihole to update gravity if pihole-updatelists updates gravity. If I am correct, is it simply because it's unnecessary, or is it more serious, such as because e.g. it could cause corruption etc if it happens at the same time that pihole-updatelists (running manually) or its schedule updates gravity?
    Do you mean "updating", or "editing"?

I've seen people using my tool just to add the lists in bulk in the past and sync it from time to time manually or those who want to keep the original schedule.
You can use my tool to not touch adlists at all and only update other lists, gravity update is only required when updating adlists.

  • I installed pihole standalone but on my OS anyway (Arch Linux), it seems to use systemd for scheduling, not cron. The instructions under section "Disable default gravity update schedule" only mention cron, not systemd, so I didn't know what to do, and I was unclear what harm might be caused if pihole-updatelists and pihole updated gravity at the same time, so I decided to risk it and not change anything (let them both individually update gravity when run manually or scheduled). Any comment?

No matter what system you're using Pi-hole installer installs a crontab file at /etc/cron.d/pihole, if you installed manually you're missing some of them.

@chriscoxe
Copy link
Author

So the "Disable default gravity update schedule" section is optional, not required?

I gather that "pihole standalone" is an Arch alteration of pihole for a standalone PC, and doesn't use cron. So, it's not really "pihole" as such and I wouldn't expect pihole-updatelists to support it, although it's nice that it appears to work regardless.

@jacklul
Copy link
Owner

jacklul commented May 17, 2023

So the "Disable default gravity update schedule" section is optional, not required?

Is not required, but recommended as there is no point in running gravity update twice in two days.

These are the default crontab entries: https://github.com/pi-hole/pi-hole/blob/master/advanced/Templates/pihole.cron
As you can see you're losing the update checker and log rotation functionality.

@jacklul jacklul closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants