linux – How to install valgrind properly?
linux – How to install valgrind properly?
Short answer: Make from source.
How?
- Uninstall the non working
valgrind
version with root rights (eg.sudo
):
apt-get --purge valgrind
or
dpkg --remove valgrind
or
yum remove valgrind
-
Obtain sources from here.
-
Identify the latest version (for example 3.17.0)
-
Download sources :
wget https://sourceware.org/pub/valgrind/valgrind-3.17.0.tar.bz2
-
Decompress archive
tar xvf valgrind-3.17.0.tar.bz2
-
Go to uncompressed archive
cd valgrind-3.17.0
-
Configure
./configure
-
Compile
make
-
Install
make install
(with root rights, eg.sudo
)
Note: very useful for Raspberry Pi 4 users – Default valgrind installation generate a lot of internal errors. See Valgrind reports hundreds of errors in Hello World program on RaspberryPi 4B
All major linux distributions will include valgrind in their repositories. You can find this on debian derived, apt
based systems with:
apt search valgrind
But first just try:
apt install valgrind
It should work, and pull in any dependencies. Remember, if you are not the superuser, youll need to preface those with sudo
.
Its a great tool, have fun.
linux – How to install valgrind properly?
i think its due to dependency not met.
install g++
by
sudo apt-get install g++
then try again.
error is due to exec is unable to find any package named g++