Trying To Install Homebrew But Ran Into Issues - terminal

I installed Homebrew and as per the instructions ran brew doctor to find some issues.
Then I ran brew prune and moved Macports.
Apparently uninstalling Macports can cause more issues. It's in a new directory. What should I do with it?
This is what is happening:
~ $ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/bin/bbdiff
/usr/local/bin/bbedit
/usr/local/bin/bbfind
/usr/local/bin/mate
/usr/local/share/man/man1/bbdiff.1
/usr/local/share/man/man1/bbedit.1
/usr/local/share/man/man1/bbfind.1
Warning: You have MacPorts or Fink installed:
/opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_internals.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/uv-private/ngx-queue.h
/usr/local/include/node/uv-private/stdint-msvc2008.h
/usr/local/include/node/uv-private/tree.h
/usr/local/include/node/uv-private/uv-bsd.h
/usr/local/include/node/uv-private/uv-darwin.h
/usr/local/include/node/uv-private/uv-linux.h
/usr/local/include/node/uv-private/uv-sunos.h
/usr/local/include/node/uv-private/uv-unix.h
/usr/local/include/node/uv-private/uv-win.h
/usr/local/include/node/uv.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/v8-preparser.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8stdint.h
/usr/local/include/node/zconf.h
/usr/local/include/node/zlib.h
~ $ brew prune
Pruned 0 dead formulae
Pruned 7 symbolic links from /usr/local
~ $ sudo mv /opt/local ~/macports
Password:
~ $ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_internals.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/uv-private/ngx-queue.h
/usr/local/include/node/uv-private/stdint-msvc2008.h
/usr/local/include/node/uv-private/tree.h
/usr/local/include/node/uv-private/uv-bsd.h
/usr/local/include/node/uv-private/uv-darwin.h
/usr/local/include/node/uv-private/uv-linux.h
/usr/local/include/node/uv-private/uv-sunos.h
/usr/local/include/node/uv-private/uv-unix.h
/usr/local/include/node/uv-private/uv-win.h
/usr/local/include/node/uv.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/v8-preparser.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8stdint.h
/usr/local/include/node/zconf.h
/usr/local/include/node/zlib.h
Can anyone tell me my next steps? What are "Unexpected header files?"
Thanks in advance.

Related

git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4

Recently I reinstalled macOS Catalina 10.15.4. After I installed Command_Line_Tools_11.4.1, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-svn would work. Unfortunately got this error message:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.26.2/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/Cellar/git/2.26.2/share/perl5/Git/SVN/Utils.pm line 6.
Both git & svn are the latest version.
Please help me out.
Finally I figure it out!!!
Open the git-svn file (perl script, in my case file location is /usr/local/opt/git/libexec/git-core/git-svn), change the first line #!/usr/bin/perl to #!/usr/local/bin/perl
And it works!
I guess system perl doesn't include perl SVN/Core, but brew perl has it (dependency of brew svn).
Solution for MacOS Big Sur 11.5
After struggling with this error for hours:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module)
I've finally found a solution that actually works.
If you run:
brew reinstall subversion
It will print a message like this:
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
Then you just need to run this command before using git svn to load the SVN module from the correct path:
export PERL5LIB=/usr/local/opt/subversion/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level
Solution for those, who, like me - want to use Sourcetree client on macOS Catalina with git-svn:
First step:
brew install git
brew install perl
brew install subversion
edit
/usr/local/Cellar/git/git_version/libexec/git-core/git-svn
replace
#!/usr/bin/perl
with
#!/usr/local/bin/perl
Second step, install missed perl modules:
cpan SVN::Core
cpan Term::ReadKey
Third step, configure SourceTree:
In Sourcetree->Preferences - set option "use system git", from:
/usr/local/Cellar/git/git_version/git
While not a permanent fix, a workaround is to set ${GITPERLLIB}:
$ export GITPERLLIB=/usr/local/Cellar/git/2.31.1/share/perl5:/usr/local/lib/perl5/site_perl/5.28.2/darwin-thread-multi-2level
$ git svn clone svn+ssh://...
worked for me without editing any scripts installed by brew.
Ensure you've installed Perl, Subversion and dependencies via Homebrew:
brew install perl subversion apr apr-util
Install required Perl modules into ~/perl5:
export PATH="/usr/local/opt/apr/bin:/usr/local/opt/apr-util/bin:$PATH"
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib Git::SVN SVN::Core
Verify installed modules by:
PERL5LIB="$HOME/perl5" cpan -l | grep SVN
Then configure Perl as following (based on brew info perl steps):
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
Finally run Git's SVN:
PERLLIB="$HOME/perl5" git svn clone https://svn.somecode.example.com/svn/trunk
If you're still stuck, try GitHub and GitLab websites which offer migration with a Git/SVN.
E.g. in GitHub, create a new repository, then import the project by pasting old repository’s clone URL.
The error message says:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/opt/subversion/lib/perl5 /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
This is because git-svn is implemented by Perl, it needs a Perl library called SVN::Core to run。
Changing the first line of git-svn script from #!/usr/bin/perl to #!/usr/local/bin/perl won't fix this error!!! Because this just changes the Perl library from system default version to brew installed version。If the brew installed version doesn't contains SVN::Core, it'll still fail:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.34.0) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
Note that the Perl version has been changed, but the error still exists. Because there is no SVN:Core in the directories indicated by #INC.
Now some answers may tell you to install SVN::Core by cpan SVN::Core, Don't do that!!! This won't solve the problem! Because the version of SVN::Core it installed, may not match with your SVN version:
$ git svn --version
error: git-svn died of signal 11
By the way, cpan is rubbish, don't use it to install anything. It compiles the source before installation but cannot control the compile flags/options, and it cannot uninstall things that are installed by itself.
Here is the right solution:
The corresponding Perl libraries are already installed when you installed svn, and brew has already told you:
$ brew info svn
subversion: stable 1.14.1 (bottled), HEAD
Version control system designed to be a better CVS
https://subversion.apache.org/
/usr/local/Cellar/subversion/1.14.1_2 (234 files, 32.1MB) *
Poured from bottle on 2021-06-02 at 15:52:30
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/subversion.rb
License: Apache-2.0
==> Dependencies
Build: openjdk ✘, pkg-config ✘, python#3.9 ✔, scons ✘, swig ✘
Required: apr ✔, apr-util ✔, gettext ✔, lz4 ✔, openssl#1.1 ✔, utf8proc ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
You may need to link the Java bindings into the Java Extensions folder:
sudo mkdir -p /Library/Java/Extensions
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
==> Analytics
install: 33,749 (30 days), 67,978 (90 days), 239,148 (365 days)
install-on-request: 33,129 (30 days), 67,011 (90 days), 229,097 (365 days)
build-error: 0 (30 days)
We can see that the Perl bindings are located in /usr/local/opt/subversion/lib/perl5, we just need to let git-svn use this path. With a little investigation of git-svn script, we can see this behavior is controlled by an environment variable called GITPERLLIB:
$ head /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB} || '/usr/local/Cellar/git/2.31.1/share/perl5:/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level:/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level'));
# Copyright (C) 2006, Eric Wong <normalperson#yhbt.net>
# License: GPL v2 or later
So the right way to solve this problem is to add the following code to your bashrc or zshrc:
export GITPERLLIB=/usr/local/opt/subversion/lib/perl5/site_perl/$<your_perl_version>/darwin-thread-multi-2level
Problem solved!

