Install and Configure Git on Ubuntu 18.04

What is the purpose of Git?

Git gives you a way to not only track changes in source code, but it can also be used to track changes in files.  It then stores the data in what is called a repository, also known as a repo. In short, Git is a tool used as a version control system (VCS), allowing you to distribute changes from your local machine to the repo and vice versa.  In this tutorial, we’ll be instructing on how to install and configure git onto an Ubuntu 18.04 server.

 

Install Git on Ubuntu 18.04

Step 1: Update our System

This step ensures that general updates are performed on the server.

apt-get update

 

Step 2: Install Git

Install Git with the command below and proceed through the installation with y, when prompted.

apt-get install git-core

 

Step 3: Confirm Git Installation

We will be able to tell if the installation was successful by running the following command:

git --version

 

Configuring Git per User in Ubuntu 18.04

After installing Git, configurations are needed to commit messages to be sent out.  Without setting the name and email address, you’ll see warnings when making commitments to git. If you have multiple users who utilize git, create an entry for each user. You can easily set these details for a user with two commands:

git config --global user.name "Your_Name"

git config --global user.email "email_address@domain.com"

Note:
If you already have a github.com account you can use the associated username and email.

If you need to access the information set, you can find it in the .gitconfig file.

Thanks for reading our introductory article on How to Install Git.  Continue your education by reading our other Git related articles, Creating a Repo in Github and Committing/Pushing to Git.

Install Oracle Java 8 on Ubuntu 18.04

Java is a programming language used to build Android apps and real life web applications like Gmail and Google Docs. This ubiquitous language can be installed onto an Ubuntu server and its what we’ll be teaching in this tutorial today.

Pre-flight

  • Open the terminal and log in as root. If you are logged in as another user, you will need to add sudo before each command.
  • Working on a Linux Ubuntu 16.04 server
  • No installations of previous Java versions

Install Java

Step 1: Updating your system

apt-get update && apt-get upgrade

Step 2: Install the Repo

First, install the repository, its provided by a third party and you’ll need to press enter to continue downloading. The Oracle Java (JDK) Installer automatically downloads and installs Oracle JDK8.

add-apt-repository ppa:webupd8team/java

Update your system once more
apt-get update

Step 3: Install Java 8

Using the command below will kickstart the Java Installer which will assist in our task. Press Y when prompted to continue.

apt-get install oracle-java8-installer

Once you come to the Installer page click OK and Yes to agree to their licensing and terms.

Step 4: Verify the Installation of Java 8

java -version

Example Output:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

 

Set Java’s Home Environment

You may be looking to set Java’s home environment once we’ve installed it onto our server. To do that, lets first, let’s find Java’s path.

update-alternatives --config java

There is 1 choice for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 auto mode
* 1 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode

Take the highlighted path and add the variable into your /etc/environment file. Add the JAVA_HOME path after any line that is already present.

vim /etc/environment

Once you are in the file type i to insert the needed line:
JAVA_HOME=”/usr/lib/jvm/java-8-oracle/jre/bin/java”

Save and exit the file by typing ESC followed by :wq and press enter. Afterward, use the source command to have the system recognize the changes in your file.

source /etc/environment

You’ll know the variable has been set correctly by calling the variable.

echo $JAVA_HOME
Example Output:
root@1804:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle/jre/bin/java

Error: Please install all available updates for your release before upgrading [SOLVED]

When updating from Ubuntu 16.04 to 18.04 we used the

do-release-upgrade command as one of the steps to get the newer versions.  While using that method the update Ubuntu’s core we came across a known bug that would not allow us to continue with the upgrade. Instead, it would give the following error message:

Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

 

The Fix

If you experience the error above run each command below.

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
sudo do-release-upgrade

Once you’ve updated your server with the commands above, feel free to continue with our How to Upgrade Ubuntu 16.04 to 18.04 tutorial.

How to Upgrade Ubuntu 16.04 to Ubuntu 18.04

If you are still using Ubuntu version 16.04, you may want to consider updating to the latest Long Term Support release, version 18.04. In this post, we will cover what a Long Term Support release is and why you would want to use it. You will also learn the significant changes between 16.04 and 18.04. Last, but not least, you will also learn how to upgrade your server from Ubuntu 16.04 to Ubuntu 18.04.

Continue reading “How to Upgrade Ubuntu 16.04 to Ubuntu 18.04”

How To Remove PostgreSQL

Let’s say you were trying to download PostgreSQL and you realize that not all of the program downloaded, leaving you with files and directories that are taking up space on your server, and begs the question: How do you completely uninstall PostgreSQL?  In this tutorial, we’ll be safely removing PostgreSQL from our Liquid Web Ubuntu 16.04 server.

Continue reading “How To Remove PostgreSQL”

Install the LAMP Stack Using Tasksel on Ubuntu 16.04

There are multiple ways of installing software on Debian based systems like Ubuntu and Mint. Tools like apt, apt-get, aptitude and/or synaptic are usually used to install single applications into the desktop editions of those OS. Alternatively, Tasksel is a command line app for installing a “group” of related packages onto a server. Tasksel is not installed by default on the desktop editions of the ‘nix’ versions that contain the above-mentioned package managers but, it is installed on later versions of Debian and Ubuntu server editions.

How Does Tasksel Work?

Continue reading “Install the LAMP Stack Using Tasksel on Ubuntu 16.04”

Install and Configure ownCloud on Ubuntu 16.04

What is ownCloud?

Have you ever used an online collaboration tool or shared files with a co-worker, family member, or friend? You might have used email to send those files, or an online editor to work on a spreadsheet or text document at the same time.

But have you considered the security behind these platforms? Who is safeguarding your data, and who else might have access to it? How can you be certain that content is properly encrypted so that only the intended recipients see it, away from the prying eyes of disgruntled employees, rogue agents, third party data miners, or government agencies? Many people want a certain level of control over exactly who is able to see their sensitive data, and this is where ownCloud comes into play.

Continue reading “Install and Configure ownCloud on Ubuntu 16.04”

Configure Nginx to Read PHP on Ubuntu 16.04

Nginx is an open source Linux web server that accelerates content while utilizing low resources. Known for its performance and stability Nginx has many other uses such as load balancing, reverse proxy, mail proxy, and HTTP cache. Nginx, by default, does not execute PHP scripts and must be configured to do so.  In this tutorial, we will show you how to enable and test PHP capabilities with your server.

Continue reading “Configure Nginx to Read PHP on Ubuntu 16.04”

Install Rsync and Lsync on CentOS, Fedora or Red Hat

Have you ever needed to copy files from your local computer over to your web server? You may have previously used File Transfer Protocol (FTP) applications for this task, but FTP is prone to being insecure and can be challenging to work with over the command line. What if there was a better way? In this tutorial, we’ll be covering two popular utilities in the Linux world to securely assist in file transfers, rsync and lsyncd. We’ll show you how to install and use both in this article. Let’s dig in!

Continue reading “Install Rsync and Lsync on CentOS, Fedora or Red Hat”

Create a Cron Task in Ubuntu 16.04

Cron jobs are an incredibly useful Linux tool aimed at saving you time by scheduling tasks within your server. A programmed cron task will execute commands within a script by the minute, day, week or month. They can be scheduled to do many tasks including backing up your server’s files nightly, updating inventory orders in a database or even compressing files for migrating. Repetitive tasks become a cinch when incorporating a cron job. While there are numerous ways to run a cron task, we will be using the crontab option that is inherent within Ubuntu to set up a nightly backup of our website. Continue reading “Create a Cron Task in Ubuntu 16.04”