How to install brew on a raspberry pi? - raspberry-pi

These are my raspberry pi OS, Kernel version and archtecture configs
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.10.52-v7l+
Architecture: arm
When I try to run their script(https://brew.sh/):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I get
Homebrew on Linux is only supported on Intel processors!
and, whenever I try to run a brew command, I get:
-bash: brew: command not found

Homebrew for linux is called Linuxbrew. And the installation command that you need is:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
Please check out this link to get more info about it: https://github.com/Linuxbrew/brew
Also notice that while Linuxbrew can run on Raspberry Pi (32-bit ARM), no binary packages are available for it.

Here are my two cents on installing brew on RaspberryPi Zero W and RaspberryPi 3+ (RaspberryPi OS, bullseye).
$ # Install dependencies
$ sudo apt update -y && sudo apt upgrade -y
$ sudo apt install git
$ # Install rbenv and Ruby 2.6.8 (It takes 30-90 min.)
$ # As of 2022/06/09, ARM processors require Ruby 2.6.8.
$ # Check the gist below what is doing as well.
$ bash <(curl -sL https://gist.github.com/KEINOS/7101f542be23e5048198e2a27c3cfda8/raw/install_ruby_rpi.sh)
$ source ~/.bashrc
$ # Smoke test Ruby
$ ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [armv6l-linux-eabihf]
$ # Clone homebrew repo under /opt
$ sudo git clone --depth=1 https://github.com/Homebrew/brew /opt/homebrew
$ # Setup homebrew
$ sudo chown -R $(whoami) /opt/homebrew
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc
$ source ~/.bashrc
$ # Full update to tap homebrew/core (It takes 30-90 min.)
$ brew update --force --verbose
$ # Smoke test brew
$ brew --version
Homebrew 3.5.1
Homebrew/homebrew-core (git revision 1d9fb5dd1e6; last commit 2022-06-09)
$ # Install "hello world" package which supports both 32bit and 64 bit ARM.
$ # - Source: https://github.com/KEINOS/Hello-Cobra
$ # - Formula: https://github.com/KEINOS/homebrew-Hello-Cobra
$ brew install KEINOS/Hello-Cobra/hello-cobra
***snip***
$ hello-cobra hello world
Hello, world!
$ # Env info of RaspberryPi Zero W
$ more /proc/device-tree/model
Raspberry Pi Zero W Rev 1.1
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-zero 5.10.92+ #1514 Mon Jan 17 17:35:21 GMT 2022 armv6l GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
$ # Env info of RaspberryPi 3+
$ more /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-3pls 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
Note that everything for brew is slow on ARM6. Patience is required not only when setting up linuxbrew, but also when installing packages using brew.
However, once the package has been successfully installed, it should work as fast as expected. So, I'd say it is worth trying linuxbrew on the ARM6 and ARM64 architectures.
References
ARM | Homebrew on Linux # docs.brew.sh
Untar anywhere | Installation # docs.brew.sh
How can I check the available version of a package in the repositories? # AskUbuntu.com
Installing Ruby versions | rbenv # GitHub

Raspberry Pi
Homebrew can run on Raspberry Pi (32-bit ARM), but no binary packages
(bottles) are available. Support for Raspberry Pi is on a best-effort
basis. Pull requests are welcome to improve the experience on
Raspberry Pi.
https://docs.brew.sh/Homebrew-on-Linux

Two comments on installing Homebrew on Raspberry Pi 400 Rev 1.0, Raspbian Debian 11.5.
For an unknown reason Homebrew installer requires exactly ruby version 2.6.8. My Pi has ruby 2.7.4 but that was not accepted
After installing 2.6.8 using the above hint (ruby-build available from the regular repository does not offer it, the next after 2.6.6 being 2.7.0), the brew update --force --verbose command was still failing on not finding 2.6.8. It was so because the 'brew' script has the PATH explicitely filtered to the system one, "/usr/bin:/bin:/usr/sbin:/sbin". Only after manually adding the path for ruby 2.6.8 did the update work. NB. the script was overwritten during the process so in order to install any package I had to add the path it again.
Any idea why it is "exactly 2.6.8" and not "2.6.8 or newer"?

Related

How do I install telepresence version 1 in ubuntu 22.04?

I am trying to install telepresence version 1 in ubuntu 22.04 but I don't have the download links to it.
Use this commands:
# 1. Download the latest binary (~50 MB):
sudo curl -fL https://app.getambassador.io/download/tel2/linux/amd64/latest/telepresence -o /usr/local/bin/telepresence
# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence

Mac M1: Docker compose fails in vscode - mongodb-database-tools not installable

I'm running this Docker file in MAC M1:
Dockerfile
ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends vim wget redis-tools
ARG MONGO_CLI_VERSION=4.4
RUN wget -qO - https://www.mongodb.org/static/pgp/server-${MONGO_CLI_VERSION}.asc | sudo apt-key add -
RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGO_CLI_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_CLI_VERSION}.list
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends mongodb-mongosh \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian11-x86_64-100.5.3.deb
RUN apt install ./mongodb-database-tools-*-100.5.3.deb
RUN su node -c "wget -O ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
RUN su node -c "echo -e '\n# Git Completion' >> ~/.bashrc"
RUN su node -c "echo -e 'source ~/.git-completion.bash\n' >> ~/.bashrc"
The response is shown in the image attached.
On this line:
RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian11-x86_64-100.5.3.deb
You're trying to install a package named mongodb-database-tools-debian11-x86_64-100.5.3.deb that is for Intel processors (x64_64) in your ARM64 image. That's not going to work.
MongoDB doesn't seem to offer a package for Debian on ARM64 on their download page. They do offer one for Ubuntu ARM64.
There doesn't seem to be a variant of javascript-node that builds on Ubuntu 18 Bionic, however, I think you can keep on using this Debian 11 Bullseye variant, because the version of MongoDB-database-tools for Ubuntu 16 seems to install just fine:
RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu1604-arm64-100.5.3.deb
Build the image and test:
docker build -t test . ; docker run --rm test mongodump --version
mongodump version: 100.5.3
git version: 139703c0587796da96c367f365473d0266f9cede
Go version: go1.17.10
os: linux
arch: arm64
compiler: gc
If you want this image to build on both x86 and ARM, check what architecture you're on before downloading the .deb:
RUN if [ "$(arch)" = "aarch64" ] || [ "$(arch)" = "arm64" ]; then\
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu1604-arm64-100.5.3.deb;\
else\
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian11-x86_64-100.5.3.deb;\
fi;
RUN apt install ./mongodb-database-tools-*-100.5.3.deb
Try another platform for example x86_64
https://docs.docker.com/desktop/mac/apple-silicon/
Not all images are available for ARM64 architecture. You can add
--platform linux/amd64 to run an Intel image under emulation

Docker-compose: /usr/local/bin/docker-compose : line 1: Not: command not found

i'm trying to install Docker-compose on my Raspberry Pi 3+ which installed Raspbian buster.
I followed instruction on docker.com. After I entered command : sudo curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose.
It show a table for downloading
Result
It seems nothing downloaded, just have a file docker-compose saved in /usr/local/bin/docker-compose. When I opened it, it empty. Then I enter command docker-compose -v, it displayed error /usr/local/bin/docker-compose : line 1: Not: command not found.
Anyone have solution?
UPDATE:
Added the following command to my answer to download the LATEST version without specifying any version number at all so the download can be scripted.
curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '<a href="/docker/compose/releases/download/' | grep -o 'v[0-9:].[0-9].[0-9]')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It's a bit untidy, but it works. If you have a more elegant way than mine, ping it to me in the comments and I'll update my answer.
Just need to set the perms on the file:
chmod +x /usr/local/bin/docker-compose
Use the file command to validate that you pulled the correct arch for your system.
Intro:
Although docker-compose can be installed from a repo per the accepted answer, apt-cache show docker-compose reveals that as of 20211201 the repo version is only v1.25; about 2 years behind the current v2.1.1 release. In order to take advantage of more modern docker file versions, I needed to get the Github download working.
Short Answer:
The Docker documentation for Docker-Compose is WRONG. They forgot to preface the version number in the command with a "v"; consequently the download fails. Apparently this has been wrong for ages...
Longer Answer:
I ran the below command from the Docker-Compose documentation, and substituted the version "2.1.1" for "1.29.1" per Docker's guidance:
To install a different version of Compose, substitute 1.29.2 with the
version of Compose you want to use.
sudo curl -L "https://github.com/docker/compose/releases/download/2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
The resulting download was 9 KB for a 23 MB binary. Clearly the link was bogus. So I went to the root of the address used in the command "https://github.com/docker/compose/releases" and right-clicked on the version of Docker-Compose that I wanted and chose "Copy Link Address"
This revealed the link Docker was telling folks to use didn't have a "v" prefaced before the version number in the https:// address part of the command.
Solution:
Preface a "v" before the version number you want in the link as below and the command executes successfully:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
BTW, I too was downloading docker-compose for a Raspberry Pi using the aarch64 binary for Ubuntu 20.04 LTS. However, the missing "v" fix for the broken download address should work for any platform.
This is because on a raspberry pi the url part of the command results in
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-armv7l
Looking at the latest stable release at https://github.com/docker/compose/releases/tag/1.24.1 you can see there is no download for the armv7l architecture so the file is empty because there is nothing to download.
Will update answer once I figured out how to install docker-compose on Raspian.
Edit:
Via apt-get. Note: Currently (Nov. 8 2019) this installs version 1.21 which is not the latest available.
sudo apt-get install docker-compose
Via pip3. (Installs latest)
sudo apt-get install python3-pip
sudo pip3 install docker-compose
And then restart your system with
sudo shutdown -r

