Boost 1.60.0.tar.bz2 not extracting correctly - boost

Forgive me for any silly mistakes but I'm very inexperienced. I have a file boost_1_60_0.tar.bz2 and am trying to extract it to /usr/local using the command
tar --bzip2 -xf ~/Downloads/boost_1_60_0.tar.bz2
When I try to do this it gives me over a thousand errors each with the same basic format like this example: boost_1_60_0/doc/html/boost_asio/reference/serial_port_base/: Failed to create dir 'boost_1_60_0'Can't create 'boost_1_60_0/doc/html/boost_asio/reference/serial_port_base'
When I do this I have cd'd into usr/local. Thank you for your help.

You don't have permission to write into /usr/local as an ordinary user.
Instead you should extract to a build directory, for example under your home directory, and then follow the boost build and installation instructions in the "getting started" page. That will put the files into /usr/local with a reasonable structure.

Related

Trouble installing and running elasticsearch

Yes, I have thoroughly searched for another answer to this question but have yet to find one.
I tried installing first by following the instructions on this page: http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
I am not sure what to do after this step. It seems that is has installed correctly, but I don't know how to run it. (I am using PuTTY.) Can I import it into my module now and being using it, or is there something else I should do?
Here are some attempts I've made:
deloacha#azdev-deloacha:~$ bin/elasticsearch.bat
-bash: bin/elasticsearch.bat: No such file or directory
deloacha#azdev-deloacha:~$ cd elasticsearch-1.5.1/bin
-bash: cd: elasticsearch-1.5.1/bin: No such file or directory
deloacha#azdev-deloacha:~$ cd elasticsearch-1.5.1
-bash: cd: elasticsearch-1.5.1: No such file or directory
deloacha#azdev-deloacha:~$ cd ..
deloacha#azdev-deloacha:/home$ cd elasticsearch-1.5.1
-bash: cd: elasticsearch-1.5.1: No such file or directory
Installing the way as provided in the document can sometimes leads to confusion. You need to find the directory containing the elasticsearch files. most probably it'll be at "/etc/elast...."
Another easy way of installation follow the steps:
make a directory where you want to install
go to that directory and download elasticsearch there using
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.1.tar.gz or curl
extract files: tar -zxvf elasticsearch-1.5.1.tar.gz
cd elasticsearch-1.5.1
You need to have java 7 on your system. you can start elasticsearch using "bin/elasticsearch -d" . "-d" is to run in detached mode.
Logs are by default in the location elasticsearch-1.5.1/logs. Check logs for any error during start up.
check status at: http://localhost:9200 or http://{system ip}:9200

zeroMQ: cannot open libzmq.so.4

