Mosquitto installation errors

If none of the more specific forums is the right place to ask

Mosquitto installation errors

Postby MrGlasspoole » 2012-12-22 21:44

Hi,

I'm not really a commandline Linux guy.
Most of the time i figure it out cause there is something in the web.
But Mosquitto is something where you don't find much - so i need help installing it.
I followed exactly this: http://mosquitto.org/2012/11/making-mos ... -yourself/
And i have this errors:
Code: Select all
dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor):
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor):
dpkg-buildpackage: source package mosquitto
dpkg-buildpackage: source version 1.0.5-1
dpkg-buildpackage: source changed by Roger A. Light <roger@atchoo.org>
 dpkg-source --before-build mosquitto-1.0.5
dpkg-buildpackage: host architecture amd64
dpkg-source: warning: patches have not been applied, applying them now (use --no-preparation to override)
dpkg-source: info: applying enable-libwrap.patch
dpkg-source: info: applying fix-prefix.patch
dpkg-source: info: applying nostrip.patch
dpkg-source: info: applying pynomake.patch
dpkg-source: info: applying mosquitto.conf.patch
dpkg-checkbuilddeps: Unmet build dependencies: libssl-dev (>= 1.0.0) python3
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1325:
dpkg-buildpackage -rfakeroot -D -us -uc failed
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby verahill » 2012-12-22 21:55

The answer is right here:
dpkg-checkbuilddeps: Unmet build dependencies: libssl-dev (>= 1.0.0) python3


Since the instructions at http://mosquitto.org/2012/11/making-mos ... n-yourself tell you to run
sudo apt-get install build-essential python quilt libwrap0-dev libssl-dev devscripts python-setuptools

which should install at least libssl-dev, I am guessing that you're running Squeeze/Stable which has libssl-dev 0.9.8o (http://packages.debian.org/squeeze/libssl-dev)

You will need to install/compile libssl-dev >1.0.0 for yourself and I think you're being asked for python3 since Squeeze has v2.6.6 and 2.7 or better is preferred (so python 2.7 should be ok and pyton 3 not necessary).
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia

Re: Mosquitto installation errors

Postby MrGlasspoole » 2012-12-22 22:59

Thank you. I figured out the python3 but after an hour still no libssl-dev.

I really love my Windows. One click and after 30 seconds every program runs.
In Linux i always have to search for this and that lib just for one program.
And i will never understand where all the stuff is saved.

So now i did install python3. Does that mean 2 was automatically updated?
Why this how to just says: apt-get install build-essential python quilt libwrap0-dev libssl-dev devscripts python-setuptools
if that does not install what it needs to run :cry:

Edit:
Hour's later i have libssl-dev but still:
Code: Select all
dpkg-checkbuilddeps: Unmet build dependencies: python3
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1325:
dpkg-buildpackage -rfakeroot -D -us -uc failed
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby verahill » 2012-12-23 05:22

You can't compare installing a prebuilt binary on Windows with compiling source code on Linux.

Anyway, what version of Debian are you using? Stable? Testing? Sid?

Let me know and I'll see if I can reproduce your situation. Alternatively, contact the developer whom seems to be quite responsive.
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia

Re: Mosquitto installation errors

Postby MrGlasspoole » 2012-12-23 06:10

I downloaded installed the latest Squeeze/Stable yesterday.
To get the libssl-dev i used testing - but only for this lib.
Python-3.3.0 and before Python i did:
Code: Select all
aptitude install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev


Yes i already wrote a comment there on the Mosquitto site.
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby stevepusser » 2012-12-23 06:25

python3 is a standard Squeeze package:

Code: Select all
steve@hplaptop:~$ apt-cache policy python3
python3:
  Installed: (none)
  Candidate: 3.1.3-12+squeeze1
  Version table:
     3.1.3-12+squeeze1 0
        801 ftp://ftp.us.debian.org/debian/ squeeze/main amd64 Packages

You appear to have installed upstream python3 for no good reason...
Installing that and libssl-dev from testing is likely to bite you from behind sooner or later. Mixing stable and upstream is highly dangerous if you are not an expert. Backporting the newer versions against the stable tools is the safest method.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8938
Joined: 2009-10-06 05:53

Re: Mosquitto installation errors

Postby verahill » 2012-12-23 07:25

What Steve Pusser writes is obviously correct. In this case you do need libssl-dev >= 1.0.0 so installing it via apt-pinning from testing is by far the easiest solution -- at the risk of something unfortunate /maybe/ happening down the line. Personally I've never had issues, but I don't doubt that there aren't people who have.

Anyway. I set up a chrooted stable and followed the instructions exactly at http://mosquitto.org/2012/11/making-mosquitto-packages-for-debian-yourself/.

The only differences were
* I installed python3 using
Code: Select all
sudo apt-get install python3

* I set up apt pinning with p=800 for testing and p=990 for stable (see e.g. http://verahill.blogspot.com.au/2011/12 ... ample.html)
* I then did
Code: Select all
sudo apt-get install libssl-dev=1.0.1c-4


After that I launched the build with
Code: Select all
debuild -us -uc

to build without signing and it built without errors:
Code: Select all
dpkg-deb: building package `mosquitto' in `../mosquitto_1.0.5-1_amd64.deb'.
dpkg-deb: building package `libmosquitto1' in `../libmosquitto1_1.0.5-1_amd64.deb'.
dpkg-deb: building package `libmosquitto1-dev' in `../libmosquitto1-dev_1.0.5-1_all.deb'.
dpkg-deb: building package `libmosquittopp1' in `../libmosquittopp1_1.0.5-1_amd64.deb'.
dpkg-deb: building package `libmosquittopp1-dev' in `../libmosquittopp1-dev_1.0.5-1_all.deb'.
dpkg-deb: building package `mosquitto-clients' in `../mosquitto-clients_1.0.5-1_amd64.deb'.
dpkg-deb: building package `python-mosquitto' in `../python-mosquitto_1.0.5-1_all.deb'.
dpkg-deb: building package `python3-mosquitto' in `../python3-mosquitto_1.0.5-1_all.deb'.
dpkg-deb: building package `mosquitto-dbg' in `../mosquitto-dbg_1.0.5-1_amd64.deb'.
 dpkg-genchanges  >../mosquitto_1.0.5-1_amd64.changes
dpkg-genchanges: including full source code in upload
 dpkg-source --after-build mosquitto-1.0.5
dpkg-buildpackage: full upload (original source is included)
Now running lintian...
W: mosquitto source: newer-standards-version 3.9.3 (current is 3.9.1)
W: python-mosquitto: old-versioned-python-dependency depends: python (<< 2.7)
N: 3 tags overridden (3 warnings)
Finished running lintian.

and
Code: Select all
sandbox@niobium:~/tmp/mosquitto-1.0.5$ ls ../ -l
total 1112
-rw-r--r--  1 sandbox sandbox  27498 Dec 23 07:44 libmosquitto1-dev_1.0.5-1_all.deb
-rw-r--r--  1 sandbox sandbox  35090 Dec 23 07:44 libmosquitto1_1.0.5-1_amd64.deb
-rw-r--r--  1 sandbox sandbox  15536 Dec 23 07:44 libmosquittopp1-dev_1.0.5-1_all.deb
-rw-r--r--  1 sandbox sandbox  20166 Dec 23 07:44 libmosquittopp1_1.0.5-1_amd64.deb
drwxr-xr-x 15 sandbox sandbox   4096 Dec 23 07:44 mosquitto-1.0.5
-rw-r--r--  1 sandbox sandbox  34700 Dec 23 07:44 mosquitto-clients_1.0.5-1_amd64.deb
-rw-r--r--  1 sandbox sandbox 469464 Dec 23 07:44 mosquitto-dbg_1.0.5-1_amd64.deb
-rw-r--r--  1 sandbox sandbox   8299 Dec 23 07:40 mosquitto_1.0.5-1.debian.tar.gz
-rw-r--r--  1 sandbox sandbox   1119 Dec 23 07:40 mosquitto_1.0.5-1.dsc
-rw-r--r--  1 sandbox sandbox  39855 Dec 23 07:44 mosquitto_1.0.5-1_amd64.build
-rw-r--r--  1 sandbox sandbox   4681 Dec 23 07:44 mosquitto_1.0.5-1_amd64.changes
-rw-r--r--  1 sandbox sandbox 101582 Dec 23 07:44 mosquitto_1.0.5-1_amd64.deb
-rw-r--r--  1 sandbox sandbox 291884 Nov  3 12:12 mosquitto_1.0.5.orig.tar.gz
-rw-r--r--  1 sandbox sandbox  30176 Dec 23 07:44 python-mosquitto_1.0.5-1_all.deb
-rw-r--r--  1 sandbox sandbox  28566 Dec 23 07:44 python3-mosquitto_1.0.5-1_all.deb

Not sure what you're doing differently and which is causing problems.

All I can offer is that I advise you to double check to make sure you install python3 properly.
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia

Re: Mosquitto installation errors

Postby MrGlasspoole » 2012-12-23 12:02

Ok, i thought something like:
Code: Select all
aptitude install python

always installs the newest stuff? And also thats how it is described on the Mosquitto site :(

The other thing is: Why everywhere the people use "apt-get"? I thought "aptitude" is newer and is what is recommended to use?

So how do i go on from here? First i did:
Code: Select all
aptitude install python

Then i followed a tut how to install python3:
Code: Select all
#aptitude install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev
#wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
#tar -xjf Python-3.3.0.tar.bz2
#cd Python-3.3.0
#./configure --prefix=/opt/python3
#make
#make install
(Why does this exist if it is already in Debian :cry: )

As i said, i will never understand where all the files go. If just installing something newer
updates the old one or if i have then 2 versions and how i uninstall something and can be sure
there i s nothing left.
I also don't get how people know what they already did and what not - in case they need
to make a change or something. I always write every bit down in a text editor i do in Putty
that i know what i did. But i don't believe other people do that cause its really a time waister.

I really thank you people for the help. Its the first time there is really help from a Linux community.
My experience with German Linux or Server community's is not the best. People there often act like
they knew all the stuff from birth on and if you don't know how to do it then f... off...
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby verahill » 2012-12-23 19:54

If this solved your problem, change the title of the first post to '[Solved] Mosquitto installation errors' . If it didn't, let me know what the remaining issues are and I'll try to help.

Python 3.x and Python 2.x are sufficiently different that they are not fully compatible with each other, hence the need to package them separately -- e.g. 2.7 and 3.0 don't refer as much to a program version as a version of a programming language. As it says on the mosquitto installation page -- you need python 2.7 or python 3.*, and the highest version of python (2.x) in Squeeze is 2.6.6.

(Why does this exist if it is already in Debian )

Maybe it wasn't available in the repos at the time, maybe the version is different, or maybe someone wanted to show how to install the upstream version. There are plenty of legitimate reason for compiling from source. Finding out whether a package is available is only a command away:
Code: Select all
aptitude search python|grep 3|less

and to get more info:
Code: Select all
aptitude how python3


You can use aptitude or apt -- it' a matter of preference. There are differences between them, but for most users it won't matter. I use both -- apt-get for installing/removing, and aptitude for searching

My experience with German Linux or Server community's is not the best.

You can help yourself by not writing things such as

I really love my Windows. One click and after 30 seconds every program runs.

You're free to love Windows -- but it's not relevant to your problem, and it is unlikely to make you any friends.

As for understanding where things go, familiarize yourself with the LFS hierarchy -- it is far more consistent and logical than most other major operating systems -- and learn how to use the locate command. Write a simple hello world program and compile it with gcc. Look up the concept of dynamically linked libraries, run ldd on a binary (e.g. ldd /bin/ls) and have a look at /etc/ld.so.conf. It won't take you long.

You can't learn anything without being willing to put a modicum of effort into it.
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia

Re: Mosquitto installation errors

Postby MrGlasspoole » 2012-12-23 23:40

Code: Select all
You can't learn anything without being willing to put a modicum of effort into it.

Hm, some people call me lexicon on feet.
I do microprocessors, electronics, build websites, CAD and still have my C64 and Amiga500 and still use DOS, Win95 and Win98.
I did some Debian servers and never hat problems with installing php, apache, mysql, postfix and all that stuff.

But if i just want to use/learn two things like Python and MQTT then it drives me crazy if i takes days to just install 2 programs.
I'm not getting younger and time is money :mrgreen:
And the "not writing things like that" - yes life is easier with not telling the truth.
In 15 Years of Internet i was in 100 of forums and some people and especially in the web *arggg
Look at youtube comments...
There was a guy in the Sitepoint forum who was laughing about my english - but his German? Maybe 2 words.
But all that is a another and big story - so back to topic.

So i did uninstall Python2 and then i was reading here and at stackoverflow that Debian needs it and it's better to have 2 and 3.
So i did a "aptitude install python" and reinstalled it.
And i did a "aptitude install python3".
I don't know how to get rid of that upstream python3 (how you guys call it).

But now the "debuild -us -uc" does allot of things but the there a errors.
Here are the last lines of the 1 millions that i see in my Putty windows:
Code: Select all
make -C test test
make[2]: Entering directory `/root/mosquitto-1.0.5/test'
make -C broker test
make[3]: Entering directory `/root/mosquitto-1.0.5/test/broker'
make -C c
make[4]: Entering directory `/root/mosquitto-1.0.5/test/broker/c'
cc -I../../../lib -I../../../src -Wall -Werror -fPIC -shared auth_plugin.c -o auth_plugin.so
cc -I../../../lib -I../../../src -Wall -Werror 08-tls-psk-pub.c -o 08-tls-psk-pub.test ../../../lib/libmosquitto.so.1
cc -I../../../lib -I../../../src -Wall -Werror 08-tls-psk-bridge.c -o 08-tls-psk-bridge.test ../../../lib/libmosquitto.so.1
make[4]: Leaving directory `/root/mosquitto-1.0.5/test/broker/c'
./01-connect-success.py
1356296552: Error: Invalid user 'mosquitto'.

Traceback (most recent call last):
  File "./01-connect-success.py", line 30, in <module>
    sock.connect(("localhost", 1888))
  File "<string>", line 1, in connect
socket.error: [Errno 111] Connection refused
make[3]: *** [test] Error 1
make[3]: Leaving directory `/root/mosquitto-1.0.5/test/broker'
make[2]: *** [test] Error 2
make[2]: Leaving directory `/root/mosquitto-1.0.5/test'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/root/mosquitto-1.0.5'
dh_auto_test: make -j1 test returned exit code 2
make: *** [build] Error 29
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1325:
dpkg-buildpackage -rfakeroot -D -us -uc failed

It also looks to me that i have it now in the wrong place (root).
And that is what i mean by "i don't understand where the files go or where they need to go".
There is no "programs" folder in Linux and looks like everybody installs the stuff in other places.

I promise i will buy books and DVDs from Lynda and go deeper into Linux cause i will need it more
in the future. But until today the Webserver stuff and how to make it safe was all i needed.

But know first i need to get this Python MQTT stuff running :(
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby verahill » 2012-12-24 00:47

I think it might be easier to start over.

Remove the Python 3 that you built yourself by going to the directory you compiled it in and doing
Code: Select all
sudo make uninstall


Make sure you have both the python and python3 packages installed. Think of them as different programs altogether since they support different programming languages. Most programmes that rely on python still use python 2.x, while python3 is still the smaller language.

To build, follow http://verahill.blogspot.com.au/2012/12/301-building-mosquitto-105-on-debian.html -- barring any typos it will work. Basically, create e.g. ~/tmp, download your source there, then download the debian rules in the source root, untar, build.

Some information that may help: Is this on a desktop installation of debian? Do you have any users created? Do you have sudo set up? Generally avoid doing anything as root or under /root, and use sudo where necessary. How did you install libssl-dev?

The
[code]
1356296552: Error: Invalid user 'mosquitto'.
[\code]
doesn't make any sense to me. Is there such a user on your system?
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia

Re: Mosquitto installation errors

Postby stevepusser » 2012-12-24 01:03

Also, it appears that you are compiling code as root. Don't. If you are running root all the time, don't. That's a bad habit brought over from Windows. Run as a standard, limited user, and use the sudo or "su -c" commands to do anything that requires administrator permissions. Build programs from source as a standard user, and install with root permission.

Rather than follow old, outdated guides from who know where on the Net, it's a better idea to ask here first how to do something...
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8938
Joined: 2009-10-06 05:53

Re: Mosquitto installation errors

Postby MrGlasspoole » 2012-12-24 01:17

i already tried make uninstall put only get:
Code: Select all
make: *** No rule to make target `uninstall'.  Stop.

There was a howto how to ad testing in the source and the install it with:
Code: Select all
aptitude -t testing install libssl-dev
And this libssl-dev error is not there anymore.
I also saw this "Error: Invalid user 'mosquitto'" and sure there is no user like that.
It looks like Mosquitto will do some testing with this username.

This sudo command does not work. What i do is that i log in with my username and if something needs
admin rights i make a "su". The only user is me.
There is no GUI. It's a virtual Debian running on my Windows Server 2012.
I do everything with Putty from my Workstation.
MrGlasspoole
 
Posts: 13
Joined: 2012-12-22 21:34

Re: Mosquitto installation errors

Postby verahill » 2012-12-24 23:40

Try building as a regular user (i.e. just log in), and stay away from root -- I suspect it will work then. I tried building it in a minimal and freshly installed environment and it worked fine.

To enable sudo, first you need to install the package sudo. Next edit /etc/sudoers and put
Code: Select all
myuser ALL=(ALL:ALL) ALL
Defaults !tty_tickets


Alternatively, add your user to group sudo, and make sure that it says something along the lines of
Code: Select all
%sudo   ALL=(ALL:ALL) ALL

in your /etc/sudoers.
--------------------------------------------------
http://verahill.blogspot.com
OPs: don't forget to mark your (first) post as solved when the issue has been resolved.
User avatar
verahill
 
Posts: 327
Joined: 2012-05-29 07:03
Location: Australia


Return to General Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable