Skip to main content

Installation of Cgminer/bfgminer on Linux

Let's see how we can install cgminer (but also bfgminer), the program that undertakes to "extract" Bitcoin digital coins on Linux and of course how to support USB Stick Miners.

The test was done on the Acer Aspire One A150, which runs Linux Mint 16, but this method works on all Ubuntu-based distributions as well as on the pool ghash.io.

The method is relatively simple. We run a new terminal window and enter in Super user mode by typing the "sudo su" command (without quotes) and entering the user code.

Now type (or copy) the following:

apt-get update
apt-get upgrade
apt-get install libusb-1.0-0-dev libusb-1.0-0 libcurl4-openssl-dev libncurses5-dev libudev-dev autoconf libtool
git clone https://github.com/ckolivas/cgminer


When done, go to cgminer's folder by typing:
cd cgminer

and then type
./autogen.sh

Before continue, we will have to specify in cgminer which miner we will use (I used the bitfury) in order for the supported drivers to be installed. See cgminer's (README) page for which commands to give for each hardware. Where "bitfury" in the following command, put your own hardware.

./configure --enable-bitfury

Now, if you want to use your CPU instead of the above command, write the following.

./configure --disable-opencl --disable-adl --enable-cpumining

When finish, give the following commands to finish installing.
make
make install


When done, we're ready to run cgminer. To run it, you can either run a terminal screen and type the cgminer command and from there put your username pool name and the name of your "workers", or give a general command that includes everything, which is the best way.

For example, for ghash.io, we open a terminal and give the command:
cgminer -o stratum+tcp://uk1.ghash.io:3333 -u username.worker -p YourPasswordHere

The cgminer will automatically run and connect with ghash.io, and the mining will begin. If we have a PC exclusively for mining, it will be ideal to run the above command automatically every time the computer starts.

To do that, go to Settings -> Session and then on Boot and choose "Apply Auto Start". On there, put the name you want, the description and, in the last field put the "gnome-terminal" (without the quotation marks) and then the above command (with the correct data) and press "Add".

If everything went well we will see this picture at our terminal:

![](https://en.homebrewgr.info/bl-content/uploads/pages/ca84362f21da8ba22b7a77a2ca8de75e/cf83cf84ceb9ceb3cebcceb9cf8ccf84cf85cf80cebf-cebfceb8cf8ccebdceb7cf82-18062014-03_48_58-cebccebc-3.png)

To install "bfgminer" instead, give the below commands:

sudo add-apt-repository ppa:unit3/bfgminer
sudo apt-get update
sudo apt-get install bfgminer


When finish, run bfgminer with this command:
bfgminer -o stratum+tcp://uk1.ghash.io:3333 -u username.worker -p YourPasswordHere

Comments

  1. This isn't working for me. running autogen.sh fails, and so does attempting to configure. I am trying to set it up to use my cpu just for fun (not really expecting performance), but the binary downloaded to /usr/local/cgminer when I get cgminer from the software manager appears not to be configured to use cpu at all.

    ReplyDelete
  2. You have to install it via terminal. What error you get?

    ReplyDelete
  3. When I try to run autogen I get this:"Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
    autoreconf: failed to run aclocal: No such file or directory"If I try to configure via the command here, I get this:"bash: ./configure: No such file or directory"If I try to make the same command to configure.ac, which does exist, then I get:"bash: ./configure.ac: Permission denied"And finallly if I try to run it with bash, I get:"configure.ac: line 3: syntax error near unexpected token `[v_maj],'
    configure.ac: line 3: `m4_define([v_maj], [4])'"which would seem to indicate this isn't exactly a bash script.

    ReplyDelete
  4. "Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
    autoreconf: failed to run aclocal: No such file or directory"The error message says "the package you are working on uses Automake, but you don't have it installed". Autoconf is just the messenger.

    ReplyDelete
  5. then how to run cgminer with that error

    ReplyDelete
  6. When I try to clone the git i get the error fata: repository ____ not found

    ReplyDelete
  7. Another problem is when i try using my cpu i get somthing saying no mining devices configured in

    ReplyDelete
  8. Which Linux distro do you have?

    ReplyDelete
  9. Hi, i get this error when im trying to login to bfgminer,
    pi@raspberrypi:~/bfgminer $ bfgminer stratum+tcp://stratum.slushpool.com:3333 ******.worker1 1234Unexpected extra commandline arguments
    Could you please help me, i am a newbie trying to use a raspberry pi 3 b runnning NOOB, using slushpool.

    ReplyDelete

Post a Comment

Popular posts from this blog

Mario Kart Tour will arrive on September 25 to iOS and Android

After overcoming some delay, Nintendo has announced that Mario Kart Tour, the first Mario Kart game for smart phones, will land on September 25, 2019 on iOS and Android systems. Fans can now pre-order in the App Store (iOS) and Google Play (Android) .