Skip to content

Instantly share code, notes, and snippets.

@niklaskeerl
Last active June 14, 2026 08:47
Show Gist options
  • Select an option

  • Save niklaskeerl/fc26dd02e204eb685fe5b06a89a9ceda to your computer and use it in GitHub Desktop.

Select an option

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

@skelegorg

Copy link
Copy Markdown

thanks a lot

@FuzzyLitchi

Copy link
Copy Markdown

Thank you niklaskeerl, Very cool!

@TornaxO7

Copy link
Copy Markdown

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

@dnorhoj

dnorhoj commented Nov 25, 2022

Copy link
Copy Markdown

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

It's "pwndbg"

@TornaxO7

Copy link
Copy Markdown

oh bruh... thank you for the hint!

@michalwoznica

Copy link
Copy Markdown

Thank you for the hint. Much appreciated.

@LeoUschi232

Copy link
Copy Markdown

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

@niklaskeerl

niklaskeerl commented Feb 2, 2024

Copy link
Copy Markdown
Author

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

LeoUschi232 commented Feb 2, 2024

Copy link
Copy Markdown

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.

@namaek2

namaek2 commented Nov 29, 2024

Copy link
Copy Markdown

thanks!!

@patryk4815

Copy link
Copy Markdown

Just use: https://archlinux.org/packages/extra/any/pwndbg/

$ pacman -S pwndbg
$ pwndbg

No need for .gdbinit modification

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