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

Installing for MacOS #2613

Closed
moofawsaw opened this issue Jan 29, 2021 · 31 comments
Closed

Installing for MacOS #2613

moofawsaw opened this issue Jan 29, 2021 · 31 comments
Labels

Comments

@moofawsaw
Copy link

I migrated my Mac that had Adguard Home installed (Catalina) to a 2020 Mac with the M1 Chipset and was experiencing issues with the upstream server so I figured I would do a fresh install by removing Adguard Home using sudo /opt/AdGuardHome/AdGuardHome -s uninstall.

Then when I downloaded the MacOS 64-bit file and run it (from here: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started), I received the following error:

2021/01/29 15:03:14 [error] Couldn't read config file /Users/user/Downloads/AdGuardHome 8/AdGuardHome.yaml: open /Users/user/Downloads/AdGuardHome 8/AdGuardHome.yaml: no such file or directory
2021/01/29 15:03:14 [info] AdGuard Home, version 0.104.3, channel release, arch darwin amd64
2021/01/29 15:03:14 [info] This is the first time AdGuard Home is launched
2021/01/29 15:03:14 [info] Checking if AdGuard Home has necessary permissions
2021/01/29 15:03:14 [fatal] Permission check failed.

AdGuard Home is not allowed to bind to privileged ports (for instance, port 53).
Please note, that this is crucial for a server to be able to use privileged ports.

You have two options:
1. Run AdGuard Home with root privileges
2. On Linux you can grant the CAP_NET_BIND_SERVICE capability:
https://github.com/AdguardTeam/AdGuardHome/internal/wiki/Getting-Started#running-without-superuser
logout

I installed Adguard Home and had it configured no problem while on my old Mac running Catalina. It was also working when I migrated between computers. What went wrong after uninstalling and trying to re-install?

@ameshkov
Copy link
Member

ameshkov commented Jan 31, 2021

Have you placed it to the "Applications" directory? For some reason it's important to have it there.

Also, check if port 53 is free.

@moofawsaw
Copy link
Author

I tried launching from the applications folder and receive the same error. Here is what is shows when I check post 53:

MacBook-Air:~ user$ netstat -vanp tcp | grep 53
tcp4 0 0 192.168.0.11.51344 130.211.16.53.443 ESTABLISHED 131072 131874 600 0 0x0102 0x00000008
tcp6 0 0 2607:fea8:44df:4.50853 2a04:4e42:1e::39.443 ESTABLISHED 1147808 131376 600 0 0x0102 0x00000008
tcp6 0 0 2607:fea8:44df:4.49853 2607:f8b0:400b:8.443 ESTABLISHED 131072 131072 67617 0 0x0102 0x00000000
tcp4 0 0 192.168.0.11.49803 185.199.109.153.443 ESTABLISHED 323656 131768 600 0 0x0102 0x00000008

@ameshkov
Copy link
Member

Try sudo lsof -nP -iUDP:53, check the PID column, lookup what process occupies the port.

@moofawsaw
Copy link
Author

Nothing happens when I type in that command:

kyleunderhill@MacBook-Air ~ % sudo lsof -nP -iUDP:53
Password:
kyleunderhill@MacBook-Air ~ % sudo lsof -nP -iUDP:53
kyleunderhill@MacBook-Air ~ % sudo lsof -nP -iUDP:53

@ameshkov
Copy link
Member

Weird. Is it the same when you run sudo ./AdGuardHome -s install?

@moofawsaw
Copy link
Author

Yes here is the result:

kyleunderhill@MacBook-Air ~ % sudo ./AdGuardHome -s install
sudo: ./AdGuardHome: command not found

@ameshkov
Copy link
Member

You should call it from the directory where AdGuardHome binary is located

@moofawsaw
Copy link
Author

What would the command be from the applications folder?

@ameshkov
Copy link
Member

Just copy/paste AdGuardHome folder to /Applications (so that it was /Applications/AdGuardHome) and run it from there: sudo /Applications/AdGuardHome/AdGuardHome -s install

@moofawsaw
Copy link
Author

Dragging the AdGuardHome Unix Executable File - 20.4 MB into the applications folder and running the command returned:

kyleunderhill@MacBook-Air ~ % sudo /Applications/AdGuardHome/AdGuardHome -s install
Password:
sudo: /Applications/AdGuardHome/AdGuardHome: command not found
kyleunderhill@MacBook-Air ~ %

@ameshkov
Copy link
Member

Apparently, you haven't created the AdGuardHome directory so it's natural that it can't be found.

Try installing it using the standard installation script, it will install it to the proper location (remove the old binary before doing that): curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh

@moofawsaw
Copy link
Author

I think I messed something up because here is what I get when running your script:

kyleunderhill@MacBook-Air ~ % curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
[info] Starting AdGuard Home installation script
[info] Channel release
[error] Cannot detect your CPU
kyleunderhill@MacBook-Air ~ %

