Installing "opkg"? - openwrt

I'm trying to install a package to my OpenWrt SDK. To do that you have to use OPKG package manager by typing:
opkg update
opkg install <package>
However, in my case, OPKG is not installed and as a result I can't proceed.
Could anybody tell me how can I install it? Thank you.
I'm using Kubuntu btw:
Linux ghanem-VGN-BZ31XT 3.16.0-34-generic #47-Ubuntu SMP Fri Apr 10 18:02:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Opkg doesn't really have a 'release' you can just install - that is because it needs native libraries of your OS and it can be used in a very wide array of OSs.
Whenever I have to play with it on Ubuntu I have these 3 'one-liners' to install it, if you try and modify it to match your OS I'm sure it'll work for you:
Download opkg release (latest when this was written was 0.3.1):
wget http://downloads.yoctoproject.org/releases/opkg/opkg-0.3.1.tar.gz
tar -zxvf opkg-0.3.1.tar.gz
install compilation dependencies:
apt-get update && apt-get install -y gcc libtool autoconf pkg-config libarchive13 libarchive-dev libcurl3 libcurl4-gnutls-dev libssl-dev libgpgme11-dev libtool-bin
compile(compile with gpg support for signature verification, and curl to support basic auth - leave the enable-curl flag out to use it with the default wget):
* (pre-compilation) if there's no configure script (a file called configure) you need to call ./autogen.sh first
* ./configure --with-static-libopkg --disable-shared --enable-gpg --enable-curl --prefix=/usr && make && sudo make install
After make install is done you will have opkg installed - remember to add opkg.conf (example here) under /etc/opkg

Related

Failing to install VEP dependencies

I'm trying to install VEP, but am getting stuck installing its dependencies.
I try to install as suggested here https://www.ensembl.org/info/docs/tools/vep/script/index.html
cd ~/bin
git clone https://github.com/Ensembl/ensembl-vep.git
cd ensembl-vep
perl INSTALL.pl
But I get this error:
ERROR: DBI module not found. VEP requires the DBI perl module to function
http://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
So, I then try and install DBI as suggested here https://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
cpanm DBI
But I get this error:
Can't write to cpanm home '/Users/michaelflower/.cpanm': You should fix it with chown/chmod first.
How to I 'fix' it with chown/chmod??
On Ubuntu 20.04 this worked for me:
sudo apt install libdbi-perl
But then I ran into a bunch of other errors which I solved sequentially by doing these things (I restarted the installation after every step but I guess if you first do them all, then it should work in 1 go):
sudo apt update # Or you'll more errors
sudo apt install unzip
sudo apt install build-essential
sudo apt install libbz2-dev liblzma-dev zlib1g-dev
sudo apt install libcam-pdf-perl
cpan Bio::DB:HTS # Takes a while as well
This perl modules wants to install
cpan Bio::SeqFeature::Lite # Takes quite a while
Which wants to install:
cpan XML::DOM XML::Parser::PerlSAX XML::Twig
Which then ultimately fails with:
Files=109, Tests=72, 4 wallclock secs ( 0.28 usr 0.09 sys + 2.29 cusr 0.83 csys = 3.49 CPU)
Result: FAIL
Failed 103/109 test programs. 32/72 subtests failed.
make: *** [Makefile:837: test_dynamic] Error 255
MIROD/XML-Twig-3.52.tar.gz
one dependency not OK (XML::Parser); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports MIROD/XML-Twig-3.52.tar.gz
So I try to install XML::Parser
cpan XML::Parser
and it fails too
Note that if you build against a shareable library in a non-standard location
you may (on some platforms) also have to set your LD_LIBRARY_PATH environment
variable at run time for perl to find the library.
No 'Makefile' created TODDR/XML-Parser-2.46.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
I'll ddg some more...
... ok, I just reran to original install command and it crashes with a new message, it wants me to intall LWP::Simple. So I do, on my first attempt it crashed with a permissions error so I add sudo
sudo cpan LWP::Simple
Restarting install...
perl INSTALL.pl
SUCCESS!

Add WebP to ImageMagick supported formats for PHP 7.3 on a WHM dedicated server

