HenriWahl / dhcpy6d

MAC address aware DHCPv6 server written in Python
https://dhcpy6d.de
GNU General Public License v2.0
94 stars 27 forks source link

Debian package and build.sh don't work on Ubuntu Bionic 18.04 #32

Closed Someguy123 closed 3 years ago

Someguy123 commented 4 years ago

As per the title, the .deb package does not work on Ubuntu 18.04, and nor does build.sh in the Git repository.

When attempting to install the .deb file published on the website:

user@host $ sudo dpkg -i dhcpy6d_1.0-1_all.deb

Selecting previously unselected package dhcpy6d.
dpkg: regarding dhcpy6d_1.0-1_all.deb containing dhcpy6d, pre-dependency problem:
 dhcpy6d pre-depends on dpkg (>= 1.19.7)
  dpkg is installed, but is version 1.19.0.5ubuntu2.3.

dpkg: error processing archive dhcpy6d_1.0-1_all.deb (--install):
 pre-dependency problem - not installing dhcpy6d
Errors were encountered while processing:
 dhcpy6d_1.0-1_all.deb

When attempting to use the build.sh script:

The following packages were automatically installed and are no longer required:
  linux-headers-4.15.0-108 linux-headers-4.15.0-108-generic linux-image-4.15.0-108-generic linux-modules-4.15.0-108-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  python3-all
0 upgraded, 1 newly installed, 0 to remove and 35 not upgraded.
Need to get 1,092 B of archives.
After this operation, 6,144 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-all amd64 3.6.7-1~18.04 [1,092 B]
Fetched 1,092 B in 0s (4,631 B/s)
Selecting previously unselected package python3-all.
(Reading database ... 169358 files and directories currently installed.)
Preparing to unpack .../python3-all_3.6.7-1~18.04_amd64.deb ...
Unpacking python3-all (3.6.7-1~18.04) ...
Setting up python3-all (3.6.7-1~18.04) ...
 dpkg-buildpackage --rules-target clean -rfakeroot -us -uc -ui
dpkg-buildpackage: info: source package dhcpy6d
dpkg-buildpackage: info: source version 1.0-1
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Henri Wahl <h.wahl@ifw-dresden.de>
dpkg-buildpackage: info: host architecture amd64
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 12.1.1~) python3-all (>= 3.7.3-1~) dh-systemd (>= 12.1.1)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1152:
dpkg-buildpackage --rules-target clean -rfakeroot -us -uc -ui failed
 dpkg-buildpackage --rules-target binary-indep -rfakeroot -us -uc -ui
dpkg-buildpackage: info: source package dhcpy6d
dpkg-buildpackage: info: source version 1.0-1
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Henri Wahl <h.wahl@ifw-dresden.de>
dpkg-buildpackage: info: host architecture amd64
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 12.1.1~) python3-all (>= 3.7.3-1~) dh-systemd (>= 12.1.1)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1152:
dpkg-buildpackage --rules-target binary-indep -rfakeroot -us -uc -ui failed
Someguy123 commented 4 years ago

For anyone who wants to run dhcpy6d on Ubuntu 18.04 - here's the workaround for now:

git clone https://github.com/HenriWahl/dhcpy6d.git dhcpy6d
cd dhcpy6d

sudo apt install -y python3.8 python3.8-dev python3.8-venv

# Python 3.8's pip doesn't work properly on Ubuntu 18.04 unless you upgrade keyrings.alt
sudo -H python3.8 -m pip install -U keyrings.alt
# For some reason the 'distro' package isn't automatically installed by dhcpy6d, so manually install it
sudo -H python3.8 -m pip install -U distro
# Now, we can use "pip install ." to install the current folder (dhcpy6d) as a python package via setup.py
sudo -H python3.8 -m pip install .

Once it's installed, we'll need to correct the permissions on /usr/sbin/dhcpy6d

sudo chmod 755 /usr/sbin/dhcpy6d

Next you'll need to open /usr/sbin/dhcpy6d in your preferred editor e.g. nano or vim

sudo nano /usr/sbin/dhcpy6d

Change the line

#!/usr/bin/env python3

To this:

#!/usr/bin/env python3.8

Then save and exit the file.

HenriWahl commented 4 years ago

Hi, thanks for the hint - I will check this.

HenriWahl commented 4 years ago

Won't it run with the default python 3.6 too?

HenriWahl commented 4 years ago

Well, I see... the problem is that all packages in Ubuntu 18.04 are older than in Debian 10 which was used to build the packages. Maybe the easiest solution might be an ugrade to Ubuntu 20.04?