I am trying to install the zeroMQ for my server(redhat 7). Here is what I did:
1) download the zeroMQ and unpack it.
2) navigate to the file where I put the zeroMQ and run the commands below:
./configure
make
make install
Now I can find two head files in /usr/local/include: zmq.h and zmq_utils.h and five files in /usr/local/lib: libzmq.a libzmq.la libzmq.so libzmq.so.4 libzmq.so.4.0.0.
Then I try to code like this:
#include <zmq.h>
...
void * context = zmq_init(1);
But I get this error message: undefined reference to `zmq_init'
I find that the include works well but it cant find 'zmq_init', so maybe it's the problem of lib files. But all of the lib files have been in /usr/local/lib, right?
What should I do?
Problem solved:
I got that error message because the lib files are in the directory: /usr/local/lib
What we need to do is to create a file named local-lib.conf under the directory /etc/ld.so.conf.d/ and write /usr/local/lib in it. The name of the file is not important but its extension must be .conf.
Then, we must navigate to /etc/ld.so.conf.d/ and type this command: sudo ldconfig
I tried the fix provided by #Yves above, but that didn't work out for me so here's another way for Debian/Git installations.
Alternative fix:
I have faced this issue on a Docker container which was occuring due to the libzmq/czmq which was installed by cloning the git repo.
The problem is that the shared libraries when installed using git are located in the /usr/local/lib folder instead of /usr/lib/ where usually, in my case a C/C++ program looks for shared library files.
I fixed it by copying all files from /usr/local/lib folder to/usr/lib/ using the command
$ sudo cp -R /usr/local/lib/* /usr/lib
This was for a RPi/ Ubuntu-16.04 docker, the command or location of the files may vary depending on your OS.

configure command not found cygwin

This question has been asked many time but I am not able to resolve the problem from them so I am asking
I had installed Cygwin a few days ago.I tried using ./configure command but it says
-bash: ./configure: No such file or directory
I tried using
where configure
but I got the output
INFO: Could not find files for the given pattern(s).
then I tried grep configureand I got this output
/etc/bash_completion.d/configure
/usr/i686-pc-cygwin/sys-root/usr/share/libtool/libltdl/configure
/usr/share/ELFIO/configure
/usr/share/libtool/libltdl/configure
I tried to export the path and then run the ./configure but it also didn't worked.
I find no executable file named as configure in my cygwin bin directory.
Does it mean that I have to add configure file manually?How can I correct it?
NOTE :- I had also tried sh configure but it also didn't worked
If a software project is set up to be built using autoconf, that tool generates a script canonically called configure. It queries the system for various parameters that are subsequently used in the build, and is specific to the software package to be built. Different software projects have different configure scripts. They are all called configure, but their contents are not the same.
So, to actually build such a software project once that script was set up (usually done by the maintainers when packaging the source tarball for distribution), you call:
tar xzf <tarball>.gz # or xjf <tarball>.bz2 or whatever
cd <sourcedir> # the one you just untarred
./configure
make
make install
Note the prefix ./, which means "located in this directory" (i.e. the top directory of that project's source tree).
Actually, the better procedure is the so-called "out-of-tree build", when you set up a different directory for the binaries to be built in, so the source tree remains unmodified:
tar xzf <tarball>.gz # or xjf <tarball>.bz2 or whatever
mkdir builddir
cd builddir
../<sourcedir>/configure
make
make install
So, there is supposed to be no configure executable in your PATH, you are supposed to call the script of that name from the source tree you are trying to build from.
If I correctly understood...
Configure is not an application that should be installed on your system, but script that should be delivered with source code to prepare for make command. File named configure should be in the main directory of source code.
I understand that this is an old question. However many might find this solution helpful.
Normally we use the make command to compile a downloaded source in cygwin. In many cases it contains a autogen.sh file. Running that file with
bash autogen.sh
will in many case solve the problem. At least it solved my issue and i could then use the make command

Building debian package for shell script

What: I've a shell script that I'd like to distribute to my LUG.
I believe that a debian package will be the easiest way to distribute it. I want to create a .deb file for the script in this repository
Where: I want it to be placed in some directory like /usr/local/bin so that it is easy to execute and maybe create some symbolic links
Problem: How to write make file for it and/or other files and folders required to do that. I researched a lot when I tried to do it couple of months ago but no luck then. Here are the files from my previous attempt Now I'm trying to pack this for a tutorial on shell script in my LUG and facing similar situation again.
I'll be really glad if someone can be patient enough to guide me through it.
Any kind of resources or details will be much appreciated.
PS: I also intend to port the script to perl soon.
As mirabilos said, you should at least have a look to the packaging-tutorial written by Lucas Nussbaum, the current Debian Project Leader. You can install it directly from a Debian repository:
# apt-get install packaging-tutorial
Then, open and skim the PDF located at /usr/share/doc/packaging-tutorial/packaging-tutorial.pdf. After skimming it you'll have the basic knowledge needed to understand the structure of a Debian package.
Now let's get our hands dirty. mv your script to a new directory. The name of the directory must follow the nomenclature upstreamname-*version*.
rul#helicon:/tmp/a$ mkdir script-0.1
rul#helicon:/tmp/a$ mv script.sh script-0.1
cd to the directory where your script is and run dh_make --createorig. Choose single binary. You'll now have a debian/ directory with lots of file in it. This files are the ones you need to make your package. In your case, most, if not all, of the *.ex files are safe to be removed. Read and modify when needed the remaining files.
Now let's write the core of our package. You want to install a script in /usr/local/bin. The good news is that there is already a program that does that for you. You just have to specify the file name and where to put it. This program is dh_install. It has a very complete man page. After reading it, you should now understand that you have to create a install file in the debian/ directory.
rul#helicon:/tmp/a/script-0.1$ echo "script.sh usr/local/bin/" > debian/install
Here you have a real example of this file usage.
That's it! You have all you need to build your package. cd to the root directory of your package and run dpkg-buildpackage. If all went well, you'll have your fresh new .deb in ../.
You really should have a look at, in this order, the inofficial packaging tutorial, the Debian New Maintainers' Guide, Debian Developer's Reference and Policy. (The order is also increasingly dry, and reversed for formalness.)
It may take two days or so, but is really worth it.
Also, look at other small packages shipping only scripts, or other mere “file installers” (like php-htmlpurifier, first example I remembered while writing this).
If your package will only have a single file (or small number of files) in it, going through the full Debian toolchain might be overkill.
For packaging single files, I recommend you use the equivs tool. Install the equivs package, then run equivs-control to create a template file.
Edit the template file (give your package a name, version number etc.).
Add the name of your script to the Files: attribute in the template, for example:
Package: my-awesome-script
Version: 4.2
Files: my-awesome-script.sh /usr/local/bin
Section: misc
Priority: optional
Standards-Version: 3.9.2
Maintainer: Me <me#gmail.com>
Description: An awesome script doing stuff
Lorem ipsum etc. pp.
Put the script file alongside the template file.
Run equivs-build which will create your Debian package.
This is much easier for these simple cases than anything else – and the package that you get is standards compliant without resorting to any hacks or jumping through hoops.
for pre install, write your script in file DEBAIN/preinst;
for post install, write your script in file DEBAIN/postinst;
Use checkinstall or fpm to build your packages in minutes not hours or days!:
sudo checkinstall --fstrans=yes --install=no -D --pkgname=script \
--maintainer='Name <name#domain.tld>' --pkgarch=all --pkgversion=0.1 \
--nodoc cp script.sh /usr/local/bin
fpm -s dir -t deb --prefix /usr/local/bin -n script -v 0.1 -a all ./script.sh
Note: checkinstall requires dpkg/dpkg-deb (only works on Debian/Ubuntu), fpm is platform independent but requires ruby.

What does /usr/sbin/install really do?

I'm trying to install discount on my VPS which is based on Solaris and compiling works great after setting some environment variables but the install fails.
So I thought I'd do the install manually, but what does install really do? Is it simply a mv followed by a chmod? Is it magic? That error seems to show that it attempts to do a lot of searching for files all over?
Can I just copy the binary, library and header files as usual?
Googling "install" doesn't give me much relevant information so I appreciate any clarification I can get!
According to man install:
install [OPTION]... [-T] SOURCE DEST`
install [OPTION]... SOURCE... DIRECTORY
install [OPTION]... -t DIRECTORY SOURCE...
install [OPTION]... -d DIRECTORY...
In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to
the existing DIRECTORY, while setting permission modes and owner/group.
In the 4th form, create all components of the given DIRECTORY(ies).
As for the difference to using cp, according to install vs. cp; and mmap, install unlinks the existing file, creating a new one linked to the same spot.
This has the advantage that, if the file you're trying to overwrite is a currently running program, it can continue running, as the file being written is in fact in a new location, and the existing program code is still in the old one.
A cp simply tries to overwrite the existing file, which will fail if the file is locked due to being in use.
Further information
install Command

Resources