How do i ignore/unmark certain ports? - macports

I would like to know how to either ignore upgrading certain ports or unmark them as "outdated".
This is motivated by certain ports failing to upgrade, while I wish to upgrade all the rest. I know about sudo port install -n, which allows one to install a port without upgrading port dependencies, as in the case of mongodb requiring an older (not the current) version of theboost libraries, but this is not applicable here.
For example:
$ sudo port list outdated
gdb #7.5 devel/gdb
py27-scikits-image #0.7.1 python/py-scikits-image
As gdb#7.5 fails to update, I would just like to upgrade the others, ie. py27-scikits-image, without going thru the whole sudo port list outdated | awk '{print $1}' | grep -v gdb | xargs sudo port upgrade pipeline.
Much appreciated.

I would advise to create a local portfile for gdb with a lower version number.
Create a local portfile repository: howto
Copy the gdb portfile directory (a directory called "gdb" containing the file "Portfile" and directory "files") into your local portfile repository
Change the version number in the portfile to e.g. 0.0
Run portindex in your local portfile repository
The local portfile overrides the one downloaded from the default port repository. The low version number makes macports think your version of gdb is up to date.
I hope this can help.
BTW: you can do sudo port upgrade outdated and not gdb

Related

How to fix '(38)Function not implemented: AH00141: Could not initialize random number generator' after upgrading Apache from 2.4.18 to 2.4.46?

I have a running system with Ubuntu 16.04, Apache 2.4.18, PHP 7.3 and 7.4, PHP-FPM, PHP FastCGI, MPM event.
I wanted to upgrade to the latest Apache version (2.4.46-2+ubuntu16.04.1+deb.sury.org+3 amd64 [upgradable from: 2.4.18-2ubuntu3.17]) as follows:
add-apt-repository -y ppa:ondrej/apache2
apt update
apt-get --only-upgrade install apache2
service apache2 restart
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
journalctl -xe
apachectl[9010]: [:crit] [pid 9013] (38)Function not implemented: AH00141: Could not initialize random number generator
I checked and /dev/random and /dev/urandom are installed.
Kernel: 4.4.0-042stab141.2 and libc6: 2.23-0ubuntu11.2
Happened to me after upgrading apache to version 2.4.46 on Ubuntu as well. I found out it was the kernel version.
I knew I did apt-get upgrade and the kernel should be latest version, Also running
sudo update-grub
Showed me newer versions, but running uname -r showed very old kernel.
After a long investigation that took almost all day and trying everything I found online about upgrading Ubuntu kernel - I found out it was Digitalocean, not me. Old droplets use external managed kernel - so no matter what you do on your environment, it will always take the external kernel. The solution was here:
https://www.digitalocean.com/docs/droplets/how-to/kernel/grubloader/#switch
If you do see the drop down & change button in your droplet settings in Digital ocean control panel, then your kernel is externally managed. In that drop down type “grub” and choose GrubLoader v0.2, press “change” button & that’s it!
Now you’ll need to shut down & turn back on your server, but before you do so I suggest to run the following commands:
sudo apt-get update
sudo apt-get upgrade
The above upgrade will update the whole system. To update just kernel run the above update command followed by:
sudo apt-get upgrade linux-image-generic
Now shut down (sudo poweroff or power off from DigitalOcean interface, though doing it from CLI is preferred). Note that reboot is not sufficient in this particular case and a complete shut down is needed (Thanks #gauss256 for your comment). Then power it back on from digital ocean interface, And upon startup you should see a new kernel version.
Tip - you might want to delete old Kernel files after the reboot, this can be done by:
sudo apt-get purge $( dpkg --list | grep -P -o "linux-image-\d\S+" | grep -v $(uname -r | grep -P -o ".+\d") )

postgreSQL error initdb: command not found

i was installing postgresql on ubuntu using linuxbrew:
brew install postgresql
it seems to work fine but after that because i was installing PostgreSQL for the first time i tried creating a database:
initdb /usr/local/var/postgres -E utf8
but it returned as:
initdb: command not found
i tried running the command with sudo but that doesn't helped
run locate initdb it should give you the list to chose. smth like:
MacBook-Air:~ vao$ locate initdb
/usr/local/Cellar/postgresql/9.5.3/bin/initdb
/usr/local/Cellar/postgresql/9.5.3/share/doc/postgresql/html/app-initdb.html
/usr/local/Cellar/postgresql/9.5.3/share/man/man1/initdb.1
/usr/local/Cellar/postgresql/9.6.1/bin/initdb
/usr/local/Cellar/postgresql/9.6.1/share/doc/postgresql/html/app-initdb.html
/usr/local/Cellar/postgresql/9.6.1/share/man/man1/initdb.1
/usr/local/bin/initdb
/usr/local/share/man/man1/initdb.1
So in my case I want to run
/usr/local/Cellar/postgresql/9.6.1/bin/initdb
If you don't have mlocate installed, either install it or use
sudo find / -name initdb
There's a good answer to a similar question on SuperUser.
In short:
Postgres groups databases into "clusters", each of which is a named collection of databases sharing a configuration and data location, and running on a single server instance with its own TCP port.
If you only want a single instance of Postgres, the installation includes a cluster named "main", so you don't need to run initdb to create one.
If you do need multiple clusters, then the Postgres packages for Debian and Ubuntu provide a different command pg_createcluster to be used instead of initdb, with the latter not included in PATH so as to discourage end users from using it directly.
And if you're just trying to create a database, not a database cluster, use the createdb command instead.
I had the same problem and found the answer here.
Ubuntu path is
/usr/lib/postgresql/9.6/bin/initdb
Edit: Sorry, Ahmed asked about linuxbrew, I'm talking about Ubuntu.
I Hope this answer helps somebody.
I had a similar issue caused by the brew install postgresql not properly linking postgres. The solve for me was to run:
brew link --overwrite postgresql
you can add the PATH to run from any location
sudo nano ~/.profile
inside nano go to the end and add the following
# set PATH so it includes user's private bin if it exists
if [ -d "/usr/lib/postgresql/14/bin/" ] ; then
PATH="/usr/lib/postgresql/14/bin/:$PATH"
fi
and configure the alternative
sudo update-alternatives --install /usr/bin/initdb initdb /usr/lib/postgresql/14/bin/initdb 1

Macports: what exactly does the -f flag mean?

Let's contrast
sudo port install [port_name]
and
sudo port -f install [port_name]
What exactly does the flag -f do in this case? Why don't we use the -f flag each time we install a new port?
On installation, the force flag is used to force activation in case a file that would be provided by the port you are installing already exists on your system. Without the force flag, MacPorts will abort the installation and warn you; with the flag, MacPorts will rename the existing file (appending .mp_$timestamp).
Forcing may become necessary if you have previously uninstalled a version of MacPorts but not cleaned up all the files it provided, or if a third-party installer built using MacPorts installed files into /opt/local (which is wrong, but still happens sometimes).
Because overwriting is not safe behavior, it isn't the default. This is also the reason why you should not always specify -f.
The flag -f is to force the install/install. If there are dependencies that is preventing macports from installing/uninstalling, you can use the -f flag to force the install/uninstall but that is not a desirable way of installing/uninstalling.
Take a look at explanation from https://guide.macports.org/
sudo port uninstall libcomerr
---> Unable to uninstall libcomerr #1.42.9_0, the following ports depend on it:
---> kerberos5 #1.11.3_0
---> subversion #1.8.9_0
---> subversion-perlbindings-5.16 #1.8.9_0
Error: port uninstall failed: Please uninstall the ports that depend on libcomerr first.
You can recursively uninstall all ports that depend on the given port before uninstalling the port itself to work around this. To do that, use the --follow-dependents flag.
$ sudo port uninstall --follow-dependents libcomerr
You can also override this safety check using the -f (force) flag.
Since this will obviously break the dependents you shouldn't do this
unless you know what you are doing.
$ sudo port -f uninstall libcomerr
Although this is an example of uninstall, you can see how -f flag works.

Apache zeppelin process died

I'm trying to run zeppelin on Ubuntu14 w/ Hadoop 1.0.3 and Spark 1.4.0.
I've finished building the source code, and all of the package successfully finished building. But when I run the daemon, it fails and says that the Zeppelin process had died.
Any ideas where this is going wrong?
It says that it can't find the logs folder and the run folder, which are definitely there.
Joseph,
I suggest that you try to test your zeppelin package first.
mvn verify
or check if your zeppelin process is alive or not.
ps -aux | grep zeppelin
Try running zeppelin by sudo :
sudo bin/zeppelin-daemon.sh start
This works for me:
ps -ef | grep "zeppelin"
kill -9 pid
sudo bin/zeppelin-daemon.sh restart
It could be an error caused by JDK version, at least that was the case for me
try to update jdk and build it again.
Also, make sure you are building it using the correct command
mvn clean package -Pspark-1.4 -Dhadoop.version=2.2.0 -Phadoop-2.2 -DskipTests
If you are running zeppelin from a virtual machine make sure that you have enough RAM and CPU. I ran into your problem when I was using Virtual Box and the default settings. When I increased the cpu's to 2 and RAM to 4096 everything worked fine. This is because zeppelin runs spark by default and spark is very resource intensive locally and otherwise.
I had the same issue and tried the proposed answers but none worked for me. Here is what did work for me:
Download the binaries, then download the build requirements:
sudo apt install openjdk-8-jdk npm libfontconfig r-base-dev r-cran-evaluate
sudo apt install maven
Go to the Zeppelin directory and run:
sudo bin/zeppelin-daemon.sh start
Go to localhost:8080 in your browser.
I had the same issue right now.. so I checked environment compatibility with my cdh then I got java compatibility issue
I setup yum install java-1.8.0-openjdk then start all the services of Hadoop with spark
Then, I started zeppelin, I made the zeppelin folder on root so I used..
sudo zeppelin/bin/zeppelin-daemon.sh start
Or
zeppelin/bin/zeppelin-daemon.sh start
I took Kangrok Lee's suggestion and ran mvn verify on my system. It prompted me that I do not have JAVA_HOME set and JAVA_HOME must point to JDK and not JRE.
Following steps fixed for me:
Make sure you have JDK installed on the system where you are trying to run zeppelin
Make sure JAVA_HOME environment variable points to your JDK and not JRE
After above steps are ensured zeppelin-daemon.sh start / restart should work for you. No need to use sudo.

Lost ability to run as sudo following MacPorts upgrade

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

Resources