Installing Nginx server - nginx

I am trying to install Nginx server on ubuntu using
wget http://nginx.org/download/nginx-1.5.3.tar.gz
tar xvfz nginx-1.5.3.tar.gz
cd nginx-1.5.3
./configure
make
install
this is what I get:
tar: Skipping to next header
gzip: stdin: invalid compressed data--crc error
gzip: stdin: invalid compressed data--length error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
./configure: 10: .: Can't open auto/options
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
What seems to be the problem with all these errors?

You are getting a bunch of tar errors, which might mean that the archive is broken. Try to address those issues first before doing a make.
I would start with replacing tar xvfz nginx-1.5.3.tar.gz
with tar -xvzf nginx-1.5.3.tar.gz

is gzip installed already? check by:
whereis gzip
and install it on ubuntu by:
sudo apt-get install gzip

Related

Issue updating packages to update OS - Raspian

Running a pihole on a currently unsupported OS (Raspian 9). I attempted to run a distro upgrade:
apt dist-upgrade -y
However it told me there was an issue with two dependencies:
The following packages have unmet dependencies:
libfreetype6-dev : Depends: libfreetype6 (= 2.6.3-3.2+deb9u2) but 2.6.3-3.2+deb9u1 is installed
sqlite3 : Depends: libsqlite3-0 (= 3.16.2-5+deb9u3) but 3.16.2-5+deb9u1 is installed
I tried running the recommended fix:
'apt --fix-broken install'
Resulting in:
dpkg-deb (subprocess): decompressing archive member: internal gzip read error: '<fd:4>:
invalid distance too far back'
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
dpkg-deb: error: subprocess tar returned error exit status 2
Traceback (most recent call last):
File "/usr/share/apt-listchanges/DebianFiles.py", line 124, in readdeb
output = subprocess.check_output(command)
File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['dpkg-deb', '-f',
'/var/cache/apt/archives/libsqlite3-0_3.16.2-5+deb9u3_armhf.deb', 'Package', 'Source',
'Version', 'Architecture', 'Status']' returned non-zero exit status 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 243, in <module>
main(config)
File "/usr/bin/apt-listchanges", line 101, in main
pkg = DebianFiles.Package(deb)
File "/usr/share/apt-listchanges/DebianFiles.py", line 215, in __init__
parser.readdeb(self.path)
File "/usr/share/apt-listchanges/DebianFiles.py", line 128, in readdeb
{'what': file, 'errmsg': str(ex)}) from ex
NameError: name 'file' is not defined
E: Invalid archive member header
E: Prior errors apply to /var/cache/apt/archives/libsqlite3-0_3.16.2-5+deb9u3_armhf.deb
debconf: apt-extracttemplates failed: No such file or directory
dpkg: warning: files list file for package 'libsqlite3-0:armhf' missing; assuming package
has no files currently installed
(Reading database ... 134985 files and directories currently installed.)
Preparing to unpack .../libfreetype6_2.6.3-3.2+deb9u2_armhf.deb ...
Unpacking libfreetype6:armhf (2.6.3-3.2+deb9u2) over (2.6.3-3.2+deb9u1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libfreetype6_2.6.3-
3.2+deb9u2_armhf.deb (--unpack):
cannot copy extracted data for './usr/lib/arm-linux-gnueabihf/libfreetype.so.6.12.3' to
'/usr/lib/arm-linux-gnueabihf/libfreetype.so.6.12.3.dpkg-new': unexpected end of file or stream
dpkg-deb (subprocess): decompressing archive member: internal gzip read error: '<fd:4>: invalid distance too far back'
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
dpkg-deb: error: subprocess tar returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libsqlite3-0_3.16.2-5+deb9u3_armhf.deb (--unpack):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libfreetype6_2.6.3-3.2+deb9u2_armhf.deb
/var/cache/apt/archives/libsqlite3-0_3.16.2-5+deb9u3_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I attempted the following:
Reconfigure dpkg database
sudo dpkg --configure -a
Force install the software
sudo apt-get install -f
Remove software package
sudo apt-get remove --purge package_name
Remove and overwrite
sudo ls -l /var/lib/dpkg/info | grep -i package_name
sudo mv /var/lib/dpkg/info/package_name.* /tmp
sudo apt-get update
sudo dpkg -i --force-overwrite /var/cache/apt/archives/full_name_of_package
None of this worked.
I tried just manually updating the packages and received dependency errors - the issue is trying to update one results in a dependency error for the other and vice versa:
sqlite3 : Depends: libsqlite3-0 (= 3.16.2-5+deb9u3) but 3.16.2-5+deb9u1 is to b e installed
libfreetype6-dev : Depends: libfreetype6 (= 2.6.3-3.2+deb9u2) but 2.6.3-3.2+deb 9u1 is to be installed
Any idea how to update these two packages when I they apparently require the other one to be updated to update themselves?
Thanks!

Issues installing mxnet GPU R package for Amazon deep learning AMI

I am having trouble installing mxnet GPU for R on Amazon deep learning linux AMI. The environment variables are such a mess that it’s a nightmare for any non-expert sys-admin to figure out.
Step 1: install the ridiculous amount of missing/broken programs and R packages
sudo yum install R
sudo yum install libxml2-devel
sudo yum install cairo-devel
sudo yum install giflib-devel
sudo yum install libXt-devel
sudo R
install.packages("devtools")
library(devtools)
install_github("igraph/rigraph")
install.packages(‘DiagrammeR’)
install.packages(‘roxygen2’)
install.packages(‘rgexf’)
install.packages(‘influenceR’)
install.packages(‘Cairo’)
install.packages(“imager”)
Step 2: edit the config.mk file
cd /src/mxnet
cp make/config.mk .
echo "USE_BLAS=openblas" >>config.mk
echo "ADD_CFLAGS += -I/usr/include/openblas" >>config.mk
echo "ADD_LDFLAGS += -lopencv_core -lopencv_imgproc -lopencv_imgcodecs" >>config.mk
echo "USE_CUDA=1" >>config.mk
echo "USE_CUDA_PATH=/usr/local/cuda" >>config.mk
echo "USE_CUDNN=1" >>config.mk
*note even though the USE_CUDA_PATH is set, it STILL cannot find libcudart.so and needs to be linked in the make command (shown later)
Step 3: make new config file so make command can find libcudart.so
/etc/ld.so.conf.d/cuda.conf
add /usr/local/cuda-8.0/lib64
sudo ldconfig
note this was posted by nvidia but does absolutely nothing to help the make rpkg
Step 4: set up R directories
Rscript -e "install.packages('devtools', repo = 'https://cran.rstudio.com')"
cd R-package
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cran.rstudio.com'));
install_deps(dependencies = TRUE)"
cd ..
step 5: make
cd /src/mxnet
sudo make -j8
Result:
make CXX=g++ DEPS_PATH=/home/ec2-user/src/mxnet/deps -C /home/ec2-user/src/mxnet/ps-lite ps
cd /home/ec2-user/src/mxnet/dmlc-core; make libdmlc.a USE_SSE=1 config=/home/ec2-user/src/mxnet/config.mk; cd /home/ec2-user/src/mxnet
make[1]: Entering directory /home/ec2-user/src/mxnet/dmlc-core'
make[1]:libdmlc.a' is up to date.
make[1]: Leaving directory /home/ec2-user/src/mxnet/dmlc-core'
make[1]: Entering directory/home/ec2-user/src/mxnet/ps-lite'
make[1]: Nothing to be done for ps'.
make[1]: Leaving directory/home/ec2-user/src/mxnet/ps-lite'
ar crv lib/libmxnet.a
*note, even when changing the config.mk file, the make command always returns ‘nothing to update’
Step 6: attempt to make rpkg
Cd /src/mxnet
Sudo make rpkg
Error:
Error: package or namespace load failed for ‘mxnet’:
.onLoad failed in loadNamespace() for 'mxnet', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/lib64/R/library/mxnet/libs/libmxnet.so':
libcudart.so.8.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
So it’s looking in a location that doesn’t exist: /usr/lib64/R/library/mxnet/libs/
When the file actually lives:
/home/ec2-user/src/mxnet/R-package/inst/libs/libmxnet.so
or
/home/ec2-user/src/mxnet/lib/libmxnet.so
What I’ve tried so far:
sudo LD_LIBRARY_PATH=/usr/local/cuda/lib64 make rpkg
This will fix the missing libcudart.so.8.0 issue but it is simply replace with:
libmklml_intel.so: cannot open shared object file: No such file or directory as well as the original ‘cannot find libmxnet.so
Also tried:
1. actually creating directories (/usr/lib64/R/library/mxnet/libs/) and then copying libmxnet.so there
Result: same error
adding /home/ec2-user/src/mxnet/R-package/inst/libs/ to the make command
sudo LD_LIBRARY_PATH=/home/ec2-user/src/mxnet/R-package/inst/libs make rpkg
Result: same error
a ridiculous amount of environment labels all of which failed:
export MXNET_HOME=/usr/lib64/R/library/mxnet/libs/
export MXNET_HOME=/usr/lib64/R/library/mxnet/libs/libmxnet.so
sudo ldconfig /usr/local/cuda/lib64
sudo ln -s /usr/lib64/R/library/mxnet/libs /usr/lib
sudo ln -s /usr/lib64/R/library/mxnet/libs/libmxnet.so /usr/lib
sudo ln -s /usr/local/lib/libmklml_intel.so /usr/lib
sudo ln -s /usr/local/lib/libiomp5.so /usr/lib
sudo ln -s /usr/local /usr/lib
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64/libcudart.so.8.0
export LD_LIBRARY_PATH=/usr/lib64/R/library/mxnet/libs/libmxnet.so /usr/lib
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/targets/x86_64-linux/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64/libcudart.so.8.0
In all ONE of these worked, because I briefly got mxnet R package working before it fell apart again. I’ve dropped 50+ hours into this installation, which, frankly is ridiculous. Tougher to install the software then it is to program an actual net....
I don’t have 5+ years of linux sys admin knowledge so if you’d like please be a bit more helpful then ‘fix environment variables.’ I can tell that’s obviously what’s wrong yet have no idea what ‘fix environment variables’ entails.
To top it off, even after successful install of the R package, it STILL won’t work until setting Rstudio server’s config file to: rsession-ld-library-path=/opt/local/lib:/usr/local/cuda/lib64
Did you try the following when running any sudo commands.
sudo -E make -j8
This means that it will preserve the env variables when running as superuser. You shouldn't have to add a new config file for the make to find the libraries. Just preserving the env variables using the above command should be enough.

R: Compiling issue

I want to compile the R source code on my own.
In order to this, I have installed all the required packages and two more with these commands
sudo apt-get build-dep r-recommended
sudo apt install libicu-dev gobjc-5
Then, I run the usual commands to configure with two additional options
./configure --enable-R-shlib --with-ICU
Until now everything ok, but when I tried to compile with the make command and at a certain point I got these error messages
make[2]: Entering directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
begin installing recommended package MASS
Error in untar2(tarfile, files, list, exdir, restore_times) :
incomplete block on file
Makefile:51: recipe for target 'MASS.ts' failed
make[2]: *** [MASS.ts] Error 1
make[2]: Leaving directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
Makefile:39: recipe for target 'recommended-packages' failed
make[1]: *** [recommended-packages] Error 2
make[1]: Leaving directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
Makefile:77: recipe for target 'stamp-recommended' failed
make: *** [stamp-recommended] Error 2
I have searched online but I haven't been able to figure it out what causes that error.
Thanks in advance.
OS: Ubuntu 15.10 64bit
Briefly:
You probably need apt-get build-dep r-base to get build-dependencies, not apt-get build-dep r-recommended
Your error is from also trying to build recommended packages for which you need an additional download step as explained in the documention
So add --without-recommended-packages to the configure call.

Nginx - src/core/ngx_sha1.h:19:17: no such file or directory

I try to install nginx with nginx-push-stream-module
./configure --prefix=/etc/nginx --add-module=../nginx-push-stream-module
make
make install
After I run 'make', I got this message:
In file included from src/core/ngx_crypt.c:12:0:
src/core/ngx_sha1.h:19:17: fatal error: sha.h: No such file or directory
#include <sha.h>
^
compilation terminated.
I resolved this issue on Ubuntu by installing openssl libs:
sudo apt-get install openssl openssl-dev
Then did a make clean and:
./configure --add-module=../nginx-push-stream-module
and run make again.

Error in installing SimpleDB::Class

I try to install SimpleDB::Class from cpan as sudo cpan SimpleDB::Class. it needs a dependency Memcached::libmemcached. so i try to install it, but it have the following errors.
CCLD clients/memstat
CC tests/atomsmasher.o
CCLD tests/atomsmasher
CXX tests/tests_hashplus-hash_plus.o
./config/depcomp: line 611: exec: g++: not found
make[2]: *** [tests/tests_hashplus-hash_plus.o] Error 127
make[2]: Leaving directory `/home/vanitha/.cpan/build/Memcached-libmemcached-0.4406- Oq4Z_m/src/libmemcached'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/vanitha/.cpan/build/Memcached-libmemcached-0.4406- Oq4Z_m/src/libmemcached'
make: *** [install] Error 2
Unable to build libmemcached: Error running cd src/libmemcached && make install
Aborted.
No 'Makefile' created TIMB/Memcached-libmemcached-0.4406.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
could not read metadata file. Falling back to other methods to determine prerequisites
exec: g++: not found - this is the error
Try this first of all: sudo apt-get install g++

Resources