Configure an Ubuntu server for development of C++, C#, python

Configure an Ubuntu server for development of C++, C#, python

I'm a developer for C++, C#, and python. Recently I rent a Cloud Server with Ubuntu OS for development. Here are the steps of configuration.

Basic Configurations

Users

It's imporant to add a user account before you configure your server because it's not safe to do everything under root privilege. You may never guess what command you'll give after drinking.

  1. Firstly, we add our user account with command adduser {username}, all you need is follow the instructions of it.

  2. Secondly, we add the user to sudoers if needed. We use the command below under privilege.

$ usermod -aG sudo username

Then we run this command.

$ sudo whoami

If it's result is root, then congratulations!

Git

In general, there will be a default git in your system. However, it's better to update it if its version is 1.x. Fortunately, that in my system is git 2.5.1 at the begginning since my system is Ubuntu 20.04 LTS. (That tells us to use a recent OS).

You could go to Google to find how to update git. I will update this blog if I meet the requirement in the future hahah.

Change editor of git to vim

$ git config --global core.editor vim

SSH

In general, the SSH service is opened on default, whose port is 22.

C++ Configurations

gcc Complier (default version)

$ sudo apt update
$ sudo apt install build-essential

g++ Complier

$ sudo apt-get install g++

clang Complier

Update later

cmake

$ sudo wget {link}
  • Uncompress the file.
$ tar -zxvf {filename}
  • Run the commands below in turn.
$ cd {foldername}
$ ./bootstrap
$ make
$ sudo make install

If it shows Openssl not found during the process, just run

$ sudo apt-get install libssl-dev

C# Configurations

.NET SDK

$ wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb
$ rm packages-microsoft-prod.deb

$ sudo apt-get update; \
$ sudo apt-get install -y apt-transport-https && \
$ sudo apt-get update && \
$ sudo apt-get install -y dotnet-sdk-5.0

Python Configurations

Python

Generally, you will have a version of Python in your system.

I will update how to install conda to manage libraries of Python later.