check percona-xtrabackup installed?

I installed percona-xtrabackup on my OEL 7 but how to check whether its installed or not
[root#M1 ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root#M1 ~]# su - mysql
[mysql] sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
[mysql] sudo percona-release enable-only tools release
[mysql] sudo yum install percona-xtrabackup-80
[mysql] rpm -qa | grep xtrabackup
percona-xtrabackup-80-8.0.7-1.el7.x86_64
You can use this command to check whether it's installed or not
[root#tester ~]# yum list installed | grep xtrabackup
if it's installed it will display like this :
[root#tester ~]# yum list installed | grep xtrabackup
percona-xtrabackup-24.x86_64 2.4.18-1.el6 #percona-release-x86_64
or you can just run the software with argument like this :
[root#tester ~]# xtrabackup --version
if it's installed it will display content like this :
xtrabackup version 2.4.18 based on MySQL server 5.7.26 Linux (x86_64) (revision id: 29b4ca5)

unable to install haproxy 1.5 on centos 6.5

I am trying to install haproxy on my centos 6.5 server. I am using the command
yum install haproxy
This command installs a version 1.4.x. I have also looked at the following links, but could not get it to work
http://virtuallyhyper.com/2013/05/configure-haproxy-to-load-balance-sites-with-ssl/
http://blog.haproxy.com/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
https://github.com/bluerail/haproxy-centos
how do i install it?
You can build the RPM as follows:
mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
sudo yum -y install pcre-devel openssl-devel
cd rpmbuild/SOURCES
curl -L -O http://www.haproxy.org/download/1.5/src/haproxy-1.5.3.tar.gz
tar zxf haproxy-1.5.3.tar.gz
cd ..
cp -p SOURCES/haproxy-1.5.3/examples/haproxy.spec SPECS/haproxy153.spec
sed -i 's/Release: .*/Release: %{?_release:%{_release}}%{!?_release:1}/' SPECS/haproxy153.spec
sed -i 's/USE_PCRE=1 /USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 /' SPECS/haproxy153.spec
rpmbuild --define "_topdir `pwd`" --define "_release 2" -bb SPECS/haproxy153.spec
(I use a local directory and set the release number otherwise it is the same as http://qiita.com/uemura/items/e822c1ed505b9fe0208f)
Install
scp RPMS/x86_64/haproxy-1.5.3-2.x86_64.rpm root#somewhere:~/
somewhere# yum localinstall ~/haproxy-1.5.3-2.x86_64.rpm
You could install from source using one of these tar bundles:
http://www.haproxy.org/download/1.5/src/
You will probably need to install the following bundles to compile from source:
yum openssl-devel pcre-devel make gcc
Here's also a script which I presume would work on your environment