Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: suirrell on March 15, 2021, 10:45:49 PM



Title: How to uninstall bitcoin core (linux)?
Post by: suirrell on March 15, 2021, 10:45:49 PM
I followed these instructions to install bitcoin core on linux: https://bitcoin.org/en/full-node#linux-instructions
Code:
 sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.21.0/bin/* 

But, how can uninstall it now?


Title: Re: How to uninstall bitcoin core (linux)?
Post by: airfinex on March 15, 2021, 11:30:46 PM
"Uninstalling bitcoin client in any linux based system is similar to uninstalling a program in linux which you have built from source. Generally users of linux use make install and they were the ones which was mentioned in the bitcoin build notes as you have been trying to build bitcoin from source".

But instead of make install you could try using checkinstall. checkinstall command will make the installation and un-installation easier by creating deb packages. See wiki for checkinstall command : CheckInstall (https://en.wikipedia.org/wiki/CheckInstall)

Uninstalling older bitcoin client in Linux can be done using the following command :

Code:
sudo make uninstall or make uninstall


Title: Re: How to uninstall bitcoin core (linux)?
Post by: NotATether on March 16, 2021, 05:31:44 AM
If your installation prefix is /usr/local then all you have to do is delete files manually from that prefix but this dangerous because you nigh accidentally uninstall a library used by some other program you compiled from source at /usr/local.

You can also use the sudo make uninstall command but for this to work you still have to have the bitcoin source folder lying around, alternatively you can download the source code of your corresponding Bitcoin Core version again, and open a terminal, change directory to it and then run sudo make uninstall.

The sudo part is necessary if you installed it at /usr/local and you're not root.

Then delete the .bitcoin folder in your home folder if you want to erase the user data too (make a backup of your wallet.dat first!)


Title: Re: How to uninstall bitcoin core (linux)?
Post by: suirrell on March 16, 2021, 06:32:10 PM
If your installation prefix is /usr/local then all you have to do is delete files manually from that prefix but this dangerous because you nigh accidentally uninstall a library used by some other program you compiled from source at /usr/local.

You can also use the sudo make uninstall command but for this to work you still have to have the bitcoin source folder lying around, alternatively you can download the source code of your corresponding Bitcoin Core version again, and open a terminal, change directory to it and then run sudo make uninstall.

The sudo part is necessary if you installed it at /usr/local and you're not root.

Then delete the .bitcoin folder in your home folder if you want to erase the user data too (make a backup of your wallet.dat first!)

I tried with sudo make uninstall from the source folder but i keep getting
Code:
make: *** No rule to make target 'uninstall'.  Stop.

I suppose there is no way to uninstall it, i can't find any information in any documentation. Maybe i should simply delete all files in /usr/local/bin , inside that folder only bitcoin files are present:
Code:
ls /usr/local/bin/
bitcoin-cli  bitcoind  bitcoin-qt  bitcoin-tx  bitcoin-wallet  test_bitcoin


Title: Re: How to uninstall bitcoin core (linux)?
Post by: NotATether on March 16, 2021, 07:03:43 PM
I tried with sudo make uninstall from the source folder but i keep getting
Code:
make: *** No rule to make target 'uninstall'.  Stop.

Right. I forgot the Makefile is generated by ./configure and so doesn't have an uninstall target.

That means we have to do things the trial and error way by looking at my own bitcoind installation and seeing which files belong to it (how? I don't know, by comparing file modification times? Worth a shot.)

Code:
/usr/local/bin/bitcoin-cli
/usr/local/bin/bitcoind
/usr/local/bin/bitcoin-qt
/usr/local/bin/bitcoin-tx
/usr/local/bin/bitcoin-wallet
/usr/local/bin/test_bitcoin
/usr/local/include/bitcoinconsensus.h
/usr/local/lib/libbitcoinconsensus.so
/usr/local/lib/libbitcoinconsensus.so.0
/usr/local/lib/libbitcoinconsensus.so.0.0.0
/usr/local/man/man1/bitcoin-cli.1
/usr/local/man/man1/bitcoind.1
/usr/local/man/man1/bitcoin-qt.1
/usr/local/man/man1/bitcoin-tx.1
/usr/local/man/man1/bitcoin-wallet.1
/usr/local/share/man/man1/bitcoin-cli.1
/usr/local/share/man/man1/bitcoind.1
/usr/local/share/man/man1/bitcoin-qt.1
/usr/local/share/man/man1/bitcoin-tx.1
/usr/local/share/man/man1/bitcoin-wallet.1

Just rm -f all of these (be careful not to blow away your entire /usr/local in the process  :P rm can destroy entire folder trees).

Removing these files won't remove the Berkeley DB 4.8 dependencies if that is also installed in /usr/local.

Note: If you installed Core to a folder other than /usr/local, then replace that prefix in the files with your own accordingly.


Title: Re: How to uninstall bitcoin core (linux)?
Post by: suirrell on March 16, 2021, 07:33:26 PM
I tried with sudo make uninstall from the source folder but i keep getting
Code:
make: *** No rule to make target 'uninstall'.  Stop.

Right. I forgot the Makefile is generated by ./configure and so doesn't have an uninstall target.

That means we have to do things the trial and error way by looking at my own bitcoind installation and seeing which files belong to it (how? I don't know, by comparing file modification times? Worth a shot.)

Code:
/usr/local/bin/bitcoin-cli
/usr/local/bin/bitcoind
/usr/local/bin/bitcoin-qt
/usr/local/bin/bitcoin-tx
/usr/local/bin/bitcoin-wallet
/usr/local/bin/test_bitcoin
/usr/local/include/bitcoinconsensus.h
/usr/local/lib/libbitcoinconsensus.so
/usr/local/lib/libbitcoinconsensus.so.0
/usr/local/lib/libbitcoinconsensus.so.0.0.0
/usr/local/man/man1/bitcoin-cli.1
/usr/local/man/man1/bitcoind.1
/usr/local/man/man1/bitcoin-qt.1
/usr/local/man/man1/bitcoin-tx.1
/usr/local/man/man1/bitcoin-wallet.1
/usr/local/share/man/man1/bitcoin-cli.1
/usr/local/share/man/man1/bitcoind.1
/usr/local/share/man/man1/bitcoin-qt.1
/usr/local/share/man/man1/bitcoin-tx.1
/usr/local/share/man/man1/bitcoin-wallet.1

Just rm -f all of these (be careful not to blow away your entire /usr/local in the process  :P rm can destroy entire folder trees).

Removing these files won't remove the Berkeley DB 4.8 dependencies if that is also installed in /usr/local.

Note: If you installed Core to a folder other than /usr/local, then replace that prefix in the files with your own accordingly.

Well i found bitcoin files only under /usr/local/bin, i must be lucky ^^
Thanks for your help.


Title: Re: How to uninstall bitcoin core (linux)?
Post by: HCP on March 18, 2021, 09:46:46 PM
I followed these instructions to install bitcoin core on linux: https://bitcoin.org/en/full-node#linux-instructions
Code:
 sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.21.0/bin/* 

But, how can uninstall it now?
Well i found bitcoin files only under /usr/local/bin, i must be lucky ^^
Looking at the command it makes sense that you only found items in /usr/local/bin... As that command takes everything that was in bitcoin-0.21.0/bin/ and effectively "copied" them to /usr/local/bin... so to undo that, you'd just need a list of the files that were in bitcoin-0.21.0/bin/ and then manually delete them from /usr/local/bin