libepoxy's autogen can't find xorg-macros when prefix is /usr/local

libepoxy1.5.4 blames:
autoreconf: running: aclocal -I m4
configure.ac:36: error: must install xorg-macros 1.8 or later...
This happens ONLY if XORG and LIBEPOXY installed in /usr/local.
When /usr, then OK.
"pkgconfig xorg-macros" returns 0 (found it)
This file exists: usr/local/share/aclocal/xorg-macros.m4
I am not at all surprised that /usr/local/share/aclocal is not in aclocal's default macro search path when aclocal itself is installed in /usr/bin. To the extent that xorg-macros seems to assume that its macros will be installed in aclocal's systemwide macro directory, it is incorrect to install it under prefix /usr/local when aclocal is installed under prefix /usr.
If you want to persist with such a mismatch then you should be able to work around the issue by adding the xorg-macros's actual install directory to the macro search path. You probably should do that by updating the ACLOCAL_AMFLAGS variable in the top-level Makefile.am,
from
ACLOCAL_AMFLAGS = -I m4
to
ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal
.
I am inclined to think that the destination directory for libepoxy is not relevant.

Homebrew error while installing any package on OSX

While I am trying to install any package from homebrew, it returns me this weird error.
$ brew install postgres
Error: No such file or directory # rb_sysopen - /tmp/github_api_headers20171005-1039-1blysiu
$ brew doctor
\Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/node/ares.h
/usr/local/include/node/ares_build.h
/usr/local/include/node/ares_rules.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/nameser.h
/usr/local/include/node/pthread-fixes.h
/usr/local/include/node/v8-experimental.h
Error: No such file or directory # rb_file_s_stat - /tmp

Bash on Ubuntu on Windows can't use `sudo apt-get install <packagename>`

