Check GraphVIZ installed version on Ubuntu - graphviz

How to check the version of GraphViz installed on my UBUNTU(12.04) laptop?
What command is used to find the version?
dot -V is the correct one?

$ dot -V
dot - graphviz version 2.36.0 (20140111.2315)
I would think so since thats what I get on running the command .

This does it for me
$ dpkg -l | grep graphviz

Related

Bash check if specific version of brew formula is installed

I am making a script in bash to configure some MacOS machines that has some brew formulas installed. I first want to check if a specific version of that formula has been installed. If not installed, the script will install it.
The thing is that I cannot figure out how to check this. E.g. brew ls --versions openssl returns all installed versions. But I want to check for a specific version, kinda similar to gems gem list -i cocoapods -v 1.3.1. The reason for this is that some projects require to have specific versions installed (like openssl).
Is there a possibility to do this? Note that there are some brew formulas to be checked, so I want to keep it as lightweight as possible :)
I have something in mind like this (but with the correct check of course):
if ! NOT_INSTALLED; then #check to see if ruby -v 2.2.2 has been installed
brew install ruby -v 2.2.2
else
echo "Skipping install ruby..."
fi
Thanks in advance!
There's not a builtin Homebrew command to check if a version is installed, but it's pretty straightforward to do with some shell scripting. For example,
brew list --versions | grep qt | cut -d " " -f 2
lists all the installed versions of Qt I have on my machine, and prints:
5.10.0_1
5.7.1
You can further refine this to see if a specific version is installed:
brew list --versions | grep "qt.* 5.7"
will print any version of Qt 5.7.
A simple shell function which will search for a specific version of a specific formula might look like:
formula_installed() {
[ "$(brew list --versions | grep "$1.* $2")" ]
return $?
}
Usage:
$ formula_installed qt 5.7
$ echo $?
1
$ formula_installed qt 8
$ echo $?
0
A note about the .* regex in the grep call. Originally, multiple versions of a formula were maintained in the homebrew/versions tap. This was deprecated, in favor of keeping older versions in homebrew/core but appending #<version> to their name. (For example, you can install Qt version 5.5 by doing brew install qt#5.5.) This just made it easier to install multiple (especially older) versions of a formula.

Command to download latest version of nvm?

I am trying to install the latest version of nvm so (per this article) I ran:
nvm install 4.0
It worked. But I want to make sure I install the latest version of nvm as they might have released a newer version after the article was written.
Is there a command I can run to download the latest version of nvm?
These answers are all about updating the version of Node, when the original question is about updating the version of the NVM tool itself.
The script to update NVM is:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
and you can find the list of the latest releases here:
https://github.com/nvm-sh/nvm/releases
More details found here:
https://techsparx.com/nodejs/howto/nvm-deprecate-mirror.html
You can run nvm install node to get the latest node release.
The only solution I have found so far involves a two-step process.
Step 1: List all the released versions.
nvm ls-remote
At the present time, the last item on this list is...
...
...
...
v6.1.0
Step 2: Download latest version on the list of available versions.
nvm install 6.1.0
To automatically pick the most recent nvm tool version instead of having to look up the part like v0.39.1 for the wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash command the following bash script can be used:
#!/bin/bash
nvm_string="nvm-sh/nvm";
git_latest_version() {
basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/$1/releases/latest)
}
latest_version_number=$(git_latest_version "${nvm_string}");
#echo ${latest_version_number}
wget -qO- https://raw.githubusercontent.com/${nvm_string}/${latest_version_number}/install.sh | bash
Usage (Linux, Mac):
Make a new file like install-nvm.sh e.g. with vim or vi or whatever. Then copy paste the above script (type i to insert, type :wq to save it), then do sh install-nvm.sh;
This solution was based on
Github nvm repo

wkhtmltopdf on a Mac - how does it get executed?

I'm trying to get wktmtlmtopdf running on a MacBook Pro with OSX Yosemite.
I ran the package installer for wkhtmltopdf 0.12.2.1 and it placed it in user/local/bin
But, when I run the following, I get a different version.
$ wkhtmltopdf -V
Name:
wkhtmltopdf 0.9.9
$ which wkhtmltopdf
/Users/davidburton/.rvm/gems/ruby-1.9.3-p484/bin/wkhtmltopdf
Why isn't it running the 0.12.2.1 version?
Why does $ which wkhtmltopdf point to the one in gems?
Thanks for the help!
Try which wkhtmltopdf -- you probably have the older version installed in /usr/bin which you'll have to remove manually.
For macOS Mojave, try out:
sudo uninstall-wkhtmltox

configure :error: No usable version of sed found:

I did ./configure to make a makefile
but it ran into an error: configure :error: No usable version of sed found:
I then typed which see
it shows /usr/bin/sed.
so, what's wrong? why can't ./configure find sed?
I happened to have this problem on my mac. This is because OS X uses an old version of sed. Installing gnu-sed by brew install gnu-sed and alias gsed=sed solved this problem. You may install gnu-sed with other method.

Incorrect check of SIP version during PyQt installation

I have been trying to install PyQt on my mac (OSX 10.6.8), but I still having this problem:
When I try to install PyQt-mac-gpl-4.9.6, I get this
Error: This version of PyQt requires SIP v4.14.2 or later.
The weird thing is that when I want to check for sip version on the console and write
sip -V
,I get the correct version: 4.14.2
I have checked my PATH but non of the online tips that I have found have helped me. How do I fix this?
I would recommend checking to see if you have sip installed in different locations, with the newer version being in a path that is not at the head of your PATH.
mdfind -name sip | grep '/bin/'
This should tell you all of the sip binaries on your computer. Check the version of all of them, and then make sure that path is at the front of PATH
What it could actually be, regardless of it seeming like you only have one sip, is a leftover .pyc file that is getting picked up before your intended sip. Try this to confirm:
$ python
>>> import sipconfig
>>> print sipconfig
This will tell you where it is finding sipconfig. If it looks like the wrong spot, or if you check it and all that is left is the pyc file, remove it. Then your newer sip should be found properly.
I had a similar issue after installing sip 4.14.2 over a previous version of 4.13.1 on Mac OSX 10.7.4 and Python 2.7. Strangely, the version of sip from the command line was different from the version from the Python sipconfig module.
$ sip -V
4.14.2
$ python -c "import sipconfig; print sipconfig.version_to_string(sipconfig.Configuration().sip_version)"
4.13.1
I ran through the install again, this time with running the install step as 'sudo make install' and the two versions matched at 4.14.2 and the PyQt instal was successful.
$ cd ~/Downloads/sip-4.14.2/
$ python configure.py
$ make
$ sudo make install

Resources