I am trying to add WebP to ImageMagick supported formats for PHP 7.3 on a WHM dedicated server. Whenever I was adding this question I saw other posts related to this problem but they don't have a solution as I tried everybody's recommendations from those answers.
Here is what the deal is. I want to be able to serve images in WebP format on all our websites hosted on our server. So I installed some plugins to do that but they are trowing this warning which is saying that WebP is a missing ImageMagick format. Well, whenever I am checking PHPINFO under ImageMagick supported formats WebP is really missing.
I am also getting this Notification from that plugin:
EWWW Image Optimizer requires exec() to perform local compression. Your system administrator has disabled the exec() function, ask them to enable it.
So I went under the main PHP INI file and under disable_functions = I we don't have any function assigned.
So first I tried to install just libwebp library like this:
$ wget -c https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-0.6.1-linux-x86-32.tar.gz
$ tar -xvf libwebp-0.6.1-linux-x86-32.tar.gz
$ cd libwebp-0.6.1-linux-x86-32/
$ cd bin/
$ ls
After ls command I get this:
Ok, it is on the server, it is installed but it doesn't show up under ImageMagick supported formats so I tried to Install ImageMagick again from Unix Source.
After download I did
tar xvzf ImageMagick.tar.gz
Next configure and compile ImageMagick.
$ cd ImageMagick-7.0.8
$ ./configure
$ make
Install
sudo make install
Configured the dynamic linker run-time bindings:
sudo ldconfig /usr/local/lib
And then I wanted to run the ImageMagick validation suite:
make check
All this worked without any complaint or errors but whenever I check PHPINFO it still doesn't show any changes. What am I doing wrong here? How can I configure the PHP or what am I missing?
Thank you!
Before going further, remove all webp previous installation.
To install Imagick with webp support you should:
Install wepb from source:
wget http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz
tar xvzf libwebp-1.1.0.tar.gz
cd libwebp-1.1.0
./configure
make && sudo make install
Install Imagick from source with webp support:
wget https://imagemagick.org/download/ImageMagick.tar.gz
./configure --with-webp=yes
sudo make && sudo make install
Install Imagick using PECL:
sudo pecl install imagick
sudo echo "extension=gmagick.so" > sudo /etc/php/7.3/apache2/conf.d/20-imagick.ini
Restart apache sudo apache2ctl restart
To check if it works from the CLI:
php -r "print_r(Imagick::queryFormats());"
And you should see "WEBP" in the list.
This problem stems from the fact that the CentOS provided package for ImageMagick is not compiled with support for WebP.
There are three workarounds/solutions to this problem:
If you are using ALT-PHP (CloudLinux provided PHP) with cPanel, it comes with its own version of ImageMagick that was compiled with webp support. Of course, use of ALT-PHP requires the extra cost of a CloudLinux license so this may not be accessible to everyone.
After receiving a ticket about this today, I spent some time researching the issue to see if I could find a way to make this work. As a result, I've published the following guide that outlines how to make use of the ImageMagick package provided by the Remi Repository which is compiled with webp support. Due to the fact that cPanel is not developed or tested in the context of having the Remi Repository installed, we're not able to provide support for making use of the guide, or issues that may stem from its use. However, we'd like to offer the guide as a courtesy for those systems administrators who are interested nonetheless. This guide also includes a link to a rudimentary PHP script that I wrote for testing and verifying image support for webp and other common formats.
https://support.cpanel.net/hc/en-us/articles/4403506784919-How-to-enable-the-webp-image-format-for-use-with-ImageMagick-on-cPanel
The third option would be to manually compile ImageMagick and reinstall the PECL extension for use with your custom ImageMagick installation as is mentioned in other answers here.
Austin Lowery, Technial Analyst II, cPanel
Compile ImageMagick from source on CentOS 7 with .webp support
yum -y remove ImageMagick* && cd /root && rm -f ImageMagick.tar.gz && yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel OpenEXR-devel libwebp-devel rpmdevtool libtool-ltdl-devel ImageMagick-devel freetype-devel ghostscript-devel libwmf-devel jasper-devel lcms-devel bzip2-devel librsvg librsvg2 librsvg2* liblpr-1 liblqr-1-devel libtool-ltdl-devel autotrace-devel freetype +bytecode graphviz gs wmf jbig jpeg2 lcms jpeg libjpeg libjpeg-devel libtiff && cd /tmp && wget http://mirror.checkdomain.de/imagemagick/ImageMagick.tar.gz && tar xvfz ImageMagick.tar.gz && cd ImageMagick* && ./configure --prefix=/usr --with-rsvg=yes --with-wmf=yes --with-png=yes --with-libtiff=yes --with-tiff=yes --with-jpeg=yes --with-jp2=yes --with-freetype=yes && make && make install && ldconfig /usr/local/lib
#be3 Thank you for this. I have made a small change to this since I couldn't execute ./configure from the /tmp folder I move it to the /root folder for execution.
yum -y remove ImageMagick* && cd /root && rm -f ImageMagick.tar.gz && yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel OpenEXR-devel libwebp-devel rpmdevtool libtool-ltdl-devel ImageMagick-devel freetype-devel ghostscript-devel libwmf-devel jasper-devel lcms-devel bzip2-devel librsvg librsvg2 librsvg2* liblpr-1 liblqr-1-devel libtool-ltdl-devel autotrace-devel freetype +bytecode graphviz gs wmf jbig jpeg2 lcms jpeg libjpeg libjpeg-devel libtiff && cd /tmp && wget http://mirror.checkdomain.de/imagemagick/ImageMagick.tar.gz && tar xvfz ImageMagick.tar.gz && cd / && cp -r /tmp/ImageMagick-7.1.0-2 / && cd ImageMagick* && ./configure --prefix=/usr --with-rsvg=yes --with-wmf=yes --with-png=yes --with-libtiff=yes --with-tiff=yes --with-jpeg=yes --with-jp2=yes --with-freetype=yes --with-webp=yes && make && make install && ldconfig /usr/local/lib

erlang is no longer supported by Red Hat Enterprise Linux?

I'm trying installing Erlang on my REHL7.2, but unfortunately I failed. I tried two approaches
First I tried downloading a RPM package from official site of erlang (in fact the rpm package is for CentOS, but there's no RPM package for RHEL anyway), but
error: Failed dependencies:
libwx_baseu-2.8.so.0()(64bit) is needed by esl-erlang-19.0-1.x86_64
libwx_baseu-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-19.0-1.x86_64
Then I tried
$ wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
$ rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
But it failed too because
No package erlang available.
Error: Nothing to do
I wonder whether Erlang is no longer supported by RHEL? Otherwise how can I install Erlang on my RHEL7.2?
One simple solution to install the Erlang Solutions package is install the epel repository:
yum install epel-release
Then
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum install erlang
The epel repo contains the libwx_* libraries required.
As instructed here:
enter link description here
Run the following commands (note: the commands on the above link use R15B01, but in the following commands, I changed it to the last release of Erlang (R15B03) It will take a while to finish with the installation. Run commands line by line
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
wget http://erlang.org/download/otp_src_R15B03.tar.gz
tar zxvf otp_src_R15B03.tar.gz
cd otp_src_R15B03
./configure && make && sudo make install
After everything is done, you will be still at otp_src_R15B03 where Erlang is installed. Type erl and Enter, then, it should run and open Erlang prompt. I tried running Erlang from my home directory and from the root by just typing erl and it worked too. This way, Erlang is working good for me. To quit Erlang press CTRL + g then q and Enter
There is another way to install and useful info on this link:
enter link description here
I have figured it out! I found two solutions.
The first solution which is also the easiest way is to install a zero dependency version of erlang, please refer to my another Question. But I only tried this way after installing erlang from source, so if you failed this way, just try the following soltuion.
The other one is to build erlang from source (or by kerl which is essentially the same thing).
Install necessary dependencies:$sudo yum install ncurses-devel openssl-devel *openjdk-devel unixODBC unixODBC-devel
Download source code of erlang, unzip it and cd into the direcotry
sudo ./configure sudo make sudo make install
Please refer to this article.
Thank you everyone!
Try this, worked for me.
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum install erlang erlang-nox

ImageMagick - PECL issue - Cannot locate header file MagickWand.h

We are getting this error while installing ImageMagick PECL:
checking ImageMagick MagickWand API configuration program... found in
/usr/local/bin/MagickWand-config checking if ImageMagick version is at
least 6.2.4... found version 6.8.6 Q16 checking for MagickWand.h
header file... configure: error: Cannot locate header file
MagickWand.h ERROR: `/root/tmp/pear/imagick/configure --with-imagick'
failed extension imagick.so installed in /usr/local/lib/php.ini
/usr/local/bin/php does not have a php.ini Tidying
/usr/local/cpanel/3rdparty/php/53/etc/php.ini... No changes
Any idea how to fix this ?
This thread is old, but I solved this issue today on a Centos 7 by installing ImageMagick-devel package:
yum install ImageMagick-devel
Hope this helps.
Steps:
apt-get install libmagickwand-dev
/opt/lampp/bin/pecl install imagick
gedit /opt/lampp/etc/php.ini
add "extension=imagick.so" to php.ini
Probably its looking for the file MagickWand.h and unable to see that file in the defined location. Try these steps
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar zxf imagick-3.1.0RC2.tgz
Edit the file imagick-3.1.0RC2/config.m4 line number 55.
Make changes like this, from
if test -r $WAND_DIR/include/ImageMagick/wand/MagickWand.h;
to
if test -r $WAND_DIR/include/ImageMagick-6/wand/MagickWand.h;
Note this difference made in the imagick version number. After that try the conventional installation procedures
cd imagick-3.1.0RC2
phpize
./configure
make
make install
Perhaps this http://thomas.bindzus.me/2013/08/11/building-pecl-imagick-for-php-5-5-1-on-centos-6-4/ can be of some help to others.
The solution described by Leo Prince almost worked for me, just had to set PKG_CONFIG_PATH, and perhaps that's just my server setup which isn't as perfect as it should be.
Here is what I did step-by-step (I'm running CentOS 6.4, Apache 2.4.6, and PHP 5.5.1):
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar zxf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC
phpize
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure –with-imagick
make
make install
echo extension=imagick.so > /etc/php.d/imagick.ini
service httpd restart
php -m | grep imagick
First run following commands
1. "WHM Home » Software » Rebuild RPM Database"
2. yum install ImageMagick ImageMagick-devel
3. yum install pcre-devel
Then go to
Go to WHM -> Software -> Module Installers -> PHP Pecl (manage). On the
box below “Install a PHP Pecl” enter “imagick” and click “Install Now”
button – that’s all. Restart Apache.
Above steps worked for me.

OpenCV binary deployment (Linux)

In the institute we use Scientific Linux 5 on the cluster and I need to deploy an app that uses a modern OpenCV distribution (2.3.1 or 2.4.0). I don't have root privileges on the cluster.
Essentially, how do I package all the dynamic binary dependencies of ffmpeg (and hopefully x264), opencv so that I can xcopy-deploy my app?
I have a working installation of OpenCV 2.3.1 on Ubuntu. If there was a way to controllably load the executable and copy along all the dynamic dependencies, I could use it.
Thanks,
Vadim
You don't need to install OpenCV in the computers if you don't have permission to do so.
Place the OpenCV libraries and it's dependencies somewhere in the system and before you execute your application make sure you adjust LD_LIBRARY_PATH to add these paths.
To retrieve the list of dependencies of a certain binary application/library, use ldd. You might be interested in reading this post: Copying shared library dependencies
1) Install GCC 4.7.3
sudo apt-get update
sudo apt-get install build-essential
2) Install CMake 2.8.10.1
sudo apt-get install cmake cmake-curses-gui
3) Download OpenCV 2.4.5
cd ~/Downloads
tar -xf opencv-2.4.5.tar.gz
cd opencv-2.4.5
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd ../..
rm -rf opencv-2.4.5*
OpenBR uses OpenCV for face recognition. A clear documentation is available to install OpenBR,Here's the link!

Resources