When I try to install a library with homebrew (brew install aLibrary), I got the following error:
Could not symlink lib/pkgconfig/aFile
/usr/local/lib/pkgconfig is not writable.
What should I do?
There are several questions and answers (1,2,etc.) concerning this brew error, this is an attempt to make a general question as suggested here.
As explained here by Rick:
Start with brew doctor which will show you errors with your brew setup.
You might see something like this: "Warning: /usr/local/lib/pkgconfig isn't writable."
It will give you the advice that: "You should probably chown /usr/local/lib/pkgconfig".
This means: sudo chown -R $(whoami) /usr/local/lib/pkgconfig
Then you will need to link the files with this: brew link yourLibrary
If this does not work hopefully the output of brew doctor will give you enough to continue the search.
Giant Elk had a great suggestion and this is how I fixed my issue, which in my opinion is the cleanest. Users should not change permissions unless they know the ramifications.
Output your installed packages (via brew) to a text file:
brew list > brewlist.txt
Uninstall brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Re-install brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Re-install previous packages (edit list if you do not need all packages):
brew install $(< brewlist.txt )
Use the following.
$ brew doctor
message will display error links to prune. If any found, run next option.
$ brew prune
once these are removed, proceed to link them agian
$ brew link python
I uninstalled brew, re-installed, then the issues went away.
You should simply give the permission to your account by running this command on terminal.
sudo chown -R $(whoami) (path)
In your case:
sudo chown -R $(whoami) lib/pkgconfig/aFile /usr/local/lib/pkgconfig
Related
Below is the Error message I get every time I install anything in the terminal . Its kinda stuck there for a while.
I tried no. of solutions from StackOverflow but nothing worked.
Before installing this package,
please download the Oracle JDK 11 .tar.gz file
with the same version as this package (version 11.0.4),
and place it in /var/cache/oracle-jdk11-installer-local,
E.g.:
sudo mkdir -p /var/cache/oracle-jdk11-installer-local
sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
sha256sum mismatch jdk-11.0.4_linux-x64_bin.tar.gz
Oracle JDK 11 is NOT installed.
dpkg: error processing package oracle-java11-installer-local (--configure):
installed oracle-java11-installer-local package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
oracle-java11-installer-local
E: Sub-process /usr/bin/dpkg returned an error code (1)
Doesn't show up again.
Remove the package oracle-java11-installer-local. You can do this in following way:
sudo apt remove oracle-java11-installer-local
found this solution:
sudo rm /var/lib/dpkg/info/oracle-java11-installer-local.postinst
at this site.
You need to download the folder of the Oracle JDK 11 on here https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
After download the tar.gz file. Move to your folder location then copy the file by using this command
sudo cp jdk-11.0.6_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
don't forget to check your file name! After that repeat again by typing
sudo apt-get install oracle-java11-installer-local
and you can check your java version after that by typing
java -version
Hello,
I've had the same issue.
When you try to run sudo apt update && sudo apt upgrade it will automatically try to update the Java if a newer version is available. In my case let's say from 11.0.4 -> 11.0.5.
If you add the JDK from Oracle (after download) to /var/cache/oracle-jdk11-installer-local/ it should work.
You don't have to uninstall it...(I mean the oracle-jdk11-installer-local, it works just fine).
Please let me know if you still have this issue.
I had the same issue. My solution was to download jdk-11.0.5_linux-x64_bin.tar.gz and copied it to /var/cache/oracle-jdk11-installer-local.
In console shell, type:
sudo apt update && sudo apt upgrade
After a long search: this solved it for me.
The checksum made the issues for me. Try:
sudo rm /var/lib/dpkg/info/oracle-java11-installer-local.postinst -f
Navigating to the directory var/cache and doing "sudo rmdir oracle-jdk11-installer-local/" worked for me.
sudo rmdir oracle-jdk11-installer-local/
I have managed to resolve the issue by doing this:
modify /var/lib/dpkg/info/oracle-java11-installer-local.postinst
Change the checkSum. take from oracle website check sum for 11.0.15.1
3. change the version in 2 places
4. save and update apt
5. then sudo apt install oracle-java11-installer-local
this worked for me
I was able to download homebrew successfully. However, whenever I use 'brew install node' , I am getting the error message:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
You can try again using:
brew link node
I have also tried 'brew link node' which results in:
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
Can anyone help please?
The solution is in the official troubleshooting page of Homebrew. You have to give Homebrew the right to write inside /usr/local. To do this the official command to run is:
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks
If you have not installed applications in /usr/local that rely on specific permissions, you can also run:
sudo chown -R $(whoami) /usr/local/*
When I try to run mongod from the terminal, I get the following error:
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: addr already in use
I recently realize that I have two versions of MongoDB on my Mac, and think this may be the source for the above error. (Plus, I do not need two version.) I tried Googling, but was not able to find clear directions on how I can uninstall. I have development version 2.7.0 AND 2.6.3.
Thanks so much in advance for the help!
Run the following commands to remove mongodb from the launch/startup and to uninstall it using Homebrew:
# See if mongo is in the launch/startup list
launchctl list | grep mongo
# Remove mongodb from the launch/startup
launchctl remove homebrew.mxcl.mongodb
# Kill the mongod process just in case it's running
pkill -f mongod
# Now you can safely remove mongodb using Homebrew
brew uninstall mongodb
Just double-check in /usr/local/bin/ to make sure that the mongodb commands are removed.
For uninstalling the community version, i found that the command brew uninstall mongodb-community worked for me
Nitin Jadhav version worked for me, brew uninstall mongodb kept given me Error: No such keg: /usr/local/Cellar/mongodb. I was removing a mongodb-community.
use cd /usr/local/Cellar then run ls -a and then run rm -rf mongodb-community to remove it
I would suggest navigating into your /usr/local/Cellar and run an ls -a, I had a community version of mongo installed that wasn't being picked up by the command given above. If you find any mongo versions there just rm -rf each instance
For those having this error in osx:
brew uninstall mongodb Error: No such keg: /usr/local/Cellar/mongodb
execute brew list | grep mongo
for example, it could show something like:
mongodb-community#4.2
mongodb-database-tools
mongosh
remove them with brew uninstall mongodb-community#4.2 mongodb-database-tools mongosh
Also execute launchctl remove homebrew.mxcl.mongodb as #anuvrat-tiku says in his answer.
It looks like I installed the wrong version of the module using apxs2.
Once it's disabled (a2dismod), how do I remove it so I can install the correct version?
Seems elementary, yet...somehow...I'm finding nothing on Google, IRC, etc.
It's so simple nobody has written it down yet. You just remove the .so file from /usr/lib/apache2/modules/.
And if you want to be thorough, remove anything that might be in: /usr/share/doc/module-name
For some modules on Ubuntu you can use apt-get.
To find the installed module sudo dpkg -l | grep apache.
To remove sudo apt-get purge {module_name}.
For example:
sudo apt-get purge libapache2-mod-php7.0 libapache2-mod-php5
The apache modules can be found in
/usr/lib64/apache2
or
/usr/lib64/httpd
I recently updgraded MacPorts from 1.9.2 to 2.0.3. Since then, I've lost the ability to run as sudo.
sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
Unsure if these are related, but I'm wondering what the best course of action is at this point.
port installed returns
sudo #1.7.4p2_0
sudo #1.7.7_0 (active)
Further investigation suggests I've installed MacPorts' sudo without an accompanying /opt/local/etc/sudoers file. I've managed to create such a file using visudo, copying the content of /etc/sudoers, chmod to 0440 and ownership to root:wheel.
I guess the question now is whether I should use MacPorts' sudo or uninstall it? And how did I end up with installing the MacPorts' sudo?
Not a Mac man myself, but have a look at this page:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/sudoers.5.html
...and also a look at the man page for visudo, which is used to edit the sudoers file:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/visudo.8.html#//apple_ref/doc/man/8/visudo