@ameshkov
Copy link
Member

Oh, interesting, we may not be ready to M1.

What output do you see for this command: uname -m?

@moofawsaw
Copy link
Author

kyleunderhill@MacBook-Air ~ % uname -m
arm64

@ameshkov
Copy link
Member

Thank you! Added it to the install script, please try again in 10-15 minutes

@moofawsaw
Copy link
Author

Here is the latest:

kyleunderhill@MacBook-Air ~ % curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Please note, that AdGuard Home requires root privileges to install using this script.
[info] Restarting with root privileges
Password:
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Script called with root privileges
[info] AdGuard Home will be installed to /Applications/AdGuardHome
[info] Downloading package from https://static.adguard.com/adguardhome/release/AdGuardHome_darwin_arm64.zip -> AdGuardHome_darwin_arm64.zip
[info] Unpacking package from AdGuardHome_darwin_arm64.zip -> /Applications
[AdGuardHome_darwin_arm64.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of AdGuardHome_darwin_arm64.zip or
AdGuardHome_darwin_arm64.zip.zip, and cannot find AdGuardHome_darwin_arm64.zip.ZIP, period.
[error] Cannot unpack the package

@ameshkov
Copy link
Member

Argh, my bad:( We don't build for Mac ARM CPU, completely forgot about it.

Try again in 5 mins, I've switched it to amd64 build for now.

@moofawsaw
Copy link
Author

Working. Thank you for your help!

@moofawsaw
Copy link
Author

After factory reset of one of my Mac M1 machines I tried to fresh install and received the following error when running the auto-install command above that worked 10 days ago:

ki@Kis-MacBook-Pro ~ % curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Use amd64 build on Mac M1 until the native ARM support is added
[info] Please note, that AdGuard Home requires root privileges to install using this script.
[info] Restarting with root privileges
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Use amd64 build on Mac M1 until the native ARM support is added
[info] Script called with root privileges
[info] AdGuard Home will be installed to /Applications/AdGuardHome
[info] Downloading package from https://static.adguard.com/adguardhome/release/AdGuardHome_darwin_amd64.zip -> AdGuardHome_darwin_amd64.zip
[info] Unpacking package from AdGuardHome_darwin_amd64.zip -> /Applications
replace /Applications/LICENSE.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL
(EOF or read error, treating as "[N]one" ...)
[error] Cannot unpack the package

@ainar-g
Copy link
Contributor

ainar-g commented Feb 10, 2021

I seems like the decompressing software is saying that there is already a file named LICENSE.txt in the directory. You need to remove the old files first.

@ameshkov
Copy link
Member

@ainar-g nope, this is a consequence of repacking darwin build, it tries to unpack to /Applications, not to /Applications/AdGuardHome

@moofawsaw
Copy link
Author

@ameshkov is there an action to take on my end to resolve?

@ameshkov
Copy link
Member

Remove /Applications/AdGuardHome manually
Try installing again in 10 minutes

@moofawsaw
Copy link
Author

ki@Kis-MacBook-Pro ~ % curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Use amd64 build on Mac M1 until the native ARM support is added
[info] Please note, that AdGuard Home requires root privileges to install using this script.
[info] Restarting with root privileges
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Use amd64 build on Mac M1 until the native ARM support is added
[info] Script called with root privileges
[info] AdGuard Home will be installed to /Applications/AdGuardHome
[info] Downloading package from https://static.adguard.com/adguardhome/release/AdGuardHome_darwin_amd64.zip -> AdGuardHome_darwin_amd64.zip
[info] Unpacking package from AdGuardHome_darwin_amd64.zip -> /Applications/AdGuardHome
sh: line 240: ./AdGuardHome: Bad CPU type in executable
[error] Cannot install AdGuardHome as a service

@ameshkov
Copy link
Member

Weird, amd64 build worked before on your M1. If it does not want to launch it anymore, I guess you'll need to wait until we support M1 natively.

@moofawsaw
Copy link
Author

moofawsaw commented Feb 11, 2021 via email

@ameshkov
Copy link
Member

The easiest way would be to subscribe to releases of this repo (click "watch" -> choose releases)

@edgexyz
Copy link

edgexyz commented May 15, 2021

I'm using Intel i5 core, but I still face the same "cannot install AGH as a service" problem🤔
OS: macOS Big Sur 11.2.3

The log looks like this:
sudo curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh

[info] Starting AdGuard Home installation script
[info] Channel release
[info] Please note, that AdGuard Home requires root privileges to install using this script.
[info] Restarting with root privileges
[info] Starting AdGuard Home installation script
[info] Channel release
[info] Script called with root privileges
[info] AdGuard Home will be installed to /Applications/AdGuardHome
[info] Downloading package from https://static.adguard.com/adguardhome/release/AdGuardHome_darwin_amd64.zip -> AdGuardHome_darwin_amd64.zip
[info] Unpacking package from AdGuardHome_darwin_amd64.zip -> /Applications/AdGuardHome
sh: line 240: ./AdGuardHome: is a directory
[error] Cannot install AdGuardHome as a service

@EugeneOne1
Copy link
Member

@edgexyz, the updated installation script will be available in the nearest future (two days). We'll let you know right away.

@edgexyz
Copy link

edgexyz commented May 16, 2021

thanks!

adguard pushed a commit that referenced this issue May 17, 2021
Merge in DNS/adguard-home from 2542-2462-imp-script to master

Closes #2462.
Updates #2542.
Updates #2613.

Squashed commit of the following:

commit 4a74722
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:11:08 2021 +0300

    scripts: imp naming, docs

commit acbb586
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:05:57 2021 +0300

    scripts: imp fix

commit 6477701
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:54:05 2021 +0300

    scripts: fix bsd

commit 3308921
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:04:04 2021 +0300

    scripts: imp requirements checking

commit 453cf7a
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:54:38 2021 +0300

    scripts: fix docs

commit a222905
Merge: 0852c87 120ba96
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:50:45 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 0852c87
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:49:27 2021 +0300

    scripts: add os-specific requirements check

commit 6313d8f
Merge: 1b4092d a031cae
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:57 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 1b4092d
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:09 2021 +0300

    scripts: imp install.sh a little

commit 0584b30
Merge: 22621c8 9d788a2
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:27:47 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 22621c8
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:25:47 2021 +0300

    all: imp code

commit a38f4ad
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:40:37 2021 +0300

    all: fix url variable

commit 238cb85
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:27:13 2021 +0300

    imp code quality

commit 0e36c12
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 16:34:49 2021 +0300

    all: fix typos

commit b20f0b7
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Thu Apr 29 14:02:40 2021 +0300

    all: imp installation script
@EugeneOne1
Copy link
Member

@edgexyz, the script is ready! Follow the README.md.

adguard pushed a commit that referenced this issue May 19, 2021
Merge in DNS/adguard-home from 2542-2462-imp-script to master

Closes #2462.
Updates #2542.
Updates #2613.

Squashed commit of the following:

commit 4a74722
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:11:08 2021 +0300

    scripts: imp naming, docs

commit acbb586
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:05:57 2021 +0300

    scripts: imp fix

commit 6477701
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:54:05 2021 +0300

    scripts: fix bsd

commit 3308921
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:04:04 2021 +0300

    scripts: imp requirements checking

commit 453cf7a
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:54:38 2021 +0300

    scripts: fix docs

commit a222905
Merge: 0852c87 120ba96
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:50:45 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 0852c87
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:49:27 2021 +0300

    scripts: add os-specific requirements check

commit 6313d8f
Merge: 1b4092d a031cae
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:57 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 1b4092d
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:09 2021 +0300

    scripts: imp install.sh a little

commit 0584b30
Merge: 22621c8 9d788a2
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:27:47 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 22621c8
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:25:47 2021 +0300

    all: imp code

commit a38f4ad
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:40:37 2021 +0300

    all: fix url variable

commit 238cb85
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:27:13 2021 +0300

    imp code quality

commit 0e36c12
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 16:34:49 2021 +0300

    all: fix typos

commit b20f0b7
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Thu Apr 29 14:02:40 2021 +0300

    all: imp installation script
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 2542-2462-imp-script to master

Closes AdguardTeam#2462.
Updates AdguardTeam#2542.
Updates AdguardTeam#2613.

Squashed commit of the following:

commit 4a74722
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:11:08 2021 +0300

    scripts: imp naming, docs

commit acbb586
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 15:05:57 2021 +0300

    scripts: imp fix

commit 6477701
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:54:05 2021 +0300

    scripts: fix bsd

commit 3308921
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 14:04:04 2021 +0300

    scripts: imp requirements checking

commit 453cf7a
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:54:38 2021 +0300

    scripts: fix docs

commit a222905
Merge: 0852c87 120ba96
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:50:45 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 0852c87
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon May 17 13:49:27 2021 +0300

    scripts: add os-specific requirements check

commit 6313d8f
Merge: 1b4092d a031cae
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:57 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 1b4092d
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:46:09 2021 +0300

    scripts: imp install.sh a little

commit 0584b30
Merge: 22621c8 9d788a2
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:27:47 2021 +0300

    Merge branch 'master' into 2542-2462-imp-script

commit 22621c8
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 19:25:47 2021 +0300

    all: imp code

commit a38f4ad
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:40:37 2021 +0300

    all: fix url variable

commit 238cb85
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 18:27:13 2021 +0300

    imp code quality

commit 0e36c12
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri May 14 16:34:49 2021 +0300

    all: fix typos

commit b20f0b7
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Thu Apr 29 14:02:40 2021 +0300

    all: imp installation script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants