Test

Introduction to Ubuntu

Arteco - Information Technologies
  • :)
  • :0
  • :D
  • ;)
  • :]
foto Ramón Arnau

Ramón Arnau

Gerente de Arteco Consulting SL

Ubuntu is the preferred OPERATING SYSTEM for PROGRAMMERS. FREE and OPEN SOURCE, it is used by all PROFESSIONALS

What is Ubuntu?

Ubuntu is an open-source operating system based on the popular Linux distribution called Debian. Mark Shuttleworth, first through his company Canonical Ltd and later incorporating the Ubuntu Foundation, has succeeded in democratizing the use of a Linux distribution like Ubuntu for general use, both for desktop and server, simplifying the installation process and improving the end-user experience.

Being based on Debian, Ubuntu benefits from the repositories of programs and libraries available from the open-source community through the APT package manager, offering users a catalog of over 60K packages including applications, commands, and libraries, among which are the main Java integrated development environments like Eclipse or Netbeans, office packages like Libre Office, audio and video editors, and a wide range of games.

Furthermore, Ubuntu incorporates the possibility of easily installing third-party proprietary software such as Google Chrome, Spotify, Nvidia drivers, video codecs, etc., significantly improving the user experience for non-technical profiles.

Why Ubuntu is better than Windows

Traditionally, Debian and all its descendants have been considered very stable operating systems, and being open-source, users do not have to pay licensing fees, nor renew licenses with each new version of the operating system.

They are highly configurable and transparent systems, so users have control over all services and processes running in the background. Experienced users can configure PC and operating system behavior from the inside, adapting perfectly to computers with special hardware requirements, memory consumption, or battery usage for laptops.

On the other hand, Windows has several disadvantages. All installations usually come with pre-installed software, where there are many demo programs running automatically and where user privacy is not guaranteed. Furthermore, they try to influence users' behavior to make monetary conversions on the sale of products and licenses for office packages, antivirus, and other proprietary software often unnecessary.

In terms of programming, using Windows may limit you in terms of using important current programming tools such as Docker, used to launch traditional services like MySQL, PostgreSQL, Oracle, PHP, Tomcat, etc., very easily and in a virtualized way, as the Home Edition versions that usually come with home computers do not support the use of this tool, forcing the user to purchase a Professional version. Moreover, many open-source programs and libraries use commands available natively in Unix systems like macOS or Linux (including Ubuntu), and although they can be installed on Windows, they do not work as well as on Unix systems.

Therefore, we strongly recommend that you acquire Ubuntu, or one of the Debian-based distributions, and install it on your PC for programming tasks. Remember that Windows and Ubuntu can coexist on the same computer, but you will have to choose which one to boot when starting up the computer.

How to Obtain Ubuntu

Obtaining Ubuntu is very simple, just visit the official distribution page and download the corresponding ISO image for the installation you want to perform: Server, Desktop, Cloud, IoT, or one of its variants maintained by third parties.

The installation of the ISO image can be done by burning that file to a DVD or through a USB. The latter is the preferred method to avoid using disposable material.

How to Install Ubuntu

We understand that if you want to install Ubuntu it is probably because you are using Windows. If not, it is because you already have some Unix distribution like Linux or macOS. If this is your case, you will probably be able to use most of the tools and commands used in the rest of the articles without any inconvenience.

So the first thing you should do is to burn the ISO file to the USB but in a special format that allows the computer to boot from the USB. This will automatically bring up a very simple graphical interface that will guide us through all the installation steps and where we will be given the option to perform a complete installation of the entire PC or modify the existing one to coexist with Windows.

This copying to the USB can be done with hundreds of programs available on Windows, many of them open-source, for example Rufus.

Using Rufus is very simple, just choose the USB device where you want to burn the ISO file downloaded from the internet with the image of the Ubuntu distribution chosen. If you don't know which one to choose, simply download the latest LTS (Long Term Support) version of Ubuntu Desktop for amd64. After a few moments, Rufus will copy all the contents of the ISO file to the USB in a format that allows the PC to boot from the USB. So once the transfer is complete, you should restart the PC leaving the USB connected.

If the computer does not boot automatically from the USB

