ubuntu: installing apache ant apache-ant-1.10.1 - ant

$ ant -version
/home/rahul/java/jdk1.8.0_121/jre/bin/java: 6: /home/rahul/java/jdk1.8.0_121/jre/bin/java: Syntax error: ")" unexpected
How to resolve this?

Please follow the below steps to install Apache Ant in Ubuntu-
Using Ubuntu Package Manager
sudo apt-get update
sudo apt-get install ant
Manual Steps
wget http://www-eu.apache.org/dist//ant/binaries/apache-ant-1.10.5-bin.zip
unzip apache-ant-1.10.5-bin.zip -d /usr/local/
cd /usr/local/
mv apache-ant-1.10.5 apache-ant
ln -s /usr/local/apache-ant/ /usr/local/ant
vim /etc/profile.d/ant.sh
export ANT_HOME=/usr/local/ant
export PATH=${ANT_HOME}/bin:${PATH}
source /etc/profile
ant –version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

Type ant -version in the terminal(Ctrl+Alt+T)

Related

Installed packages in docker image not found in path?

My Dockerfile for custom image with Gradle and Node installed:
FROM ubuntu:jammy
LABEL key=DevOps
SHELL ["/bin/bash", "--login", "-i", "-c"]
RUN apt update && apt upgrade -y && apt install curl -y
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
RUN source /root/.bashrc && nvm install 12.14.1
RUN nvm install 12.20.0
RUN apt install zip unzip
RUN curl -s "https://get.sdkman.io" | bash
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"
RUN sdk install java 8.0.302-open
RUN sdk install gradle 3.4.1
SHELL ["/bin/bash", "--login", "-c"]
CMD [ "bin/bash" ]
After I run it, it says that npm is not found in $PATH, I tried Java, Gradle as well but they weren't found in the path as well.
I don't know why since I installed them as you can tell from the Dockerfile.
How can I preinstall these dependencies so that I can address them during the build process of my app?

Failed to run Apache Singa after installation

Followed the instruction and installed Apache Singa v1.0.0 from the wheel successfully, but failed to run it below,
(singa) $ pip list | grep singa
singa (1.0.0)
(singa) $ python
> import singa
> ImportError: No module named '_singa_wrap'
(singa) $ find -name "*singa_wrap*"
singa_wrap.py
singa_wrap.pyc
_singa_wrap.so
Seemed something suspicious with Swig module extension. Any suggestions?
#EDIT
Verified that protobuf 2.6.1 already installed globally below,
(singa) $ python -c "from singa import _singa_wrap"
undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv
$ ldd _singa_wrap.so
libprotobuf.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
$ dpkg -S libprotobuf.so.9
libprotobuf9v5
$ apt-cache policy libprotobuf9v5
Installed: 2.6.1-1.3
#Solution
Singa starts dancing now after protobuf 2.6.1 being successfully installed locally on Ubuntu 16.04 below,
$ sudo apt-get install python-pip # gcc-5 required thus installed
$ sudo apt-get install gcc-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
$ sudo update-alternatives --config gcc # to choose gcc-4.8
The rest then follows the answer #Wei below. Thanks again.
I think you can try the approaches in the first FAQ http://singa.apache.org/en/docs/installation.html#faq
In addition, you can check the dependent libs of _singa_wrap.so (go to /Python2.7/site-packages/singa/, and ldd _singa_wrap.so. If any library (e.g. cudnn or protobuf) is not found, then try to install it or export the library path.
There is a ticket for your issue https://issues.apache.org/jira/browse/SINGA-255.
Will update you once it is done.
Thanks.
UPDATE:
It seems your error is related to protobuf (could be caused by multiple versions of protobuf on your computer). Here is the solution,
Download protobuf (protobuf-2.6.1.tar.gz on github) and decompress the tar file
Install protobuf into /home//local/ by
./configure --prefix=/home/<yourname>/local
make && make install
echo "export LD_LIBRARY_PATH=/home/<yourname>/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
pip uninstall singa
pip install <path to the wheel file>

Unable to install erlang on cent os

While installing erlang on cent os I got the following error
Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64 (erlang-solutions)
Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64 (erlang-solutions)
Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I searched around on google and found that the probelm can be solved by installing openssl-devl. So I did that and tried installing erlang again but got the same error.
How can I install the latest version of erlang on cent os 6.4?
How you are installing it? According to Riak's documentation, you use:
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
And then, you build Erlang:
wget http://erlang.org/download/otp_src_R15B01.tar.gz
tar zxvf otp_src_R15B01.tar.gz
cd otp_src_R15B01
./configure && make && sudo make install
Installing Erlang on GNU/Linux
You can install erlang using erlang-solution repo
Install repo
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
Install erlang
sudo yum install erlang
This worked for me on centos7...
sudo yum install epel-release
sudo yum update
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum install erlang
Using EPEL from Fedora is a surefire way on Centos 6. I currently have erlang-crypto-R14B-04.3.el6.x86_64 installed. If you have different repos enabled it could be a conflict or that there is an issue with the package from the other repo (I would recommend disabling whatever repo that provides it or at least ignoring erlang from that repo).
Here is a simple way to install EPEL on Centos
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum -y install erlang-*
your error is
"Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64"
so you can download&install R16B03
wget http://erlang.org/download/otp_src_R16B03.tar.gz
tar -zxvf src_R16B03.tar.gz
cd src_R16B03.tar.gz
yum localinstall erlang
To install erlang in centos offline.Follow below steps,
We need to have one internet connected machine to download rpm's.
yum install yum-plugin-downloadonly -y
yum install --downloadonly --downloaddir=/home/user/ erlang
All of erlang dependencies packages downloaded as rpm on /home/user/ directory
Now copy all rpm's to offline machine in any directory ( eg., /home/user/ )
Type following command to install erlang with its dependencies too.,
cd /home/user/
rpm -Uvh *.rpm
It's Done!
check using command,
erl
(press Ctrl+c twice to get exit from erl command )

wicked_pdf does not run on Ubuntu server : wkhtmltopdf: cannot connect to X server

I'm trying to use wicked_pdf on my prod server but it keeps failling :
RuntimeError (Failed to execute:
"/usr/bin/wkhtmltopdf" -q "file:////tmp/wicked_pdf20130709-23109-1adqx5g.html" "/tmp/wicked_pdf_generated_file20130709-23109-1ic5dbe.pdf"
Error: PDF could not be generated!
Command Error: wkhtmltopdf: cannot connect to X server
):
app/controllers/contrats_controller.rb:15:in `block (2 levels) in show'
app/controllers/contrats_controller.rb:11:in `show'
I tried to follow this answer : wkhtmltopdf: cannot connect to X server but it still does not work.
This post helped me to resolve my problem :
http://www.stormconsultancy.co.uk/blog/development/generating-pdfs-in-rails-with-pdfkit-and-deploying-to-a-server/
I'm reproducing here the step from this post that helped me to install it :
# first, installing dependencies
sudo aptitude install openssl build-essential xorg libssl-dev
# for 64bits OS
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
mv wkhtmltopdf-amd64 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf
He also create an initializer to tell to pdfKit where it is, so this method is for wicked PDF and PDF Kit.
Resolved this problem in this tread https://stackoverflow.com/a/34947479/5320149
I found method to resolve this problem without fake X server.
In newest version of wkhtmltopdf dont need X server for work, but it no into official linux repositories.
Solution for Ubuntu 14.04.4 LTS (trusty) i386
$ sudo apt-get install xfonts-75dpi
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-i386.deb
$ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-i386.deb
$ wkhtmltopdf http://www.google.com test.pdf
Solution for Ubuntu 14.04.4 LTS (trusty) amd64
$ sudo apt-get install xfonts-75dpi
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
$ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
$ wkhtmltopdf http://www.google.com test.pdf
Verify you have xvfb installed, or install it using apt-get
install xvfb.
Create a file called wkhtmltopdf.sh and add the following:
xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf $*
Change the dimensions (640x480x16) to match whatever virtual screen parameters you want it to emulate.
Move the shell script to /usr/bin, and set permissions:
sudo chmod a+x /usr/bin/wkhtmltopdf.sh
Optionally, you can add a symbolic link in your project directory:
ln -s /usr/bin/wkhtmltopdf.sh wkhtmltopdf
See this and this for reference.

How to configure yaws webserver in the linux terminal?

can someone help me on to write my yaws webserver configuration file in the Linux terminal. when i follow the yaws tutorials i get errors. thanks a lot.
This is how I installed Yaws 1.89 on Ubuntu Server 10.10.
1. Update your Ubuntu system
sudo apt-get update
sudo apt-get upgrade
2. Install the tools you need to compile
sudo apt-get install gcc
sudo apt-get install libpam0g-dev
3. Download, compile and install Yaws 1.89
wget http://yaws.hyber.org/download/yaws-1.89.tar.gz
tar xfz yaws-1.89.tar.gz
cd yaws
./configure && make
sudo make install

Resources