[How-To-Updated 2021] Installing AdGuardHome on OpenWrt [Manual and opkg method]

Stuck at this line now /opt/AdGuardHome/AdGuardHome: line 1: syntax error: unexpected "("

Here the steps

  1. cd /tmp
  2. wget https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_mips_softfloat.tar.gz
  3. sudo tar xvfz AdGuardHome_linux_mips_softfloat.tar.gz
  4. sudo ./opt/AdGuardHome/AdGuardHome -s stop
  5. sudo cp /tmp/AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome
  6. sudo ./opt/AdGuardHome/AdGuardHome -s start
logread -e AdGuardHome 

Sat Feb  5 17:46:02 2022 daemon.notice procd: /etc/rc.d/S95AdGuardHome: Starting AdGuardHome
Sat Feb  5 17:46:02 2022 daemon.notice procd: /etc/rc.d/S95AdGuardHome: AdGuardHome has been started
Thu Feb 10 20:03:31 2022 daemon.info procd: Instance AdGuardHome::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
Thu Feb 10 20:03:38 2022 authpriv.notice sudo:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/opt/AdGuardHome/AdGuardHome -s status
Thu Feb 10 20:03:49 2022 authpriv.notice sudo:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/opt/AdGuardHome/AdGuardHome -s start

No. Do NOT use my script. Follow the AGH team instructions on their page.

You dont have to use sudo however. You are logged into your router as "root" and thus are already administrator.

That even not working properly. For example if i use this way
wget -o '/tmp/AdGuardHome_linux_mips_softfloat.tar.gz'

It download two files

Then i untar second file and repeat same above steps. no luck.

without sudo its same error.

first file must be corrupt. the full download is 10mb.

delete both and retry.

(edit) your yaml file is corrupt i suspect.

Change directory to your /opt/AdGuardHome folder
then run this.
./AdGuardHome --check-config
it will tell you if your yaml file is ok. If it is not. Delete it and re-set AGH back up by going to your router page at port 3000 as per first install.

This giving same error ./AdGuardHome --check-config

And how to open this as its refused to connect err.

i suggest you reinstall AGH.

curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v -r

This also stuck.

Even there is no new log

it failed to install the service because it was already installed.

apt install sudo

then rerun the script if you want it to clean properly.

However AGH should start and alllow you to configure it right now.

Also take note of the file it downloaded for your router. Looks like you were using the wrong mips version. Which is why it was failing to start. Your version is mipsle not plain mips.

How to check this its MIPS or MIPSLE?

its right there at the top.
LE stands for little endian.

Ok so this version is correct?

That is what the script pulls. That is also what your cpu is.

Might explain why it doesn't self update as well. May be worth filing an issue with the AGH team as to why you do not get an "update" button on your version like the rest of us do.

(edit) so if you replace the download link from my script with your le version it will work. But be aware this makes NO checks at all and will just download the new version and replace your old one over the top.

Ok let me report them. Ty.

1 Like

Need to manually remove the old files /etc/init.d/AdGuardHome, after reboot and running that above single line command it is working now.

Few new things which i noted maybe useful for other before installing/upgrading.

a) opkg install lscpu file

root@OpenWrt:~# lscpu [This give Router Hardware CPU Architecture details]
Architecture:        mips
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
Model:               MIPS 1004Kc V2.15
BogoMIPS:            581.63
L1d cache:           64 KiB
L1i cache:           64 KiB
L2 cache:            256 KiB
Flags:               mips16 dsp mt

c) file /opt/AdGuardHome/AdGuardHome [This give details of current running application Software Architecture details ]

 file /opt/AdGuardHome/AdGuardHome
/opt/AdGuardHome/AdGuardHome: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, Go BuildID=exn93eEJx6niVA...., stripped

I updated the script in the wiki with this as I was following that script and it was stopping at that point, seems to be installed and working now.

Aaron Z

1 Like

@mercygroundabyss, do you use cloudflare for any specific reason? Unfortunately, my network is very unstable when I use cloudflare dns, it has much less latency compared to adguard itself, but the most interesting thing is that even with a higher latency, adguard dns is much better than it on my network. Would it be okay if I use adguard instead of cloudflare?

1 Like

Of course. You can use which ever dns you prefer. Its why i list the options. I just use cloudflare as its quicker and regionally based for me. In theory it should work worldwide.

1 Like

Any particular reason you set your wan with one specific dns host - (cloudflare) in this case, as opposed to like (if AGH runs on your main router and not another device connected to your LAN).
In my config I have the fastest (based on my location) and most trusted public dns providers lined up one after the other and then set AGH to Load Balancing mode.
Therefore my wan interface gets the benefit of both not querying the same server all the time as well as potentially resolving quicker in the event where other providers on my list are able to resolve quicker as determined by AGH's Load Balancing algorithm.
Just wondering if I'm missing something here logically or perhaps technically...