If the computer does not boot automatically from the USB, you will need to access the BIOS of the computer, usually by pressing a combination of keys that appear on the screen as soon as it receives electrical power. They are usually keys like ESC or F12 or some combination like Shift + F2, depending on the manufacturer. In the BIOS, you should look for the "Boot Order" or "Boot Sequence" section to indicate that it should first check the USB, before the hard disk HD when looking for a bootable system.

If the USB runs successfully when starting the PC, the first step it requests is language selection to be used both in the interface and in the keyboard layout, as it will be essential to enter the parameters and configurations requested by the wizard during the following screens of the installation process.

In the next step, it will ask us for the type of installation to perform. It will be enough to indicate a normal installation, making sure to leave checked the options to download updates and install third-party software for graphics hardware, wifi, and multimedia formats. This last option basically installs Nvidia or ATI drivers as detected during the device identification.

This point is important because we can delete all the content of the hard drive if we are not careful. It will not be a problem if it is a clean installation, but it will be if we want to keep Windows and have both operating systems coexist. If there is only one hard drive and it is where Windows is hosted, the Windows partition must be resized to leave space, at least about 20GB, for Ubuntu. This option has its risks if you are not an advanced user, as making a wrong step can ruin your Windows data. It is advisable to make a backup before altering the content of the hard drive. Or buy a new hard drive to have the systems separated.

If you are a laptop user, you will have no choice but to delete Windows or resize the partition. If the chosen option is to resize the partition, you will easily find related documentation on how to make the partition smaller to make room for your new operating system. On the other hand, if you want to delete the Windows files, it will be enough to tell the wizard to erase the disk and proceed with the installation of Ubuntu by selecting the first option.

After creating the partitions, the Ubuntu Linux installation wizard will ask us to indicate the time zone by selecting the country and region of residence, this automatically adjusts the time taking into account possible variations in daylight saving time.

Another important step is creating the user and naming the computer, for this it will ask us to enter data in the form such as personal name as information, username, and password to enter the system using that username. And finally, the name we want to give to the PC that will be used when it is on a local network with other computers, and it will be the name by which other members of the network will see it.

Depending on the confidence of the environment where the PC will be located, automatic login can be enabled, avoiding having to enter the username and password after each PC startup.

With all the provided information, Ubuntu already has what it needs to start transferring the files from the DVD or USB to the hard drive. For a few moments, it will copy all the system files and make adjustments to the destination configuration based on the detected hardware and the parameters we have entered in the previous steps.

While the installation is in progress, useful tips and several informative messages about the possibilities of Ubuntu and the availability of widely used tools also in Windows that can be added later through the software management application included in Ubuntu will appear.

One of the last steps that the file copy performs is the installation of the boot loader or boot loader called Grub that allows choosing between several operating systems, if applicable, or the possibility of selecting different Ubuntu boot modes, for example, to activate Recovery mode.

Once the file copy is complete, the wizard will request a system restart after disconnecting the USB or ejecting the DVD. The system will restart and proceed to the login credentials screen or the initial welcome screen after installation.

At this point, the system is ready to be used. The favorite applications bar will appear on the left sidebar. The system has added many more applications that are accessible from the applications button.

At this point, it is worth following the tutorial for the initial contact with this fabulous operating system.

Useful Commands in Ubuntu

If you already have Ubuntu running on your PC, you will need to know where some important things are located and the commands needed to start using this operating system.

The first thing is to access the Terminal command, to do this you can click on the applications button or the Windows key and type 'terminal'. When you press it, a new command interpreter window (Bash) will appear, positioning the session in the user's home directory, under the path /home/<username>/. You can confirm this by typing the command pwd, which stands for print working directory. To enter a directory, use cd (change directory) indicating the name of the directory to enter or two dots to exit the current directory, cd ... With the mkdir command you can create a directory, while with rm you can delete both files and directories.

To access the help for commands explaining their options and how they should be declared, use man <command>, for example man rm. Some of them directly accept the passing of an argument (which may vary) that prints the help for the command, for example rm --help.

The following table summarizes the most important commands:

Command Description Example
man Consults the help manual for most commands.
'q' to exit
'Av Pg' to advance page
'Re Pg' to go back a page
man ls
man rm
cd Changes the working directory cd ..
cd /home
cd ../../etc/
pwd Prints the working directory pwd
cp Copies files to a different name or location cp origin.doc ../destination.doc
mkdir Creates a directory with the given name mkdir ./test
ls Lists the contents of a directory. Similar to 'dir' in Windows, lists files with detailed information ls -la
mv Moves/Renames a file to the target file mv before.doc ../after.doc
chmod Changes the permissions on a file. See the following section. Adds modify permissions for any user. 'g' for group and 'o' for others chmod go+w file.txt
chown Changes the owner and/or group of the specified files Changes the user:group of the file to the user and group eadp. chown eadp:eadp file.txt
history Prints the history of previously executed commands history
grep Searches for a string or regular expression in files or input data grep "string" file.txt
find Locates files by name with the option to use patterns Find files with .c extension from the current directory recursively find . -name *.c
gedit Opens the basic graphical text editor that comes with Ubuntu. Similar to Windows' Notepad gedit file.txt
vi Opens the basic text editor that comes with most Linux distributions within the terminal.
It is an interactive environment and requires commands to edit. For example:
i to insert text.
w to save the current content.
x to save and exit.
q! to exit without saving.
Esc to exit edit mode and enter command mode.
vi file.txt
sudo Command to execute other commands as an administrator (root), for example to edit configuration files. sudo vi /etc/hosts
apt Command to install packages from Ubuntu repositories via the terminal. sudo apt install firefox

Permissions in Unix Systems

In Unix systems like Ubuntu and Debian, permissions are defined at three levels: user (u), group (g), and others (o). And for each of these groups, you can specify actions to read (r), write (w), or execute (x). So when you run ls -la, the permissions for each file are displayed.

Permissions are summarized in three tuples with the following format:

  • ‘-’, tuples usually start with a hyphen
  • ‘r’ if the user has read permission, otherwise ‘-’
  • ‘w’ if the user has write permission, otherwise ‘-’
  • ‘x’ if the user has execute permission, otherwise ‘-’
  • ‘r’ if the group has read permission, otherwise ‘-’
  • ‘w’ if the group has write permission, otherwise ‘-’
  • ‘x’ if the group has execute permission, otherwise ‘-’
  • ‘r’ if others have read permission, otherwise ‘-’
  • ‘w’ if others have write permission, otherwise ‘-’
  • ‘x’ if others have execute permission, otherwise ‘-’

Therefore, the output of the ls -la command in any directory prints this content:

-rwxr-xr-x 1 eadp eadp    0 mar 21 14:52 programa.sh
-rw-r--rw- 1 eadp eadp    0 mar 21 14:52 texto.txt

This means that program.sh (which corresponds to a shell script, similar to a .bat file in Windows) can be read and executed by any user, but only modified by the owner user (eadp). In contrast, the file text.txt cannot be executed by anyone, but both the user and any other user can modify it, while preventing the group from modifying it.

To change the permissions of a file, use the chmod command, indicating the user group (u/g/o) followed by the symbol to allow (+) or deny (-), and the letters representing the action (r/w/x). For example:

# add write permission to group and others
chmod go+w archivo.txt

# add exec permission to all
chmod +x script.sh

# remove exec permission to others 
chmod o-x script.sh

In the TLDP Linux documentation project, there is a vast library of resources and documentation in Spanish about getting started with Unix systems, performing specific configuration tasks, and managing networks of Linux systems. For example, you can start with the reading of the Linux course in PDF.

In any case, with the commands mentioned here, you have more than enough to start programming in Java from Ubuntu.

Installing Programming Tools

From this point on, you can proceed to install the Java JDK to edit, compile, and execute a Java application. You will also need to install Maven, which greatly simplifies the building and dependency management in Java programs. Additionally, you'll need a good programming editor to simplify Java file editing tasks. Lastly, it's advisable to include the git version control system in your project to avoid losing even a comma due to errors.

Conclusions

Optimize your development experience with Ubuntu and Arteco Consulting, SL! You've already discovered why Ubuntu is the preferred choice of programmers and how it simplifies your workflow with the advantage of being an open-source operating system. Get Ubuntu right now and access a wide range of essential tools for professionals. At Arteco Consulting, SL, we help you improve your productivity and enhance your development projects. Contact us via email at info@arteco-consulting.com.

Stay Connected

Newsletter

Stay up to date with the latest in technology and business! Subscribe to our newsletter and receive exclusive updates directly to your inbox.

Online Meeting

Don't miss the opportunity to explore new possibilities. Schedule an online meeting with us today and let's start building the future of your business together!

  • :)
  • :0
  • :D
  • ;)
  • :]