1.2 Lesson 1
Certificate: |
Linux Essentials |
---|---|
Version: |
1.6 |
Topic: |
1 The Linux Community and a Career in Open Source |
Objective: |
1.2 Major Open Source Applications |
Lesson: |
1 of 1 |
Introduction
An application is a computer program whose purpose is not directly tied to the inner workings of the computer, but with tasks performed by the user. Linux distributions offer many application options to perform a variety of tasks, such as office applications, web browsers, multimedia players and editors, etc. There is often more than one application or tool to perform a particular job. It is up to the user to choose the application which best fits their needs.
Software Packages
Almost every Linux distribution offers a pre-installed set of default applications. Besides those pre-installed applications, a distribution has a package repository with a vast collection of applications available to install through its package manager. Although the various distributions offer roughly the same applications, several different package management systems exist for various distributions. For instance, Debian, Ubuntu and Linux Mint use the dpkg
, apt-get
and apt
tools to install software packages, generally referred as DEB packages. Distributions such as Red Hat, Fedora and CentOS use the rpm
, yum
and dnf
commands instead, which in turn install RPM packages. As the application packaging is different for each distribution family, it is very important to install packages from the correct repository designed to the particular distribution. The end user usually doesn’t have to worry about those details, as the distribution’s package manager will choose the right packages, the required dependencies and future updates. Dependencies are auxiliary packages needed by programs. For example, if a library provides functions for dealing with JPEG images which are used by multiple programs, this library is likely packaged in its own package on which all applications using the library depend.
The commands dpkg
and rpm
operate on individual package files. In practice, almost all package management tasks are performed by the commands apt-get
or apt
on systems that use DEB packages or by yum
or dnf
on systems that use RPM packages. These commands work with catalogues of packages, can download new packages and their dependencies, and check for newer versions of the installed packages.
Package Installation
Suppose you have heard about a command called figlet
which prints enlarged text on the terminal and you want to try it. However, you get the following message after executing the command figlet
:
$ figlet -bash: figlet: command not found
That probably means the package is not installed on your system. If your distribution works with DEB packages, you can search its repositories using apt-cache search package_name
or apt search package_name
. The apt-cache
command is used to search for packages and to list information about available packages. The following command looks for any occurrences of the term “figlet” in the package’s names and descriptions:
$ apt-cache search figlet figlet - Make large character ASCII banners out of ordinary text
The search identified a package called figlet that corresponds to the missing command. The installation and removal of a package require special permissions granted only to the system’s administrator: the user named root
. On desktop systems, ordinary users can install or remove packages by prepending the command sudo
to the installation/removal commands. That will require you to type your password to proceed. For DEB packages, the installation is performed with the command apt-get install package_name
or apt install package_name
:
$ sudo apt-get install figlet Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: figlet 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
At this point the package will be downloaded and installed on the system. Any dependencies that the package eventually needs will also be downloaded and installed:
Need to get 184 kB of archives. After this operation, 741 kB of additional disk space will be used. Get:1 http://archive.raspbian.org/raspbian stretch/main armhf figlet armhf 2.2.5-2 [184 kB] Fetched 184 kB in 0s (213 kB/s) Selecting previously unselected package figlet. (Reading database ... 115701 files and directories currently installed.) Preparing to unpack .../figlet_2.2.5-2_armhf.deb ... Unpacking figlet (2.2.5-2) ... Setting up figlet (2.2.5-2) ... update-alternatives: using /usr/bin/figlet-figlet to provide /usr/bin/figlet (figlet) in auto mode Processing triggers for man-db (2.7.6.1-2) ...
After the download is finished, all files are copied to the proper locations, any additional configuration will be performed and the command will become available:
$ figlet Awesome! _ _ / \__ _____ ___ ___ _ __ ___ ___| | / _ \ \ /\ / / _ \/ __|/ _ \| '_ ` _ \ / _ \ | / ___ \ V V / __/\__ \ (_) | | | | | | __/_| /_/ \_\_/\_/ \___||___/\___/|_| |_| |_|\___(_)
In distributions based on RPM packages, searches are performed using yum search package_name
or dnf search package_name
. Let’s say you want to display some text in a more irreverent way, followed by a cartoonish cow, but you are not sure about the package that can perform that task. As with the DEB packages, the RPM search commands accept descriptive terms:
$ yum search speaking cow Last metadata expiration check: 1:30:49 ago on Tue 23 Apr 2019 11:02:33 PM -03. ==================== Name & Summary Matched: speaking, cow ==================== cowsay.noarch : Configurable speaking/thinking cow
After finding a suitable package at the repository, it can be installed with yum install package_name
or dnf install package_name
:
$ sudo yum install cowsay Last metadata expiration check: 2:41:02 ago on Tue 23 Apr 2019 11:02:33 PM -03. Dependencies resolved. ============================================================================== Package Arch Version Repository Size ============================================================================== Installing: cowsay noarch 3.04-10.fc28 fedora 46 k Transaction Summary ============================================================================== Install 1 Package Total download size: 46 k Installed size: 76 k Is this ok [y/N]: y
Once again, the desired package and all its possible dependencies will be downloaded and installed:
Downloading Packages: cowsay-3.04-10.fc28.noarch.rpm 490 kB/s | 46 kB 00:00 ============================================================================== Total 53 kB/s | 46 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : cowsay-3.04-10.fc28.noarch 1/1 Running scriptlet: cowsay-3.04-10.fc28.noarch 1/1 Verifying : cowsay-3.04-10.fc28.noarch 1/1 Installed: cowsay.noarch 3.04-10.fc28 Complete!
The command cowsay
does exactly what its name implies:
$ cowsay "Brought to you by yum" _______________________ < Brought to you by yum > ----------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
Although they may seem useless, commands figlet
and cowsay
provide a way to draw the attention of other users to relevant information.
Package Removal
The same commands used to install packages are used to remove them. All the commands accept the remove
keyword to uninstall an installed package: apt-get remove package_name
or apt remove package_name
for DEB packages and yum remove package_name
or dnf remove package_name
for RPM packages. The sudo
command is also needed to perform the removal. For example, to remove the previously installed package figlet from a DEB-based distribution:
$ sudo apt-get remove figlet Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: figlet 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 741 kB disk space will be freed. Do you want to continue? [Y/n] Y
After confirming the operation, the package is erased from the system:
(Reading database ... 115775 files and directories currently installed.) Removing figlet (2.2.5-2) ... Processing triggers for man-db (2.7.6.1-2) ...
A similar procedure is performed on an RPM-based system. For example, to remove the previously installed package cowsay from an RPM-based distribution:
$ sudo yum remove cowsay Dependencies resolved. ================================================================================== Package Arch Version Repository Size ================================================================================== Removing: cowsay noarch 3.04-10.fc28 @fedora 76 k Transaction Summary ================================================================================== Remove 1 Package Freed space: 76 k Is this ok [y/N]: y
Likewise, a confirmation is requested and the package is erased from the system:
Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Erasing : cowsay-3.04-10.fc28.noarch 1/1 Running scriptlet: cowsay-3.04-10.fc28.noarch 1/1 Verifying : cowsay-3.04-10.fc28.noarch 1/1 Removed: cowsay.noarch 3.04-10.fc28 Complete!
The configuration files of the removed packages are kept on the system, so they can be used again if the package is reinstalled in the future.
Office Applications
Office applications are used for editing files such as texts, presentations, spreadsheets and other formats commonly used in an office environment. These applications are usually organised in collections called office suites.
For a long time, the most used office suite in Linux was the OpenOffice.org suite. OpenOffice.org was an open source version of the StarOffice suite released by Sun Microsystems. A few years later Sun was acquired by Oracle Corporation, which in turn transferred the project to the Apache Foundation and OpenOffice.org was renamed to Apache OpenOffice. Meanwhile, another office suite based on the same source code was released by the Document Foundation, which named it LibreOffice.
The two projects have the same basic features and are compatible with the document formats from Microsoft Office. However, the preferred document format is the Open Document Format, a fully open and ISO standardized file format. The use of ODF files ensures that documents can be transferred between operating systems and applications from different vendors, such as Microsoft Office. The main applications offered by OpenOffice/LibreOffice are:
- Writer
-
Text editor
- Calc
-
Spreadsheets
- Impress
-
Presentations
- Draw
-
Vector drawing
- Math
-
Math formulas
- Base
-
Database
Both LibreOffice and Apache OpenOffice are open source software, but LibreOffice is licensed under LGPLv3 and Apache OpenOffice is licensed under Apache License 2.0. The licensing distinction implies that LibreOffice can incorporate improvements made by Apache OpenOffice, but Apache OpenOffice cannot incorporate improvements made by LibreOffice. That, and a more active community of developers, are the reason most distributions adopt LibreOffice as their default office suite.
Web Browsers
For most users, the main purpose of a computer is to provide access to the Internet. Nowadays, web pages can act as a full featured app, with the advantage of being accessible from anywhere, without the need of installing extra software. That makes the web browser the most important application of the operating system, at least for the average user.
Tip
|
One of the best sources for learning about web development is the MDN Web Docs, available at https://developer.mozilla.org/. Maintained by Mozilla, the site is full of tutorials for beginners and reference materials on most modern web technologies. |
The main web browsers in the Linux environment are Google Chrome and Mozilla Firefox. Chrome is a web browser maintained by Google but is based on the open source browser named Chromium, which can be installed using the distribution’s package manager and is fully compatible with Chrome. Maintained by Mozilla, a non-profit organization, Firefox is a browser whose origins are linked to Netscape, the first popular web browser to adopt the open source model. The Mozilla Foundation is deeply involved with the development of the open standards underlying the modern web.
Mozilla also develops other applications, like the e-mail client Thunderbird. Many users opt to use webmail instead of a dedicated email application, but a client like Thunderbird offers extra features and integrates best with other applications on the desktop.
Multimedia
Compared to the available web applications, desktop applications are still the best option for the creation of multimedia content. Multimedia related activities like video rendering often require high amounts of system resources, which are best managed by a local desktop application. Some of the most popular multimedia applications for the Linux environment and their uses are listed below.
- Blender
-
A 3D renderer to create animations. Blender can also be used to export 3D objects to be printed by a 3D printer.
- GIMP
-
A full-featured image editor, which can be compared with Adobe Photoshop, but has its own concepts and tools to work with images. GIMP can be used to create, edit and save most bitmap files, like JPEG, PNG, GIF, TIFF and many others.
- Inkscape
-
A vector graphics editor, similar to Corel Draw or Adobe Illustrator. Inkscape’s default format is SVG, which is an open standard for vector graphics. SVG files can be opened by any web browser and, due to its nature as a vector graphic, it can be used in flexible layouts of web pages.
- Audacity
-
An audio editor. Audacity can be used to filter, to apply effects and to convert between many different audio formats, like MP3, WAV, OGG, FLAC, etc.
- ImageMagick
-
ImageMagick is a command line tool to convert and edit most image file types. It can also be used to create PDF documents from image files and vice versa.
There are also many applications dedicated to multimedia playback. The most popular application for video playback is VLC, but some users prefer other alternatives, like smplayer. Local music playback also has many options, like Audacious, Banshee and Amarok, which can also manage a collection of local sound files.
Server Programs
When a web browser loads a page from a website, it actually connects to a remote computer and asks for a specific piece of information. In that scenario, the computer running the web browser is called the client and the remote computer is called the server.
The server computer, which can be an ordinary desktop computer or specialized hardware, needs a specific program to manage each type of information it will provide. Regarding serving web pages, most servers around the world deploy open source server programs. This particular server program is called an HTTP server (HTTP stands for Hyper Text Transfer Protocol) and the most popular ones are Apache, Nginx and lighttpd.
Even simple web pages may require many requests, which can be ordinary files — called static content — or dynamic content rendered from various sources. The role of an HTTP server is to collect and send all the requested data back to the browser, which then arranges the content as defined by the received HTML document (HTML stands for Hyper Text Markup Language) and other supporting files. Therefore, the rendering of a web page involves operations performed on the server side and operations performed on the client side. Both sides can use custom scripts to accomplish specific tasks. On the HTTP server side, it is quite common to use the PHP scripting language. JavaScript is the scripting language used on the client side (the web browser).
Server programs can provide all kinds of information. It’s not uncommon to have a server program requesting information provided by other server programs. That is the case when an HTTP server requires information provided by a database server.
For instance, when a dynamic page is requested, the HTTP server usually queries a database to collect all the required pieces of information and sends the dynamic content back to the client. In a similar way, when a user registers on a website, the HTTP server gathers the data sent by the client and stores it in a database.
A database is an organized set of information. A database server stores contents in a formatted fashion, making it possible to read, write and link large amounts of data reliably and at great speed. Open source database servers are used in many applications, not only on the Internet. Even local applications can store data by connecting to a local database server. The most common type of database is the relational database, where the data is organized in predefined tables. The most popular open source relational databases are MariaDB (originated from MySQL) and PostgreSQL.
Data Sharing
In local networks, like the ones found in offices and homes, it is desirable that computers not only should be able to access the Internet, but also should be able to communicate with each other. Sometimes a computer acts as a server, sometimes the same computer acts as a client. That is necessary when one wants to access files on another computer in the network — for instance, access a file stored on a desktop computer from a portable device — without the hassle of copying it to a USB drive or the like.
Between Linux machines, NFS (Network File System) is often used. The NFS protocol is the standard way to share file systems in networks equipped only with Unix/Linux machines. With NFS, a computer can share one or more of its directories with specific computers on the network, so they can read and write files in these directories. NFS can even be used to share an entire operating system’s directory tree with clients that will use it to boot from. These computers, called thin clients, are mostly often used in large networks to avoid the maintenance of each individual operating system on each machine.
If there are other types of operating systems attached to the network, it is recommended to use a data sharing protocol that can be understood by all of them. This requirement is fulfilled by Samba. Samba implements a protocol for sharing files over the network originally made for the Windows operating system, but today is compatible with all major operating systems. With Samba, computers in the local network not only can share files, but also printers.
On some local networks, the authorization given upon login on a workstation is granted by a central server, called the domain controller, which manages the access to various local and remote resources. The domain controller is a service provided by Microsoft’s Active Directory. Linux workstations can associate with a domain controller by using Samba or an authentication subsystem called SSSD. As of version 4, Samba can also work as a domain controller on heterogeneous networks.
If the goal is to implement a cloud computing solution able to provide various methods of web based data sharing, two alternatives should be considered: ownCloud and Nextcloud. The two projects are very similar because Nextcloud is a spin-off of ownCloud, which is not unusual among open source projects. Such spin-offs are usually called a fork. Both provide the same basic features: file sharing and sync, collaborative workspaces, calendar, contacts and mail, all through desktop, mobile and web interfaces. Nextcloud also provides private audio/video conferencing, whilst ownCloud is more focused on file sharing and integration with third-party software. Many more features are provided as plugins which can be activated later as needed.
Both ownCloud and Nextcloud offer a paid version with extra features and extended support. What makes them different from other commercial solutions is the ability to install Nextcloud or ownCloud on a private server, free of charge, avoiding keeping sensitive data on an unknown server. As all the services depend on HTTP communication and are written in PHP, the installation must be performed on a previous configured web server, like Apache. If you consider installing ownCloud or Nextcloud on your own server, make sure to also enable HTTPS to encrypt all connections to your cloud.
Network Administration
Communication between computers is only possible if the network is working correctly. Normally, the network configuration is done by a set of programs running on the router, responsible for setting up and checking the network availability. In order to achieve this, two basic network services are used: DHCP (Dynamic Host Configuration Protocol) and DNS (Domain Name System).
DHCP is responsible for assigning an IP address to the host when a network cable is connected or when the device enters a wireless network. When connecting to the Internet, the ISP’s DHCP server will provide an IP address to the requesting device. A DHCP server is very useful in local area networks also, to automatically provide IP addresses to all connected devices. If DHCP is not configured or if it’s not working properly, it would be necessary to manually configure the IP address of each device connected to the network. It is not practical to manually set the IP addresses on large networks or even in small networks, that’s why most network routers come with a DHCP server pre-configured by default.
The IP address is required to communicate with another device on an IP network, but domain names like www.lpi.org
are much more likely to be remembered than an IP number like 203.0.113.165
. The domain name by itself, however, is not enough to establish the communication through the network. That is why the domain name needs to be translated to an IP address by a DNS server. The IP address of the DNS server is provided by the ISP’s DHCP server and it’s used by all connected systems to translate domain names to IP addresses.
Both DHCP and DNS settings can be modified by entering the web interface provided by the router. For instance, it is possible to restrict the IP assignment only to known devices or associate a fixed IP address to specific machines. It’s also possible to change the default DNS server provided by the ISP. Some third-party DNS servers, like the ones provided by Google or OpenDNS, can sometimes provide faster responses and extra features.
Programming Languages
All computer programs (client and server programs, desktop applications and the operating system itself) are made using one or more programming languages. Programs can be a single file or a complex system of hundreds of files, which the operating system treats as an instruction sequence to be interpreted and performed by the processor and other devices.
There are numerous programming languages for very different purposes and Linux systems provide a lot of them. Since open source software also includes the sources of the programs, Linux systems offer developers perfect conditions to understand, modify or create software according to their own needs.
Every program begins as a text file, called source code. This source code is written in a more or less human-friendly language that describes what the program is doing. A computer processor can not directly execute this code. In compiled languages, the source code is therefore be converted to a binary file which can then be executed by the computer. A program called compiler is responsible for doing the conversion from source code to executable form. Since the compiled binary is specific to one kind of processor, the program might have to be re-compiled to run on another type of computer.
In interpreted languages, the program does not need to be previously compiled. Instead, an interpreter reads the source code and executes its instruction every time the program is run. This makes the development easier and faster, but at the same time interpreted programs tend to be slower than compiled programs.
Here some of the most popular programming languages:
- JavaScript
-
JavaScript is a programming language mostly used in web pages. In its origins, JavaScript applications were very simple, like form validation routines. As for today, JavaScript is considered a first class language and it is used to create very complex applications not only on the web, but on servers and mobile devices.
- C
-
The C programming language is closely related with operating systems, particularly Unix, but it is used to write any kind of program to almost any kind of device. The great advantages of C are flexibility and speed. The same source code written in C can be compiled to run in different platforms and operating systems, with little or no modification. After being compiled, however, the program will run only in the targeted system.
- Java
-
The main aspect of Java is that programs written in this language are portable, which means that the same program can be executed in different operating systems. Despite the name, Java is not related to JavaScript.
- Perl
-
Perl is a programming language most used to process text content. It has a strong regular expressions emphasis, which makes Perl a language suited for text filtering and parsing.
- Shell
-
The shell, particularly the Bash shell, is not just a programming language, but an interactive interface to run other programs. Shell programs, known as shell scripts, can automate complex or repetitive tasks on the command line environment.
- Python
-
Python is a very popular programming language among students and professionals not directly involved with computer science. Whilst having advanced features, Python is a good way to start learning programming for its easy to use approach.
- PHP
-
PHP is most used as a server side scripting language for generating content for the web. Most online HTML pages are not static files, but dynamic content generated by the server from various sources, like databases. PHP programs — sometimes just called PHP pages or PHP scripts — are often used to generate this kind of content. The term LAMP comes from the combination of a Linux operating system, an Apache HTTP server, a MySQL (or MariaDB) database and PHP programming. LAMP servers are a very popular solution for running web servers. Besides PHP, all of the programming languages described before can be used to implement such applications too.
C and Java are compiled languages. In order to be executed by the system, source code written in C is converted to binary machine code, whereas Java source code is converted to bytecode executed in a special software environment called Java Virtual Machine. JavaScript, Perl, Shell script, Python and PHP are all interpreted languages, which are also called scripting languages.
Guided Exercises
-
For each of the following commands, identify whether it is associated with the Debian packaging system or the Red Hat packaging system:
dpkg
rpm
apt-get
yum
dnf
-
Which command could be used to install Blender on Ubuntu? After installation, how can the program be executed?
-
Which application from the LibreOffice suite can be used to work with electronic spreadsheets?
-
Which open-source web browser is used as the basis for the development of Google Chrome?
-
SVG is an open standard for vector graphics. Which is the most popular application for editing SVG files in Linux systems?
-
For each of the following file formats, write the name of an application able to open and edit the corresponding file:
png
doc
xls
ppt
wav
-
Which software package allows file sharing between Linux and Windows machines over the local network?
Explorational Exercises
-
You know that configuration files are kept even if the associated package is removed from the system. How could you automatically remove the package named cups and its configuration files from a DEB based system?
-
Suppose you have many TIFF image files and want to convert them to JPEG. Which software package could be used to convert those files directly at the command line?
-
Which software package do you need to install in order to be able to open Microsoft Word documents sent to you by a Windows user?
-
Every year, linuxquestions.org promotes a survey about the most popular Linux applications. Visit https://www.linuxquestions.org/questions/2018-linuxquestions-org-members-choice-awards-128/ and find out which desktop applications are most popular among experienced Linux users.
Summary
In this lesson, you learned:
-
The package management systems used in major Linux distributions
-
Open source applications that can edit popular file formats
-
The server programs underlying many important Internet and local network services
-
Common programming languages and their uses
Answers to Guided Exercises
-
For each of the following commands, identify whether it is associated with the Debian packaging system or the Red Hat packaging system:
dpkg
Debian packaging system
rpm
Red Hat packaging system
apt-get
Debian packaging system
yum
Red Hat packaging system
dnf
Red Hat packaging system
-
Which command could be used to install Blender on Ubuntu? After installation, how can the program be executed?
The command
apt-get install blender
. The package name should be specified in lowercase. The program can be executed directly from the terminal with the commandblender
or by choosing it on the applications menu. -
Which application from the LibreOffice suite can be used to work with electronic spreadsheets?
Calc
-
Which open-source web browser is used as the basis for the development of Google Chrome?
Chromium
-
SVG is an open standard for vector graphics. Which is the most popular application for editing SVG files in Linux systems?
Inkscape
-
For each of the following file formats, write the name of an application able to open and edit the corresponding file:
png
Gimp
doc
LibreOffice Writer
xls
LibreOffice Calc
ppt
LibreOffice Impress
wav
Audacity
-
Which software package allows file sharing between Linux and Windows machines over the local network?
Samba
Answers to Explorational Exercises
-
You know that configuration files are kept even if the associated package is removed from the system. How could you automatically remove the package named cups and its configuration files from a DEB based system?
apt-get purge cups
-
Suppose you have many TIFF image files and want to convert them to JPEG. Which software package could be used to convert those files directly at the command line?
ImageMagick
-
Which software package do you need to install in order to be able to open Microsoft Word documents sent to you by a Windows user?
LibreOffice or OpenOffice
-
Every year, linuxquestions.org promotes a survey about the most popular Linux applications. Visit https://www.linuxquestions.org/questions/2018-linuxquestions-org-members-choice-awards-128/ and find out which desktop applications are most popular among experienced Linux users.
Browser: Firefox. Email client: Thunderbird. Media player: VLC. Raster graphics editor: GIMP.