Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I tried to install GOCR on Ubuntu Linux 11.10 I got the following readout in the terminal

??????????:~$ cd gocr-0.48; make install
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for library containing pnm_readpnminit... no
 * * * try option --with-netpbm=PATH
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for an ANSI C-conforming const... yes
checking for function prototypes... yes
checking whether setvbuf arguments are reversed... no
checking for wcschr... yes
checking for wcsdup... yes
checking for gettimeofday... yes
checking for popen... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating man/Makefile
config.status: creating include/config.h
make -C src install
make[1]: Entering directory `/home/drew/gocr-0.48/src'
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o pgm2asc.o pgm2asc.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o box.o box.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o database.o database.c
database.c: In function ‘ocr_db’:
database.c:411:10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o detect.o detect.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o barcode.o barcode.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o lines.o lines.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o list.o list.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o ocr0.o ocr0.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o ocr0n.o ocr0n.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o ocr1.o ocr1.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o otsu.o otsu.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o output.o output.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o pixel.o pixel.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o unicode.o unicode.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o remove.o remove.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o pnm.o pnm.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o pcx.o pcx.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o progress.o progress.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o job.o job.c
gcc -g -O2  -I../include -DHAVE_CONFIG_H -c -o gocr.o gocr.c
# make it conform to ld --as-needed
#gcc -o gocr -lm  gocr.o ./libPgm2asc.a 
gcc -o gocr -lm  gocr.o pgm2asc.o box.o database.o detect.o barcode.o lines.o list.o ocr0.o ocr0n.o ocr1.o otsu.o output.o pixel.o unicode.o remove.o pnm.o pcx.o progress.o job.o 
if test -r gocr; then cp gocr ../bin; fi
#/usr/bin/install -c -d /usr/local/bin /usr/local /usr/local
/usr/bin/install -c -d /usr/local/bin
/usr/bin/install -c ../bin/gocr /usr/local/bin
/usr/bin/install: cannot create regular file `/usr/local/bin/gocr': Permission denied
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/drew/gocr-0.48/src'
make: *** [install] Error 2

Can anyone help me in correcting this. I had it working in 10.04 Thanks Drew

share|improve this question
You should know that you need to take care of permission when trying to make install, although it seems you run make install before doing ./configure, which is bad. And please don't just paste your log here, as it makes little sense. Better use some online storage as pastebin.com and provide just link here –  zetah Feb 28 '12 at 11:08
Thank you for your comment. I still have a lot to learn. Will try what you suggest –  Lofty Feb 28 '12 at 20:32

2 Answers 2

In 12.04, you can install GOCR from packages (sudo apt-get install gocr or from software center). The prepared sources are also available:

apt-get source gocr
cd gocr-0.49
dpkg-buildpackage -rfakeroot
cd ..
sudo dpkg -i gocr_0.49-1_*.deb

(If you don't have dpkg-buildpackage you can install it: sudo apt-get install build-essential)

If you need to build from non-Ubuntu source, typically it is easier and safer to install software in your home directory and set up paths correctly, like:

cd gocr-0.49
./configure --prefix=${HOME}
make all install
export PATH=${PATH}:${HOME}/bin

Other software may require setting up LD_LIBRARY_PATH, PYTHONPATH, and so on.

share|improve this answer
cannot create regular file `/usr/local/bin/gocr': Permission denied

means that it does not have permissions to create(or write) file. /usr/local/bin/ is owned by root any standard user(or desktop user) without having rights can not create files there.

Try with sudo.

first run ./configure then sudo make install.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.