Solved py-impacket pkg download error

So I haven't been able to update my packages in a while because they get stuck trying to update py-impacket. Specifically, py39-impacket-0.11.0.pkg

FreeBSD 13.2-RELEASE-p3

I've tried specifying specific pkg mirrors to no avail (including the one that the pkg maintainer says should work)... they always fail once they get to py-impacket:

Code:
Fetching py39-impacket-0.11.0.pkg:  98%    2 MiB   0.0kB/s  - stalled -
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package

Sometime it even gets to 99% but it always fails the same way.

I don't get this with any other of my packages. In fact, I cannot remember ever seeing this error before on any package in the past. So I'm not sure how to proceed. I'd be happy to work around the issue for now if there was a place I could manually download an intact py39-impacket-0.11.0.pkg and put it into my pkg cache directory.
 
if there was a place I could manually download an intact py39-impacket-0.11.0.pkg
Assuming your platform is amd64 (if not, change accordigly), try

fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/py39-impacket-0.11.0.pkg

Instead of latest you can set also quarterly.
 
Assuming your platform is amd64 (if not, change accordigly), try

fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/py39-impacket-0.11.0.pkg

Instead of latest you can set also quarterly.

Thanks! That downloaded (seemingly) ok with a file of 1886964 bytes. I placed it into /var/cache/pkg but for some reason my system still tries to download it when I do pkg upgrade. Am I missing a step?
 
Try pkg add that package from the local cache, then return to pkg upgrade.
Code:
/var/cache/pkg # pkg add py39-impacket-0.11.0.pkg
Installing py39-impacket-0.11.0...
the most recent version of py39-impacket-0.9.17_1 is already installed
 
pkg delete -f impacket
pkg add py39-impacket-0.11.0.pkg
Okay, so:

Code:
[1/1] Deinstalling py39-impacket-0.9.17_1...
[1/1] Deleting files for py39-impacket-0.9.17_1: 100%
root@FreeBSD-VM:/var/cache/pkg # pkg add py39-impacket-0.11.0.pkg
Installing py39-impacket-0.11.0...
`-- Installing py39-Flask-2.3.2...
|   `-- Installing py39-Jinja2-3.1.2...
|   | `-- Installing py39-Babel-2.12.1...
|   | `-- Extracting py39-Babel-2.12.1: 100%
pkg: Missing dependency 'py39-markupsafe'

Failed to install the following 1 package(s): py39-impacket-0.11.0.pkg

Alright, so then we:

Code:
# pkg install textproc/py-markupsafe
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    py39-Flask: 2.3.2
    py39-Jinja2: 3.1.2
    py39-blinker: 1.6.2
    py39-click: 8.1.3
    py39-future: 0.18.3
    py39-impacket: 0.11.0
    py39-itsdangerous: 2.1.2
    py39-ldap3: 2.8.1
    py39-ldapdomaindump: 0.9.4
    py39-markupsafe: 2.1.3
    py39-pycryptodomex: 3.19.0
    py39-werkzeug: 2.3.6

Number of packages to be installed: 12

The process will require 37 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/6] Fetching py39-impacket-0.11.0.pkg:  99%    2 MiB   0.0kB/s    00:00 ETA
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package

Circular dependency?
 
Try pkg update -f , return to pkg upgrade

OK:
Code:
# pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01   
Fetching packagesite.pkg: 100%    7 MiB 689.2kB/s    00:10   
Processing entries: 100%
FreeBSD repository update completed. 34073 packages processed.
All repositories are up to date.

Ok, so far so good. So then:

Code:
# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (57 candidates): 100%
Processing candidates (57 candidates): 100%
The following 74 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    luit: 20230201
    py39-Flask: 2.3.2
    py39-Jinja2: 3.1.2
    py39-blinker: 1.6.2
    py39-click: 8.1.3
    py39-future: 0.18.3
    py39-greenbone-feed-sync: 23.8.0
    py39-impacket: 0.11.0
    py39-itsdangerous: 2.1.2
    py39-ldap3: 2.8.1
    py39-ldapdomaindump: 0.9.4
    py39-markdown-it-py: 3.0.0
    py39-markupsafe: 2.1.3
    py39-mdurl: 0.1.2_2
    py39-pycryptodomex: 3.19.0
    py39-pygments: 2.16.1
    py39-rich: 13.6.0
    py39-werkzeug: 2.3.6

Installed packages to be UPGRADED:
    garcon: 4.18.1 -> 4.18.1_1
    gigolo: 0.5.3 -> 0.5.3_1
    gvm-libs: 22.6.0 -> 22.7.1
    libexo: 4.18.0_1 -> 4.18.0_2
    libxfce4menu: 4.18.4 -> 4.18.4_1
    mousepad: 0.6.1 -> 0.6.1_1
    mpg123: 1.31.3_1 -> 1.32.2
    openvas: 22.7.0 -> 22.7.5
    parole: 4.18.0_2 -> 4.18.0_3
    ristretto: 0.13.1_1 -> 0.13.1_2
    samba413: 4.13.17_5 -> 4.13.17_6
    sdl2: 2.28.3 -> 2.28.4
    thunar: 4.18.7 -> 4.18.7_2
    thunar-archive-plugin: 0.5.1 -> 0.5.1_1
    thunar-media-tags-plugin: 0.4.0_1 -> 0.4.0_2
    thunar-vcs-plugin: 0.2.0_3 -> 0.2.0_5
    xfce4-appfinder: 4.18.1 -> 4.18.1_1
    xfce4-battery-plugin: 1.1.5 -> 1.1.5_1
    xfce4-bsdcpufreq-plugin: 0.3.1_2 -> 0.3.1_3
    xfce4-calculator-plugin: 0.7.2 -> 0.7.2_1
    xfce4-clipman-plugin: 1.6.5 -> 1.6.5_1
    xfce4-cpugraph-plugin: 1.2.8 -> 1.2.8_1
    xfce4-dashboard: 1.0.0_1 -> 1.0.0_2
    xfce4-datetime-plugin: 0.8.3_1 -> 0.8.3_2
    xfce4-desktop: 4.18.1_1 -> 4.18.1_2
    xfce4-dict-plugin: 0.8.5 -> 0.8.5_1
    xfce4-diskperf-plugin: 2.7.0_1 -> 2.7.0_2
    xfce4-fsguard-plugin: 1.1.3 -> 1.1.3_1
    xfce4-genmon-plugin: 4.2.0 -> 4.2.0_1
    xfce4-mailwatch-plugin: 1.3.1 -> 1.3.1_1
    xfce4-mount-plugin: 1.1.6 -> 1.1.6_1
    xfce4-netload-plugin: 1.4.1 -> 1.4.1_1
    xfce4-notes-plugin: 1.10.0 -> 1.10.0_1
    xfce4-notifyd: 0.9.2 -> 0.9.2_1
    xfce4-panel: 4.18.5 -> 4.18.5_1
    xfce4-power-manager: 4.18.2 -> 4.18.2_1
    xfce4-pulseaudio-plugin: 0.4.7_1 -> 0.4.8_1
    xfce4-screensaver: 4.18.2 -> 4.18.2_1
    xfce4-screenshooter-plugin: 1.10.4 -> 1.10.4_1
    xfce4-session: 4.18.3 -> 4.18.3_2
    xfce4-settings: 4.18.3_1 -> 4.18.3_2
    xfce4-smartbookmark-plugin: 0.5.2_2 -> 0.5.2_3
    xfce4-stopwatch-plugin: 0.5.0_1 -> 0.5.0_2
    xfce4-systemload-plugin: 1.3.2_1 -> 1.3.2_2
    xfce4-taskmanager: 1.5.5_1 -> 1.5.6
    xfce4-terminal: 1.1.0_1 -> 1.1.0_2
    xfce4-time-out-plugin: 1.1.3 -> 1.1.3_1
    xfce4-timer-plugin: 1.7.2 -> 1.7.2_1
    xfce4-tumbler: 4.18.1_3 -> 4.18.1_4
    xfce4-verve-plugin: 2.0.3 -> 2.0.3_1
    xfce4-wavelan-plugin: 0.6.3_1 -> 0.6.3_2
    xfce4-weather-plugin: 0.11.1 -> 0.11.1_1
    xfce4-whiskermenu-plugin: 2.8.0 -> 2.8.0_1
    xfce4-wm: 4.18.0_1 -> 4.18.0_2
    xfce4-xkb-plugin: 0.8.3_1 -> 0.8.3_2
    xterm: 384 -> 385

Number of packages to be installed: 18
Number of packages to be upgraded: 56

The process will require 49 MiB more space.
26 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/32] Fetching py39-impacket-0.11.0.pkg:  99%    2 MiB   0.0kB/s    00:00 ETA
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package
So it's still trying to download. So let's focus on py-impacket:
Code:
# pkg add py39-impacket-0.11.0.pkg
Installing py39-impacket-0.11.0...
`-- Installing py39-Flask-2.3.2...
|   `-- Installing py39-Jinja2-3.1.2...
pkg: Missing dependency 'py39-markupsafe'

Failed to install the following 1 package(s): py39-impacket-0.11.0.pkg

So we'll try the dependency first:
Code:
# pkg install textproc/py-markupsafe
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    py39-Flask: 2.3.2
    py39-Jinja2: 3.1.2
    py39-blinker: 1.6.2
    py39-click: 8.1.3
    py39-future: 0.18.3
    py39-impacket: 0.11.0
    py39-itsdangerous: 2.1.2
    py39-ldap3: 2.8.1
    py39-ldapdomaindump: 0.9.4
    py39-markupsafe: 2.1.3
    py39-pycryptodomex: 3.19.0
    py39-werkzeug: 2.3.6

