What is alternative to -dpkg for Mac? - macos

I'm trying to use dpkg command but in Mac OS X it doesn't seem to work for me
dpkg -scanpackages -m . /dev/null -->Packages
-bash: dpkg: command not found
dns:Administrator$ man dpkg
No manual entry for dpkg
I wonder how can I use the dpkg in Mac??

Or homebrew Link
brew install dpkg
The macports version has a lot of dependencies and takes forever.
If all you want to do is see what is in the package then unar and untar it.
ar -x package.deb
You should then have a debian-version, control.tar.gz and data.tar.gz in your current directory. The files the package would add will be in data.tar.gz. The package description will be in a file named control inside the control.tar.gz file.
tar -tvzf data.tar.gz

You will first have to install dpkg. In my opinion the easiest way to do this is to first install macports which is a high level packet manager for os x and then use macports to install dpkg.
Installing macports: http://www.macports.org/install.php
Once installed you can run sudo port install dpkg.
Then you can use dpkg on the command line.

"dpkg" utility can be provided by Fink.

Related

protoc: command not found (Linux)

I am trying to use Protobuf on Linux box. I downloaded the pre-compiled from github.
When I try to compile my .proto file or just check the protobuf version, it says
protoc: command not found.
I tried the same steps on Windows machine using pre-compiled protobuf version and it works fine there.
Install protoc for Linux and Mac
Linux
PROTOC_ZIP=protoc-3.15.8-linux-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local include/*
rm -f $PROTOC_ZIP
Mac OS X
brew install protobuf
Alternately, if you don't have Homebrew.
PROTOC_ZIP=protoc-3.15.8-osx-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
source: http://google.github.io/proto-lens/installing-protoc.html
For Linux Ubuntu 20, only install with snap
snap install protobuf --classic
or via apt, with:
sudo apt install protobuf-compiler
You can try it:
Install grpc and protobuf
brew install grpc protobuf
I know this question is specifically asked for Linux and I could n't find any question as it relates to solving this error on Windows.
This might help people who encounter the same error on windows.
Step 1: Download the windows distribution (protoc-3.5.0-win32.zip) from the link protobuf and unzip locally to a folder
Step 2 : Add the folder path to the path in the system environment variables.
Step 3: close the command prompt, restart the command prompt and try the command protoc
I might be late to the party but I also had "command not found" when trying to run protoc. It turned out it was just missing the execute permission. A quick chmod +x protoc fixed this for me.

How to install sshpass on Mac?

I would like to automate ssh login from my Mac.
It does have a simple solution:
sshpass -p my_password ssh m_username#hostname
But my problem is installing sshpass on my Mac.
Update 2022: Unfortunately, Aleks Hudochenkov is no longer updating his repo. There are a bunch of other repos on GitHub that purport to contain a Homebrew recipe for sshpass. It's up to you which of them (if any) to trust.
Some years have passed and there is now a proper Homebrew Tap for sshpass, maintained by Aleks Hudochenkov. To install sshpass from this tap, run:
brew install hudochenkov/sshpass/sshpass
Tap source
There are instructions on how to install sshpass here:
https://gist.github.com/arunoda/7790979
For Mac you will need to install xcode and command line tools then use the unofficial Homewbrew command:
curl -L https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb > sshpass.rb && brew install sshpass.rb && rm sshpass.rb
Another option in 2020 is this homebrew tap, maintained by esolitos
brew install esolitos/ipa/sshpass
Following worked for me
curl -O -L https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz
cd sshpass-1.06/
./configure
sudo make install
Solution provided by lukesUbuntu from github works for me:
Just use brew
$ brew install http://git.io/sshpass.rb
Please follow the steps below to install sshpass in mac.
curl -O -L https://fossies.org/linux/privat/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz
cd sshpass-1.06
./configure
sudo make install
I just followed the instructions from this article and it helped,
curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.05/sshpass-1.05.tar.gz && tar xvzf sshpass-1.05.tar.gz
//This creates a directory sshpass-1.05
cd sshpass-1.05
./configure
make
sudo make install
I found that most of the answers listed here are out of date. To install the latest, I ran this and downloaded directly from sourceforge.net, based on other answers here.
curl -L https://sourceforge.net/projects/sshpass/files/latest/download -o sshpass.tar.gz && tar xvzf sshpass.tar.gz
cd sshpass-*
./configure
sudo make install
For the simple reason:
Andy-B-MacBook:~ l.admin$ brew install sshpass
Error: No available formula with the name "sshpass"
We won't add sshpass because it makes it too easy for novice SSH users to
ruin SSH's security.
Thus, the answer to do the curl / configure / install worked great for me on Mac.
Just a slight update from the previous answer
curl -O -L https://fossies.org/linux/privat/sshpass-1.09.tar.gz && tar xvzf sshpass-1.09.tar.gz
cd sshpass-1.09/
./configure
sudo make install
This Worked as on OCT 2021
Short answer
To avoid having to rely on unknown Github repositories (directly or via Homebrew taps) just use MacPorts :)
Just install MacPorts and then type
sudo port install sshpass
Details / Long answer
The idea is to install sshpass via MacPorts instead of Homebrew.
You can have both Homebrew and MacPorts on the same machine, but be careful as some packages are available on both sources, and in that case you should be consistent in order to avoid conflicts.
In such cases, normally I give priority to Homebrew, but sshpass won't be provided by them, as they explicitly say.
In fact, if you type:
brew install sshpass
Then the output will also include this sentence:
We won't add sshpass because it makes it too easy for novice SSH users to ruin SSH's security.
Then in this case MacPorts is the only choice (if you really want to use sshpass).
Some links
Link to the MacPorts project
How to install MacPorts
Link to the sshpass Port on MacPorts
Aargh, the problem with the outdated links.
Simply go to https://sourceforge.net/projects/sshpass/
Download latest version and then tar xvzf it and finally cd to the dir where it got unpackedand install with:
./configure make sudo make install
I suppose this will also work on every OS with supported C sdk installed...

How to install mcrypt extension on mac os x yosemite (10.10)

I've updated my Mac OS X to Yosemite, but doing that I over write all my dev environment. So now, to run Laravel 4 on my local apache I need to install the Mcrypt extension, but everything that i've tried i fail. Even the steps that have worked on OS X Mavericks (10.9)
Anybody has the same issue?
Thanks in advance.
Cheers
I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. Can't say whether or not it will work so well on Yosemite but worth a shot..
Homebrew
brew install autoconf
brew install mcrypt
Macports
Check PHP version
php -v
Update Macports
sudo port -v selfupdate
Download & install the appropriate version..
sudo port install php55-mcrypt
now dummy proof it..
Find where Macports put the file mcrypt.so and copy it to all instances of /php/extensions/no-debug-... folder. If you have that directory structure in multiple places, copy it to all of them. So every php/extensions/no-debug.. folder on your computer has a copy of mcrypt.so
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
Determine where your php.ini file is and make sure it's the one your actually using because you may have this file in more than 1 place. Do this to all php.ini files you find..
Within that file find and uncomment the following line. If it's commented out, uncomment it. If it's not in the file at all, add it. In my default php.ini file I found this on line 536:
extension=mcrypt.so
Compile
Download mcrypt
curl -O http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
Uncompress it
tar -zxvf libmcrypt-2.5.8.tar.gz
Configure, build, and install
./configure && make && sudo make install
Download Autoconf
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
Uncompress it
tar xvfz autoconf-latest.tar.gz
Configure, build, and install
./configure && make && sudo make install
Apache
Regardless which method you used to install it. You should always restart Apache when your done.
Restart Apache
sudo apachectl restart
I just did these and it installed. MAMP etc. is not installed.
brew tap josegonzalez/homebrew-php
brew install php55-mcrypt
And weirdly, I had to reinstall to make it install properly.
brew reinstall php55-mcrypt
However, this also re-installed PHP5.5 from source, but no matter, all is working fine on my end.
I had the same problem. But, I'm using MAMP for my local development. So, I just needed to symlink the php file over to MAMP's version and all is working.
If using homebrew, try reinstalling or relinking your php install.
I'm sure I can help you get back up and working, so just let me know if that doesn't help.
First Install libtool from homebrew, which is a dependency in 10.10 Yosemite
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
Then CD to your php directory
cd /usr/local/php5
And into your php.d directory
cd php.d
Then finally do a quick ls to see which extensions you are using:
ls -l
If you see duplicate entries containing "mcrypt" you will need to open one of them up, and comment out the line:
extension=mcrypt.so
to
;;extension=mcrypt.so
But only in one of them. For me it was mcrypt.ini. So..
sudo nano mcrypt.ini
added the line and done!

How to install libuuid on Mac OS X?

I'm trying to compile gearman-0.28 on Mac, but encountered the following error:
configure: error: Unable to find libuuid
I don't know how to install libuuid on Mac, my Mac is 10.7.2 version.
Any one can help me? Thanks in advance.
With Homebrew:
brew install ossp-uuid
For those who are trying to install the uuid extension from PECL, the ossp-uuid and the util-linux's uuid package shipped with Mac OSX will not work as they are out dated. You will need an updated version of uuid from util-linux. It is available on Homebrew.
brew install util-linux
But util-linux is a keg-only package and will not be symlinked to /usr/local. Hence you will have to specify the following path when prompted for uuid installation directory
/usr/local/opt/util-linux
For unattended installations, you can use
printf "/usr/local/opt/util-linux" | pecl install uuid
Install mac port like
sudo port install ossp-uuid
$configure --with-lib
As time goes by, it seems worthwhile to mention that libuuid has become part of macOS in the meantime.
If you want an up to date alternative to the brew or mac ports solutions, the following from here works great. You can also add the code to your .zshrc or .bash_profile
$ alias uuid="python -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)' | pbcopy && pbpaste && echo"
$ uuid
34469137412242129cd908e384717794

How to create .deb packages on Mac OS X

I am trying to upload my app on Cydia and it requires .deb package. I am unable to figure out how to make .deb packages on mac. I am using 10.6.3 when I write this command on terminal
dpkg-deb -b MyProgram
Terminal output is
-bash: dpkg-deb: command not found
I've install fink, Mac ports insert Mac DVD to find out but nothing helps.
It's available on Homebrew:
brew install dpkg
If you don't have Homebrew installed, go to brew.sh. It's a simple one-liner to install.
Homebrew is less invasive, less complicated, and more popular than Macports or similar.
I installed mac ports 1.7 through terminal as no package is available.
After that I installed Mac ports 1.9 through installer.
Then goto this path /opt/local/bin and run sudo port selfupdate
after that execute sudo port install dpkg
it will take some time and after that your dpkg is successfully configured.
Run this command sudo dpkg-deb -b MyProgram to make MyProgram.deb
Note MyProgram should contain DEBIAN folder and under that control file remove txt extention
Below is control file
Website: www.zeeshanullah.com
Maintainer: zeeshanullah <zzeeshann#gmail.com>
Name: Snapture
Package: zeeshanullah
Section: zeeshanullah
Version: 2.x.x
Architecture: iphoneos-arm
Description: GPS joke.
Sponsor: zeeshanullah.com <zeeshanullah>
dont forget to place a new line at the end of control file otherwise you will get an error.
You need Xcode installed on your system before using mac ports - you find it on the second mac DVD, I think. After that, you can install mac ports and then via the Terminal type "sudo port install dpkg", press return and enter your password. It may take some time to compile. You tried that?
Best option is to use FPM and you can create it in 50 secs:
fpm
i think these links can be useful for you:
How to make a deb on mac
Using ant to create deb

Resources