Skip to content

Instantly share code, notes, and snippets.

@niklaskeerl
Last active April 25, 2024 02:37
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niklaskeerl/fc26dd02e204eb685fe5b06a89a9ceda to your computer and use it in GitHub Desktop.
Save niklaskeerl/fc26dd02e204eb685fe5b06a89a9ceda to your computer and use it in GitHub Desktop.
Install pwndbg and gdb on arch linux

How to install pwndbg and gdb on arch linux

sudo pacman -S gdb
sudo pacman -S pwndbg
echo 'source /usr/share/pwndbg/gdbinit.py' >> ~/.gdbinit

If you are getting the following error "Cannot find Pwndbg virtualenv directory: /usr/share/pwndbg/.venv: please re-run setup.sh", do the following steps, otherwise ignore:

Creating the venv: python -m venv /usr/share/pwndbg/.venv

Activating the venv: source /usr/share/pwndbg/.venv/bin/activate

Install the missing packages: pip install pwndbg pwnlib pyelftools psutil typing_extensions pwntools tabulate

@qbitroot
Copy link

Thank you, especially for the last line!

@nilknow
Copy link

nilknow commented Apr 12, 2021

Thanks!

@Skarlett
Copy link

Thank you so much.

@joaoptpsa
Copy link

Thanks for the last line

@Valkierja
Copy link

Thanks for the last line

@dnorhoj
Copy link

dnorhoj commented Feb 1, 2022

thanks!

@Serial-Comma
Copy link

thx man

@skelegorg
Copy link

thanks a lot

@FuzzyLitchi
Copy link

Thank you niklaskeerl, Very cool!

@TornaxO7
Copy link

pwngdb doesn't seem to be in one of the official repos

@dnorhoj
Copy link

dnorhoj commented Nov 25, 2022

pwngdb doesn't seem to be in one of the official repos

It's "pwndbg"

@TornaxO7
Copy link

oh bruh... thank you for the hint!

@michalwoznica
Copy link

Thank you for the hint. Much appreciated.

@LeoUschi232
Copy link

Doesn't work. Causes the error:
Cannot find Pwndbg virtualenv directory: /usr/share/pwndbg/.venv: please re-run setup.sh

@niklaskeerl
Copy link
Author

niklaskeerl commented Feb 2, 2024

Doesn't work. Causes the error: Cannot find Pwndbg virtualenv directory: /usr/share/pwndbg/.venv: please re-run setup.sh

Hey @LeoUschi232 , thank you for the report. I was unaware of this issue.
It refers to a bug opened over at archlinux: https://bugs.archlinux.org/task/79822
I tried out some of the suggested solutions but they did not work.
The bug there was closed with a comment to the archlinux gitlab: https://gitlab.archlinux.org/archlinux/packaging/packages/pwndbg/issues/1
Unfortunately, I have no access there, so I cannot see what the suggested solution is.

If someone will find it out, I will update the gist :)

@LeoUschi232
Copy link

LeoUschi232 commented Feb 2, 2024

Doesn't work. Causes the error: Cannot find Pwndbg virtualenv directory: /usr/share/pwndbg/.venv: please re-run setup.sh

Hey @LeoUschi232 , thank you for the report. I was unaware of this issue. It refers to a bug opened over at archlinux: https://bugs.archlinux.org/task/79822 I tried out some of the suggested solutions but they did not work. The bug there was closed with a comment to the archlinux gitlab: https://gitlab.archlinux.org/archlinux/packaging/packages/pwndbg/issues/1 Unfortunately, I have no access there, so I cannot see what the suggested solution is.

If someone will find it out, I will update the gist :)

Hey @niklaskeerl
I already fixed it. The fix works manually. The only problem is that pwndbg wants a virtual environment at the location:
/usr/share/pwndbg/.venv
I simply set up a virtual environment at that location manually. Then the environment still didn't have all the necessary packages, but running gdb over and over again tells you which packages the .venv needs. Every time you start gdb without all packages in /usr/share/pwndbg/.venv, gdb tries to launch pwndbg and outputs the next package that is missing. You can then use pip install inside the .venv to install the packages and restart gdb to tell you which package to install next. I had to manually install the following packages:
pwndbg
pwnlib
elftools
pyelftools
psutil
typing_extensions
pwntools
tabulate
From then on it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment