Cryptocurrency and Linux go hand in hand, and it may go without saying, but the world of free software is heavily, centrally, based around Linux and its many variants. It is likely that those who have delved into freeware have come across projects on GitHub and seen guides on how to compile the program themselves if they were to have Linux installed. Then, without a further thought, we have all clicked on the download link for the Windows executable and moved on with life.

For those with less powerful hardware, one of the only ways you can mine coins is to get in on mining incredibly early. My laptop is not a match for any desktop out there with a dedicated GPU, and this is the only way that I will ever get in on the ground level for a new currency without purchasing it.

Finding new cryptocurrencies and getting in early is fairly complex. It took me almost a week before I managed to get my first attempt at compiling a program to work, and another before I could get a new coin in the wild to work. Through all of it I wish I had had a blog dedicated to walking everyone through the process of how to do just this simple task. So here we are.

Part 1: Setting up a Linux Distro

A quick forward: if you are new to doing things on computers that are more complicated than simply installing a game or a web browser, you may want to take things slow. It is likely that at some point you may find yourself in a position where Linux will crash, boot into tty (more on that in a minute), or do other things that are confusing or erratic.

Step 1: Download a Virtual Machine Platform

You may want to consider what kind of things you will be doing in Linux (in this case compiling new cryptocurrency software), and what kind of access you want it to have to your main operating system. I, as well as most others, would recommend strongly that you utilize a virtual machine platform to install Linux onto your computer. It is much more secure than having a separate partition on your boot drive, as well as offers the ability to easily create backup checkpoints in the operating system before doing anything that may break it, which if you are doing anything Cryptocurrency related, you may break your Linux distro.

Windows Users

Windows users should look into using the free version of VMware Workstation. Yes, Virtual Box is free as well, and more often associated with the use of Virtual machines on Windows, but there is a huge advantage to using a virtual machine platform with a well designed hypervisor (its the software that manages the machines resources for both operating systems), and the personal use version of VMware Workstation is certainly going to be a better match for tasks relating to crypto than the one in Virtual Box.

MacOS Users

As for those on MacOS devices, I can only recommend Parallels Desktop. Parallels has made the process of installing and managing a virtual machine incredibly lightweight and easy. Not to mention the ability to quickly isolate virtual machines from your main operating system as well as a hypervisor that works nearly flawlessly to provide power to both operating systems at the same time. Especially if you are on a laptop, Parallels features provide a huge edge in power management when running a virtual machine.

Step 2: Pick a Linux Distro (All Are Good for Cryptocurrency)

There are a massive amount of Linux distributions out there, so much so that its a bit overwhelming (although most work well for Cryptocurrencies). For most users though, the main three will serve the purpose best. Ubuntu, CentOS, and Debian offer the best set of pre-installed tools and community resources that you should be safe with any of them. Ubuntu is by and far the most popular, although it is a bit more heavyweight than Debian, it has by and far the most community based support avialible. CentOS stands somewhere in the middle. Debian is very similar to Ubuntu, except a bit lighter on install size and resources, but it lacks as much community support and can be a bit more tricky to learn than Ubuntu.

Overall, if you are brand new to Linux, go for Ubuntu. If you know your way around terminal commands already, you can try Debian or CentOS and shouldn't have any issues. At the end of the day, people have their preferences for which distro they want to use, and they usually stick with them. However, all of them should work fine for cryptocurrencies.

Step 3: Install and Update

Not so different from Windows or MacOS, you'll need to install the Linux distro and then update the software within it. Usually this process goes relatively quickly, especially in a virtual machine environment, you may be able to install a Linux distro in about ten minutes.

The first thing to do once your virtual machine install of Linux is installed is go ahead and install any tool set that your virtual machine platform offers. These tools often allow for the virtual machine to handle internet, hardware, and resource requests better by bridging the gap between being installed directly onto a HDD partition, and being installed into a virtual machine. Which can be a bit confusing for things like networking adapters and USB controllers (the software that talks to your USB ports, not a game controller that plugs in via USB).

Finally you'll want to update the built in applications that came with Linux. All of the distros mentioned above have built in software managers, similar to the app store or Microsoft store. You can simply use those to update if you want to, or you can dive into terminal commands early and get a jump on things.

To update all software on your Linux distro, simply open up the terminal application, and then use the following commands.

$ sudo apt update

(enter your administrator password)

##The terminal will then run some commands and return with a line that either says

##"All applications are up to date." or "X packages need to be upgraded, run apt upgrade to ##upgrade them." Either way you can just go ahead and run the next command.

$ sudo apt upgrade

How Do These Commands Work?

Lets break down whats going on here for everyone, as its important to know what you are typing instead of just typing it. We are really only using one command above, with a permissions modifier, and two different command "arguments". Also you will notice I have put a "$" before lines where we have commands to enter and "##" before lines where I made comments. This is commonly how code is expressed. The "$" almost always indicates that you should enter the text after it into the terminal, and the "##" almost always indicates a comment to explain what is going on directly in the codes or commands being provided.

Sudo

