Brief tutorial on compiling software.
First, start your Fedora VM machine in VirtualBox, update it, and then power it off. To update, use dnf:
$ sudo dnf check-update ; sudo dnf update
And then poweroff:
$ sudo poweroff
Once it's powered off, use VirtualBox to clone it. After the clone is created, start the clone. Once you have a command line, install the C development tools:
$ sudo dnf groupinstall 'C Development Tools and Libraries'
First, create a src directory in your home directory and change to it:
$ cd ; mkdir src ; cd src
Download the most recent, stable versions of nano and ncurses:
$ wget https://www.nano-editor.org/dist/v3/nano-3.0.tar.xz $ wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz
STOP HERE. We'll discuss and do the rest in class
Use tar to extract the tarballs:
$ tar xf nano-3.0.tar.xz $ tar xf ncurses-6.1.tar.gz
Change to each of the new directories and read the README files.
First change to the ncurses directory:
$ cd ncurses-6.1
And then configure, make, and make install:
$ ./configure $ make $ sudo make install
If successful, then change to the nano directory, and repeat the above:
$ cd ../nano-3.0 $ ./configure $ make $ sudo make install
Since nano was already installed on your system, you now have two versions. The compiled version is installed in /usr/local/bin/. Compare:
$ which nano # to see which is the default $ whereis nano # to see where nano exists on the system $ # compare binaries $ /usr/bin/nano --version $ /usr/local/bin/nano --version
Let's update our $PATH variable to remove the old version. Make sure that you're in your home directory, and then:
$ nano .bash_profile
In the text editor, append the following text with the pathname /usr/local/bin/:
Save and exit from nano and then source the file. Sourcing the file makes bash aware that the $PATH variable has been changed:
$ source .bash_profile $ which nano
Now, we can remove the older version of nano:
$ dnf list installed nano $ sudo dnf remove nano
./configure --help to get a list of possible options.