How should I install cups-pdf from source? - cups

On Ubuntu 12.10, I want to install cups-pdf. Using apt-get install cups-pdf works okay, but I want to install it in code source.
This is what I've tried:
Download code from http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/
Build cups-pdf:
gcc -o cups-pdf `cups-config --cflags` cups-pdf.c `cups-config --libs`
Run the following:
cp cups-pdf /usr/lib/cups/backend/
cp ../extra/cups-pdf.conf /etc/cups
cp ../extra/CUPS-PDF_opt.ppd /usr/share/cups/model/CUPS-PDF_opt.ppd
lpadmin -p PDFprinter -E -v cups-pdf:/ -P /usr/share/cups/model/CUPS-PDF_opt.ppd
lpadmin -d PDFprinter
Try to print a file to PDF:
lp Hello.c
Nothing happened

i fond answer How_to_install_CUPS-PDF_OpenSolarisx86.pdf.
The point is :
chmod 0700 /usr/lib/cups/backend/cups-pdf

Related

how to install cudnn5.1 with cuda 8.0 support for tensorflow?

I am unable to find the cudnn-8.0-linux-x64-v5.1.tgz file. The download link has only .deb file and when I install it using
sudo dpkg -i /path/to/deb/file
I get libcudnn.so.5.1.5 file and not the headers (cudnn.h). Where can I get the .tgz file with all the .so and .h files? I am looking for libcudnn.so.5.1
You can download cuDNN from here, you need to have an NVIDIA developer account which is free of cost. After downloading it, extract the contents and copy the files to appropriate locations:
$ sudo cp -P include/cudnn.h /usr/include
$ sudo cp -P lib64/libcudnn* /usr/lib/x86_64-linux-gnu/
$ sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*

how install OCR tesseract on opencv 3.1.0 on linux ubuntu 14.10?

