Error when compiling PostgreSQL on Debian - linux

I'm compiling and installing postgresql on debian, but have some error:
In file included from pg_dump.c:60:0:
pg_backup_archiver.h:44:18: fatal error: zlib.h: No such file or directory
#include <zlib.h>
^
so I want to install zlib1g-dev , however, It reports :
The following NEW packages will be installed:
zlib1g-dev{b}
0 packages upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
Need to get 192 kB of archives. After unpacking 446 kB will be used.
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3) but 1:1.2.8.dfsg-1 is installed.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) zlib1g-dev [Not Installed]
Accept this solution? [Y/n/q/?] y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
what should I do? thanks.

since postgresql is already part of debian, why not just use the pre-packaged binary?
if this doesn't fit the bill (for whatever reasons), you can still benefit from the debian packaging effort by installing everything needed to build the debian packages (even if you want to build a psql package that is newer than the one in Debian or has other features, the build will be somehow similar):
# apt-get build-dep postgresql-9.3
and in any case you should make sure that your apt-database is uptodate, so you probably need to run
# apt-get update
before any other step.

Related

Unable to install python3-tk on Ubuntu 18.04.2 LTS

I am running Ubuntu 18.04.2 LTS:
user#vmubu01:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
And I am unable to install python3-tk using 'apt-get install' command as you can see below:
user#vmubu01:~$ sudo apt-get install python3-tk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
tix python3-tk-dbg
The following NEW packages will be installed:
python3-tk
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
3 not fully installed or removed.
Need to get 0 B/101 kB of archives.
After this operation, 891 kB of additional disk space will be used.
(Reading database ... 206924 files and directories currently installed.)
Preparing to unpack .../python3-tk_3.6.8-1~18.04_amd64.deb ...
Unpacking python3-tk:amd64 (3.6.8-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.6/tkinter/__init__.py', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am also unable to install it using pip, see the error below:
user#vmubu01:~$ pip3.6 install python3-tk
Collecting python3-tk
ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
If I try to run the 'apt --fix-broken install' command I get:
user#vmubu01:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
python3-tk
Suggested packages:
tix python3-tk-dbg
The following NEW packages will be installed:
python3-tk
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
3 not fully installed or removed.
Need to get 0 B/101 kB of archives.
After this operation, 891 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 206924 files and directories currently installed.)
Preparing to unpack .../python3-tk_3.6.8-1~18.04_amd64.deb ...
Unpacking python3-tk:amd64 (3.6.8-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.6/tkinter/__init__.py', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
Errors were encountered while processing:
/var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I please advise
Not sure this solution fits for every situation, but here is one that worked for me.
I had the same issue (except it was with Ubuntu 16.04), also tried what #Column01 wrote in comments:
sudo apt-get install python3.6-tk
Same problem.
But that gave me an idea. Checked:
$ python --version
Python 3.5.2
So the solution was as simple as:
sudo apt-get install python3.5-tk

Linux - Qmake Compiling Error - 'vorbisfile not found' although installed

I try to compile Goldendict on Debian. I have installed all the necessary dependencies, including libvorbis-dev, as listed in the 'README.md' file. However, I'm immediately running into the following error message when executing qmake or qmake-qt4.
JohnDoe#debian:~/goldendict$ qmake
Project MESSAGE: Install Prefix is: /usr/local
sh: 1: pkg-config: not found
Project ERROR: Package vorbisfile not found
JohnDoe#debian:~/goldendict$
I have tried to install it without the audio player support, but it's not working either.
JohnDoe#debian:~/goldendict$ sudo qmake "DISABLE_INTERNAL_PLAYER=1"
Project MESSAGE: Install Prefix is: /usr/local
sh: 1: pkg-config: not found
Project ERROR: Package vorbisfile not found
JohnDoe#debian:~/goldendict$
I have Qt version 4.8.6 installed.
Here are the instructions on 'how-to install Goldendict', which I have followed: https://github.com/goldendict/goldendict/blob/master/README.md
How can I get this work? Any help is welcome.
PS: Here's the proof that the vorbis package is installed.
PROOF from dpkg:
JohnDoe#debian:~$ dpkg -s libvorbis-dev
Package: libvorbis-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 1715
Maintainer: Debian Xiph.org Maintainers <pkg-xiph-maint#lists.alioth.debian.org>
Architecture: amd64
Multi-Arch: same
Source: libvorbis
Version: 1.3.4-2
Depends: libogg-dev, libvorbis0a (= 1.3.4-2), libvorbisenc2 (= 1.3.4-2), libvorbisfile3 (= 1.3.4-2)
PROOF from apt-get:
JohnDoe#debian:~/goldendict$ sudo apt-get install libvorbis-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libvorbis-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
JohnDoe#debian:~/goldendict$
Not on Debian, but on Mac it was a problem. The workaround is, you can change your .pro file for Qt projects, so that it does not look for pkg-config, by adding the following line:
QT_CONFIG -= no-pkg-config
Another guess would be that your path is not set properly. I would try adding the pkg-config path to the environment variable:
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/<path_to_pkg-config>/pkgconfig

sudo apt-get install libao-common

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libao-common
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
4 not fully installed or removed.
Need to get 0 B/11.3 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
dpkg: regarding .../libao-common_1.1.0-2_armhf.deb containing libao-common:
libao-common conflicts with libao2
libao2 (version 0.8.4-1) is present and unpacked but not configured.
dpkg: error processing /var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb (--unpack):
conflicting packages - not installing libao-common
Errors were encountered while processing:
/var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Why is conflicting packages not installing libao-common?
It’s on a Raspberry PI with Raspbian.
apt-get -f install doesn't work
root#raspberrypi:~# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libao-common
The following NEW packages will be installed:
libao-common
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
4 not fully installed or removed.
Need to get 11.3 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libao-common armhf 1.1.0-2 [11.3 kB]
Fetched 11.3 kB in 2s (4,117 B/s)
dpkg: regarding .../libao-common_1.1.0-2_armhf.deb containing libao-common:
libao-common conflicts with libao2
libao2 (version 0.8.4-1) is present and unpacked but not configured.
dpkg: error processing /var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb (--unpack):
conflicting packages - not installing libao-common
Errors were encountered while processing:
/var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
notice that message:
4 not fully installed or removed.
maybe you install other package failed. then the apt tool try to install them again.
so, uninstall these error package first.
sudo apt-get --force-yes remove #your-package-name#
you need to remove the 4 not fully installed or removed package first.
then
sudo apt autoremove
now, try to install the new package again.

compiling OpenGL program GL/glew.h missing

I installed OpenGL onto my computer running Linux Mint following the instructions on this tutorial. I am trying to compile a program that uses OpenGL, but I'm getting a compile error: fatal error: GL/glew.h: No such file or directory. I check the /usr/include/GL folder, and glew.h is indeed missing. I don't know why it's missing, because I did the command sudo apt-get install libglew1.5 and it gives the output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libglew1.5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 465 not upgraded.
Why is the glew.h file missing?
libglew is just the library, but not the development files (headers). You need to install those separately. The package name on Debian based systems is libglew-dev
and for fedora(and possibly its derivatives) it is glew-devel
Run the following command:
sudo apt-get install libglew-dev

Error While loading shared libraries libstdc++.so.5

I'm attempting to run a program called GlimmerHMM, however when I try to call the program I get this error:
./glimmerhmm_linux
./glimmerhmm_linux: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
So I tried downloading and installing:
sudo apt-get install libstdc++5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
html2text libmail-sendmail-perl libsys-hostname-long-perl
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed: libstdc++5
0 upgraded, 1 newly installed, 0 to remove and 183 not upgraded.
Need to get 255 kB of archives.
After this operation, 1,155 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ precise/universe libstdc++5 amd64 1:3.3.6-25ubuntu1 [255 kB]
Fetched 255 kB in 4s (54.0 kB/s)
Selecting previously unselected package libstdc++5.
(Reading database ... 176303 files and directories currently installed.)
Unpacking libstdc++5 (from .../libstdc++5_1%3a3.3.6-25ubuntu1_amd64.deb) ...
Setting up libstdc++5 (1:3.3.6-25ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
But I still get the same error when calling the program. Thanks in advance!
Chances are that, if you're running a program old enough to need libstdc++ v5, it's also a 32-bit application, so it can't use the (64-bit) libstdc++5 you installed. Install the ia32-libs package.
I was trying to get one legacy application working and noticed that with Ubuntu 20.04 one needs to add i386 architecture, before one can install i386 libraries.
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libstdc++5:i386
# libstdc++.so.5 shows up.
ls -la /usr/lib/i386-linux-gnu/libstdc++.so.5
lrwxrwxrwx 1 root root 18 Apr 11 2020 /usr/lib/i386-linux-gnu/libstdc++.so.5 -> libstdc++.so.5.0.7

Resources