Number of packages to be installed: 12

The process will require 37 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
pkg: An error occured while fetching package

Even though it doesn't state it, I know it's the py39-impacket install that's kicking this error.

Seems like a circular-depedency? py-impacket depends on py-markupsafe, but py-markupsafe depends on py-impacket?
 
pkg upgrade -f textproc/py-markupsafe

Code:
# pkg upgrade -f textproc/py-markupsafe
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    py39-Flask: 2.3.2
    py39-Jinja2: 3.1.2
    py39-blinker: 1.6.2
    py39-click: 8.1.3
    py39-future: 0.18.3
    py39-impacket: 0.11.0
    py39-itsdangerous: 2.1.2
    py39-ldap3: 2.8.1
    py39-ldapdomaindump: 0.9.4
    py39-markupsafe: 2.1.3
    py39-pycryptodomex: 3.19.0
    py39-werkzeug: 2.3.6

Number of packages to be installed: 12

The process will require 37 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/6] Fetching py39-impacket-0.11.0.pkg:  99%    2 MiB   0.0kB/s  - stalled -
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package

pkg add py39-impacket-0.11.0.pkg

I assume because the previous failed that this is pointless, but just in case:
Code:
# pkg add py39-impacket-0.11.0.pkg
Installing py39-impacket-0.11.0...
`-- Installing py39-Flask-2.3.2...
|   `-- Installing py39-Jinja2-3.1.2...
pkg: Missing dependency 'py39-markupsafe'

Failed to install the following 1 package(s): py39-impacket-0.11.0.pkg
 
What a mess.

Sorry. :( If I'm at fault, I certainly am not sure what I did and it wasn't intentional.


Code:
# fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/py39-markupsafe-2.1.3.pkg
py39-markupsafe-2.1.3.pkg                               15 kB  118 MBps    00s

Looking good.

pkg add py39-markupsafe-2.1.3.pkg

Code:
# pkg add py39-markupsafe-2.1.3.pkg
Installing py39-markupsafe-2.1.3...
Extracting py39-markupsafe-2.1.3: 100%

Also good. I'm resisting trying to continue on my own and will defer to you.
 
Code:
# pkg add py39-impacket-0.11.0.pkg
Installing py39-impacket-0.11.0...
`-- Installing py39-Flask-2.3.2...
|   `-- Installing py39-Jinja2-3.1.2...
|   `-- Extracting py39-Jinja2-3.1.2: 100%
pkg: Missing dependency 'py39-blinker'

Failed to install the following 1 package(s): py39-impacket-0.11.0.pkg

Code:
# pkg install py39-blinker
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
The following 10 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    py39-Flask: 2.3.2
    py39-blinker: 1.6.2
    py39-click: 8.1.3
    py39-future: 0.18.3
    py39-impacket: 0.11.0
    py39-itsdangerous: 2.1.2
    py39-ldap3: 2.8.1
    py39-ldapdomaindump: 0.9.4
    py39-pycryptodomex: 3.19.0
    py39-werkzeug: 2.3.6

Number of packages to be installed: 10

The process will require 35 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/5] Fetching py39-impacket-0.11.0.pkg:  99%    2 MiB   0.0kB/s  - stalled -
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package

Seems things keep coming back to a dependency to py-impacket.
 
pkg update -f should have corrected the size mismatch.

Not sure what the cause could be, don't know what else to suggest, except maybe a workaround. But it might not work (again size missmatch).

I always fetch the packages from the remote package repository in a local repository, to distribuit them to multiple systems.

For example:
pkg install -n py39-blinker > newinstall

Clean up the file so only package names remain.

I do that with pkg upgrade -n > textfile and neovim (global remove pattern).

pkg fetch -o /var/cache/pkg `cat newinstall`

That will download the files under /var/cache/pkg/All (if pkg doesn't complain again). From there

pkg add *
 
Well, that didn't work either, but unsurprising as it's ultimately the same as pkg fetch py39-impacket which produces the ongoing error:

Code:
# pkg fetch py39-impacket
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following packages will be fetched:

New packages to be FETCHED:
    py39-impacket: 0.11.0 (2 MiB: 100.00% of the 2 MiB to download)

Number of packages to be fetched: 1

The process will require 2 MiB more space.
2 MiB to be downloaded.

Proceed with fetching packages? [y/N]: y
Fetching py39-impacket-0.11.0.pkg:  99%    2 MiB   0.0kB/s    00:00 ETA
pkg: cached package py39-impacket-0.11.0: missing or size mismatch, fetching from remote
pkg: An error occured while fetching package
 
Figured it out. For some reason, this one package (and only this one package) had an issue with the double-NAT environment that a VirtualBox VM defaults to. I switched to "Bind" for the network connection and then it was happy.

Not sure what's special about downloading py-impacket that isn't triggered by any other packages, but whatever. Mystery solved. :)
 
Back
Top