I would like install correctly Opencv_contrib for Text_recognition. Have you a idea to the good process?
Before I install Opencv 3.1.0 and opencv_contrib, I install leptonia-1.73, protobuf, caffe, and after Tesseract. After I start to install Opencv 3.1.0 and opencv_contrib.
But I don't use Texte module
Process:
1. Install leptonia :
$ sudo apt-get install autoconf automake libtool
$ sudo apt-get install libpng12-dev
$ sudo apt-get install libjpeg62-dev
$ sudo apt-get install libtiff4-dev
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install libicu-dev
$ sudo apt-get install libpango1.0-dev
$ sudo apt-get install libcairo2-dev
$ wget http://www.leptonica.org/source/leptonica-1.73.tar.gz
$ tar -zxvf leptonica-1.73.tar.gz
$ cd leptonica-1.73
$ ./autogen.sh
$ ./configure
$ make
$ sudo checkinstall
$ sudo ldconfig
2. Install protobuf
like "https:"//launchpad."net/ubuntu/trusty/"+package/protobuf-compiler"
3. Install Caffe
like "http:"//caffe."berkeleyvision."org"/install_apt"."html
4. Install Opencv 3.1.0 with Opencv_extra_module_path
$ cd ~/opencv
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
Warning message:
Warning message is : joboxlearning#joboxlearning-VirtualBox:~/OpenCV/workspace/text_recognition$ ./Text_recognition 2856985-origpic-28a761.jpg
./Text_recognition
Demo program of the Extremal Region Filter algorithm described in
Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012
init done
opengl support available
OpenCV Error: Bad argument (Default classifier file not found!) in ERClassifierNM1, file /home/joboxlearning/OpenCV/opencv_contrib/modules/text/src/erfilter.cpp, line 1035
terminate called after throwing an instance of 'cv::Exception'
what(): /home/joboxlearning/OpenCV/opencv_contrib/modules/text/src/erfilter.cpp:1035: error: (-5) Default classifier file not found! in function ERClassifierNM1
Abandon (core dumped)
Check this Dockerfile (https://gist.github.com/joost/52d59321abe31884ab818b806c69426b) it shows all steps to install OpenCV 3.1 with Tesseract and Python bindings. You should be able to use all features like OCR and ERFilter.
To test them open python:
>>> import cv2
>>> cv2.__version__
'3.1.0'
>>> cv2.text # should return the module

Cannot build bitcoin

Get sauce from github, read instructions in doc/build-unix.txt. But make can not into compile!
[urs1412#noname bitcoin]$ cd src
[urs1412#noname src]$ make -f makefile.unix
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security \
-Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE \
-D_FILE_OFFSET_BITS=64 -I/home/urs1412/w/bitcoin/src \
-I/home/urs1412/w/bitcoin/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 \
-I/home/urs1412/w/bitcoin/src/leveldb/include \
-I/home/urs1412/w/bitcoin/src/leveldb/helpers \
-DHAVE_BUILD_INFO -fno-stack-protector \
-fstack-protector-all -Wstack-protector \
-D_FORTIFY_SOURCE=2 -MMD -MF obj/alert.d \
-o obj/alert.o alert.cpp \
alert.cpp:6:53: fatal error: boost/algorithm/string/classification.hpp:
No such file or directory
compilation terminated.
make: *** [obj/alert.o] Error 1
td;dr could not build bitcoin, dumping system info
[urs1412#noname src]$ uname -r
3.6.10-4.fc18.x86_64
[urs1412#noname src]$ git log -n 1
commit 77a1e12eed5fc66dce16584696f54988a8c2bf4e
Merge: fe15aa3 0565b71
Author: Gavin Andresen
Date: Wed Apr 24 08:48:06 2013 -0700
Merge pull request #2554 from fanquake/qt-pro-brew-patch
bitcoin-qt.pro Brew patch
I finally was able to build bitcoin-1.8 (not the git sources, although I believe these same steps will be applicable) on my CentOS VPS.
Here are the packages I had to install. Note that I had to build some of these.
As root:
yum install gcc-c++ make
install boost-devel
yum install db4-devel
yum install openssl-devel # but this didn't provide ec.h, hence the next steps
yum install rpm-build
rpm -U ~jcomeau/rpmbuild/RPMS/x86_64/openssl-devel-1.0.0e-1.x86_64.rpm
yum install lynx # for downloading some source packages
yum install python-devel # for building miniupnpc
rpm -i ~jcomeau/rpmbuild/RPMS/x86_64/libminiupnpc9-1.8.20130503-0.1.x86_64.rpm
rpm -i ~jcomeau/rpmbuild/RPMS/x86_64/libminiupnpc-devel-1.8.20130503-0.1.x86_64.rpm
Then as user, make BOOST_LIB_SUFFIX=-mt all test
If you need instructions on building the openssl-devel (the spec file was in the sources and mostly functional) and libminiupnpc-devel (I got the spec file from an OpenSUSE source RPM and adapted it) let me know.
I believe your immediate problem is you didn't install openssl-devel. But you will likely run into these other problems after that, if you don't do some of the steps I did.
Make sure that boost library for gcc is working correctly. Try a test "hello world" program with boost. You can find it in the directory: BOOST_BUILD_PATH/example/hello
Compile it with BOOST_BUILD_PATH/bin/b2 toolset=gcc
If it doesnt work then boost is not correctly installed.

cmake doesn't work when install mysql

good afternoon,I'm trying to install mysql-5.5.29 source code on ubuntu.
but cmake just shows:Configuring incomplete, errors occurred!
with out any other tips.
shell> groupadd mysql
shell> useradd -r -g mysql mysql
mkdir -p /var/lib/mysql
apt-get install bison-dev
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> cmake . -CMAKE_INSTALL_PREFIX="/usr/local/mysql" \
-MYSQL_UNIX_ADDR=/var/lib/mysql
........
Configuring incomplete, errors occurred!
I found it works when I just type
cmake .
but when I using
cmake . -CMAKE_INSTALL_PREFIX="/usr/local/mysql" \
-MYSQL_UNIX_ADDR=/var/lib/mysql
errors occurred
shell>bison --version
bison (GNU Bison) 2.5
It looks like you're just missing the D from your command line args:
cmake . -DCMAKE_INSTALL_PREFIX="/usr/local/mysql" -DMYSQL_UNIX_ADDR=/var/lib/mysql

How to download all dependencies and packages to directory

I'm trying to install a package on a machine with no Internet connection. What I want to do is download all the packages and dependences on a machine WITH an Internet connection and then sneaker-net everything to the offline computer.
I've been playing with the apt-get and apt-cache but I haven't figured out a quick and easy way to download the package and dependencies in one swoop to a directory of my choosing. How would I do this? Am I going about this problem correctly?
How would you install offline packages that have a lot of dependencies?
The marked answer has the problem that the available packages on the machine that is doing the downloads might be different from the target machine, and thus the package set might be incomplete.
To avoid this and get all dependencies, use the following:
apt-get download $(apt-rdepends <package>|grep -v "^ ")
Some packages returned from apt-rdepends don't exist with the exact name for apt-get download to download (for example, libc-dev). In those cases, filter out those exact names (be sure to use ^<NAME>$ so that other related names, for example libc-dev-bin, that do exist are not skipped).
apt-get download $(apt-rdepends <package>|grep -v "^ " |grep -v "^libc-dev$")
Once downloaded, you can move the .deb files to a machine without Internet and install them:
sudo dpkg -i *.deb
Same question already answered here:
How to list/download the recursive dependencies of a debian package?
try:
PACKAGES="wget unzip"
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests \
--no-conflicts --no-breaks --no-replaces --no-enhances \
--no-pre-depends ${PACKAGES} | grep "^\w")
# aptitude clean
# aptitude --download-only install <your_package_here>
# cp /var/cache/apt/archives/*.deb <your_directory_here>
The aptitude --download-only ... approach only works if you have a debian distro with internet connection in your hands.
If you don't, I think it is better to run the following script on the disconnected debian machine:
apt-get --print-uris --yes install <my_package_name> | grep ^\' | cut -d\' -f2 >downloads.list
move the downloads.list file into a connected linux (or non linux) machine, and run:
wget --input-file myurilist
this downloads all your files into the current directory.After that you can copy them on an USB key and install in your disconnected debian machine.
Credits: http://www.tuxradar.com/answers/517
This will download all the Debs to the current directory, and will NOT fail if It can't find a candidate.
Also does NOT require sudo to run sript!
nano getdebs.sh && chmod +x getdebs.sh && ./getdebs.sh
#!/bin/bash
package=ssmtp
apt-cache depends "$package" | grep Depends: >> deb.list
sed -i -e 's/[<>|:]//g' deb.list
sed -i -e 's/Depends//g' deb.list
sed -i -e 's/ //g' deb.list
filename="deb.list"
while read -r line
do
name="$line"
apt-get download "$name"
done < "$filename"
apt-get download "$package"
Note: I used this as my example because I was actually trying to DL the Deps for SSMTP and it failed on debconf-2.0, but this script got me what I need!
Somewhat simplified (and what worked for me) way that worked for me (based on all the above)
Note that dependencies hierarchy can go deeper then one level
Get dependencies of your package
$ apt-cache depends mongodb | grep Depends:
Depends: mongodb-dev
Depends: mongodb-server
Get urls:
sudo apt-get --print-uris --yes -d --reinstall install mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-tools | grep "http://" | awk '{print$1}' | xargs -I'{}' echo {} | tee files.list
wget --input-file files.list
I used apt-cache depends package to get all required packages in any case if the are already installed on system or not.
So it will work always correct.
Because the command apt-cache works different, depending on language, you have to try this command on your system and adapt the command.
apt-cache depends yourpackage
On an englisch system you get:
$ apt-cache depends yourpackage
node
Depends: libax25
Depends: libc6
On an german system you get:
node
Hängt ab von: libax25
Hängt ab von: libc6
The englisch version with the term:
"Depends:"
You have to change the term "yourpackage" to your wish twice in this command, take care of this!
$ sudo apt-get --print-uris --yes -d --reinstall install yourpackage $(apt-cache depends yourpackage | grep " Depends:" | sed 's/ Depends://' | sed ':a;N;$!ba;s/\n//g') | grep ^\' | cut -d\' -f2 >downloads.list
And the german version with the term:
"Hängt ab von:"
You have to change the term "yourpackage" to your wish twice in this command, take care of this!
This text is used twice in this command, if you want to adapt it to your language take care of this!
$ sudo apt-get --print-uris --yes -d --reinstall install yourpackage $(apt-cache depends yourpackage | grep "Hängt ab von:" | sed 's/ Hängt ab von://' | sed ':a;N;$!ba;s/\n//g') | grep ^\' | cut -d\' -f2 >downloads.list
You get the list of links in downloads.list
Check the list, go to your folder and run the list:
$ cd yourpathToYourFolder
$ wget --input-file downloads.list
All your required packages are in:
$ ls yourpathToYourFolder
This will download all packages and dependencies (no already installed) to a directory of your choice:
sudo apt-get install -d -o Dir::Cache=/path-to/directory/apt/cache -o Dir::State::Lists=/path-to/directory/apt/lists packages
Make sure /path-to/directory/apt/cache and /path-to/directory/apt/lists exist.
If you don't set -o Dir::Cache it points to /var/cache/apt,
Dir::State::Lists points to /var/lib/apt/lists (which keeps the index files of available packages)
Both -o options can be used with update and upgrade instead of install.
On different machine run the same command without '-d'
I'm assuming you've got a nice fat USB HD and a good connection to the net. You can use apt-mirror to essentially create your own debian mirror.
http://apt-mirror.sourceforge.net/
On modern Ubuntu systems (for example, 22.04):
apt clean
apt update
apt install --download-only freeipa-client
After you can find deb-files in
ls -l /var/cache/apt/archives/
IF you accept the caveat that there may be dependencies already installed on your system, then the easiest way is to go apt-get install --simulate <your_package>, this will first list all the deps it will install, then copy the list of packages, then apt-get download <the_list_of_packages>
e.g. for qt5-gtk2-platformtheme on a xubuntu-21.04 MINIMAL INSTALL you'll get (after apt-get install --simulate) the following:
libdouble-conversion3 libmd4c0 libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxkbcommon-x11-0 qt5-gtk-platformtheme qttranslations5-l10n
then you just cd in a folder of your choice, do apt-get download <the_list_above>, and you have them all d/w in there. you can then dpkg -i *.deb
Complementing and automating the exclusion of ALL conflictive dependencies (dependencies not found) by the command given by #onno:
apt-get download $(apt-rdepends <package>|grep -v "^ " |grep -v "^conflictiv-dependency$")
At least for Ubuntu, where the Error Message format is as follows:
E: Can't select candidate version from package <package> as it has no candidate
The following script Downloads all Found Dependencies, Excluding not Found ones:
#!/bin/bash
rm -f error.txt
apt download $(apt-rdepends $1 | grep -v "^ ") 2> error.txt
#IF THERE WAS ERRORS (DEPENDENCIES NOT FOUND)
if [ $(cat error.txt | wc -l) -gt 0 ]
then
partial_command="\("
while read -r line
do
conflictive_package="$(awk '{split($0,array," "); print array[8]}' <<< $line)"
partial_command="$partial_command$conflictive_package\|"
done < error.txt
partial_command="$(awk '{print substr($0, 1, length($0)-2)}' <<< $partial_command)\)"
eval "apt download \$(apt-rdepends $1 | grep -v '^ ' | grep -v '^$partial_command$')"
fi
rm error.txt
It works with me
sudo apt-get reinstall --download-only <your software>
for example
sudo apt-get reinstall --download-only ubuntu-restricted-extras
For accessing installed .deb files, you can look in this path:
/var/cache/apt/archives