Sudo is not really a command, but instead it is a permissions modifier for terminal commands. You can actually use it on most operating system's terminals, except for Windows. All that "sudo" does is tell the computer that you want to run the command as an administrator instead of as the current user. This is especially important on Linux as only the administrator, and not user accounts (even if its the only one on the computer) can access the "root" director, or the top level of the hard drive space the operating system is on. More than that, there may be times where "sudo" doesn't even cut it for permissions, and you have to modify the permissions for a file using other commands. With that said, "sudo" can be added to the front of any command, and with some commands the computer may pretend it doesn't know them unless you use "sudo".

Sudo does have a lot of modifiers that can be added, just a quick glance is confusing.

However, you will likely not need to use any of these for most operations. The reason that they exist is that "sudo" can also be used to control the terminal as another user on a computer or a remote computer. So in its default format of just typing "sudo" before a command, it will log you in as the administrator of the computer you are using. It is also possible to use it to login as other users on the computer by specifying their credentials with the modifiers above.

Apt

Apt is the first actual command we will be using. It's primary purpose is to install, update, and remove software packages on the computer. It has some cousins that we will likely use later on: "apt-get" and "aptitude". They serve other purposes, which I will get into later on. "Apt" primarily gives us a way to tell the computer to search through both itself and the online repositories of packages that are linked to the installation of Linux for software and then do one of its functions.

Typing in "apt --help" gives us a rather wordy detail of that "apt" does.

There are several modifiers (or commands as the help calls them) for "apt" that we will use quite often. First is the "update" modifier; this tells apt to check the versions of all of your installed software packages against those on the lists of packages its attached to, also known as repositories, to make sure that they are the most recent versions of the software, it then also updates the list of software packages available to you from the linked repositories. This is useful because you can add more repositories to the linked ones and thus increase the amount of software packages you have access to.

"List" and "Search"

There are also the "list" and "search" modifiers. These two perform similar, yet distinct functions that allow you to search through the lists of the software repositories to find new software. "list" provides you with search results based on the name of the software package, which can be a bit weird sometimes. That is exactly why "search" exists, as it searches the longer descriptions of the software packages. This can be useful for finding packages you don't know even part of the exact name for, but also can produce some wildly long lists of packages to sift through.

The last modifier that you will probably use more often than the others is "upgrade". This simply upgrades the packages you already have installed on your system to the most current version, and then removes the old packages and other packages that are no longer needed.

Important Note:

"apt upgrade" is where you could possibly get yourself into trouble. There are several different competing software package sets that provide a GUI (Graphical User Interface) to the various Linux distros. These come in the form of multiple packages that are dependent on each other, and the system is generally smart enough to know when conflicting software is going to be installed and then attempt to remove the older of the two conflicting packages. So if you were to happen to install a package for a different GUI set than the one already installed, you may end up accidentally putting your entire GUI set onto the list of no longer needed programs that "apt" looks at when you run "apt upgrade". The good news is that if you read the whole list of packages that "apt upgrade" plans on removing, you can usually spot these packages on there and correct course before confirming the upgrade. However, you'll need to know what the heck they are called first.

Step 4: Installing Additional Tools

Now that you have updated everything, there are a few tools we need to get so that we can learn more about our new operating system environment. The first of these is called aptitude.

Aptitude

Aptitude is essentially all of the features of the "apt" command rolled into a GUI in the terminal. Don't expect anything fancy looking to come popping through your screen, any GUI in a terminal is going to look like its on Nedry's computer in Jurrasic Park, and Aptitude delivers. First lets run the following command to download and install Aptitude.

$ sudo apt install aptitude

That is, Aptitude is now installed and you can start using it instead of mucking around in the modifiers of the "apt" command for hours. Go ahead and launch Aptitude with the command below.

$ sudo aptitude

You should see a lovely GUI pop-up that looks something like this:

The genius of Aptitude is that it lets you run a bunch of "apt" commands without having to type all of them over and over and over. So if you want to search, all you have to do is press the "/" key and a search box will come up. Granted, you may have to repeatedly re-launch the search box to get to the item you are looking for, but pressing "/" and then enter a bunch is much faster than typing "sudo apt search" and then combing through 10,000+ lines of output for a single thing. Which can happen when looking for some of these obscure cryptocurrency dependency libraries.

More than just searching for things, Aptitude also does the installation, removal, and updating of packages. It displays their descriptions in a humanly readable way, and is much easier to use overall than the whole "apt" command system.

Ldd

This one isn't an additional package like Aptitude is, its built right into the system. The "ldd" command comes in very handy when you are looking to find out what dependencies a specific package needs. More specifically, packages you may have downloaded off the internet, such as a new cryptocurrency wallet that is already compiled.

Pretty simply, all you need to do is navigate to a folder within terminal, and then enter the command:

$ ldd YOUR_PACKAGES_NAME

It will then spit out either a confirmation that every package you need is installed, or tell you what you don't need.

Wrapping Up

Now that you have Linux installed, some utilities installed, and you are learning the basics of terminal, you are probably ready to walk through how to compile a program from scratch. First though, we need to talk about dependencies libraries and how to make your own for ones that are commonly used, but hard to find. I'll cover that in the next part of GSWL.