I was excited to use bash on windows but quickly ran into an issue. I am trying to install build-essential, but I get a dependency issue. Upon trying to resolve with sudo apt-get install -f, I run into another error that doesn't make much sense. I've tried update and upgrade, but that didn't work either. F
barzevp#UK-LT-8356:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
libc6-dev : Depends: linux-libc-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
barzevp#UK-LT-8356:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-libc-dev
The following NEW packages will be installed
linux-libc-dev
0 to upgrade, 1 to newly install, 0 to remove and 43 not to upgrade.
5 not fully installed or removed.
Need to get 0 B/767 kB of archives.
After this operation, 3,946 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 28660 files and directories currently installed.)
Preparing to unpack .../linux-libc-dev_3.13.0-123.172_amd64.deb ...
Unpacking linux-libc-dev:amd64 (3.13.0-123.172) ...
dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_3.13.0-123.172_amd64.deb (--unpack):
unable to install new version of /usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
E: Sub-process /usr/bin/dpkg returned an error code (1)
Full log of what led to the error in Bash on Ubuntu on Windows terminal is here:
https://pastebin.com/dq2D2Gtz
I don't have a solution, but I see the root of the problem. It seems to have to do with case sensitivity on the filesystem. The package for linux-libc-dev puts two copies of a file in /usr/include/linux/netfilter_ipv6 with only a difference in case; ip6t_HL.h, and ip6t_hl.h. After placing ip6t_HL.h, it attempts to rename ip6t_hl.h.dpkg-new to ip6t_hl.h. The system call to rename the file fails, claiming that ip6t_hl.h already exists
On a "real" linux system, ip6t_HL.h and ip6t_hl.h would clearly be different files. Under WSL they probably had some strange incompatibilities to work out between NTFS's default case insensitive FS and unix's default case sensitivity.
You can duplicate the problem by hand e.g., with
echo hi > foo.H
echo hi > foo.h-new
mv foo.h-new foo.h
mv: cannot move 'foo.h-new' to 'foo.h': File exists
strace output:
rename("/usr/include/linux/netfilter_ipv6/ip6t_HL.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_HL.h") = 0
open("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", O_WRONLY) = 10
fsync(10) = 0
close(10) = 0
rename("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_hl.h") = -1 EEXIST (File exists)
write(2, "dpkg: error processing archive /"..., 199dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_4.4.0-98.121_amd64.deb (--install):
unable to install new version of '/usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
) = 199
I had the same problem. Like #dmattp I found that it this is because, unfortunately, the package contains some (header) files with names that are distinct only by letter case, and that the wonderful WSL file system has an inconsistency regarding case sensitiveness.
Here is a workaround, assuming that the package has name linux-libc-dev_3.13.0-123.172_amd64.deb:
cd any-temp-dir
apt-get download linux-libc-dev
ar x linux-libc-dev_3.13.0-123.172_amd64.deb
tar xJf data.tar.xz # ignore all erors like ./usr/include/linux/netfilter_ipv4/ipt_ttl.h: Cannot open: Input/output error
tar cJf data.tar.xz ./usr
ar rcs linux-libc-dev_3.13.0-123.172_amd64-patched.deb debian-binary control.tar.gz data.tar.xz
sudo dpkg -i linux-libc-dev_3.13.0-123.172_amd64-patched.deb
It says dependencies aren't being installed, so try:
sudo apt-get install linux-libc-dev
If that doesn't work try:
sudo apt-get install --reinstall build-essential
This will reinstall build-essential. Hope this helps, cheers!

Error while upgrading Asterisk to 14 - PJSIP undeclared

I am trying to upgrade asterisk 11 to 14 on Debian (8.7) and I got the following error when I do make install.
The error is as below
res_pjsip_transport_management.c: In function ‘monitored_transport_state_callback’:
res_pjsip_transport_management.c:190:8: error: ‘PJSIP_TP_STATE_SHUTDOWN’ undeclared (first use in this function)
case PJSIP_TP_STATE_SHUTDOWN:
^
res_pjsip_transport_management.c:190:8: note: each undeclared identifier is reported only once for each function it appears in
/root/asterisk-14.3.0/Makefile.rules:149: recipe for target 'res_pjsip_transport_management.o' failed
make[1]: *** [res_pjsip_transport_management.o] Error 1
Makefile:401: recipe for target 'res' failed
make: *** [res] Error 2
The commands I used are as follow
tar -zxvf asterisk-14-current.tar.gz
/etc/init.d/asterisk stop
cd asterisk-14.3.0/
./configure
rm -f /usr/lib/asterisk/modules/*
make install
I tried some solutions from the internet and it didn't fix....
It seems like the pjsip versions do not match (could be that there is more then one version installed) so you want to remove all previous/existing versions of PJSip. If you do not know what packages belong to pjsip you can search them via:
apt-cache search pjsip
or
dpkg -l | grep pj
And once you know which package to remove do
apt-get --purge remove <package name>
You then want to download the latest version of pjsip (current 2.6 according to Asterisk website)
wget wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2
tar -xjvf pjproject-2.6.tar.bz2
You want to place the pjproject in /usr/local.
cp -R pjproject-2.6 /usr/local/
Once this is done you have to build/compile/install the pjproject and
./configure --prefix=/usr --enable-shared CFLAGS='-O2 -DNDEBUG' //Various options (enable/disable) can be put in here. Please refer to manual
make dep
make
make install
ldconfig
Verify that pjproject has been installed in the target location
ldconfig -p | grep pj
Once this has been done you can now go to you Asterisk folder and issue
./configure
and proceed with installation further :)
pjsip version not match.
Never tried 14*(it is not LTS), for 13.* such error mean you have more then one pjsip or pjsip is not 2.4.
Before rebuilding pjsip do check
yum remove -y pjsip
rm -f `find / -name *pjsip*`
If I'm not mistaken, Asterisk 13 source code came with a built-in pjproject, but 14 will look for an installed pjproject on the system.
Make sure you have it installed (including the -dev or -devel packages, which contains the headers), than try to reconfigure asterisk source.
./bootstrap.sh
./configure
make menuconfig

Resources