0% found this document useful (0 votes)
36 views27 pages

Ubuntu

Uploaded by

markdkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views27 pages

Ubuntu

Uploaded by

markdkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Ubuntu

#ubuntu
Table of Contents
About 1

Chapter 1: Getting started with Ubuntu 2

Remarks 2

What is Ubuntu? 2

Why use Ubuntu for development? 2

Ubuntu is the world's most popular open source OS for development 2

Versions 2

Version Last-Modified Name 2

Examples 3

Installation or Setup 3

What is Ubuntu 3

Installation 3

Keeping Ubuntu and your packages up to date 4

Chapter 2: Apache Server 6

Examples 6

Php 5.6 with Apache 2 Server on Ubuntu 16.04 6

Chapter 3: Basic Terminal commands 8

Remarks 8

Examples 8

Changing password of current user 8

Adding new user 9

!! 9

List files and folders 10

Restart Ubuntu 11

Install new software 11

APT and APT-GET 11

DPKG 12

Reading a text file 12

Search the exact name of a packet for apt-get 14

Limit output to lines with the desired string 14


Compress files and folders using the tar command 15

Chapter 4: Networking 16

Examples 16

Set proxy from CLI 16

Show network interfaces 16

Configure network interface from CLI 16

Chapter 5: Set up SSL 18

Remarks 18

Examples 18

Set up ssl for local testing in apache 18

Chapter 6: Software Installation 20

Syntax 20

Parameters 20

Examples 20

Install software using APT 20

List all installed packages 21

Chapter 7: Support lifespan 22

Remarks 22

Examples 22

Currently supported releases 22

Credits 24
About
You can share this PDF with anyone you feel could benefit from it, downloaded the latest version
from: ubuntu

It is an unofficial and free Ubuntu ebook created for educational purposes. All the content is
extracted from Stack Overflow Documentation, which is written by many hardworking individuals at
Stack Overflow. It is neither affiliated with Stack Overflow nor official Ubuntu.

The content is released under Creative Commons BY-SA, and the list of contributors to each
chapter are provided in the credits section at the end of this book. Images may be copyright of
their respective owners unless otherwise specified. All trademarks and registered trademarks are
the property of their respective company owners.

Use the content presented in this book at your own risk; it is not guaranteed to be correct nor
accurate, please send your feedback and corrections to [email protected]

https://riptutorial.com/ 1
Chapter 1: Getting started with Ubuntu
Remarks
What is Ubuntu?

Ubuntu is an open source software platform that runs everywhere from the smartphone, the tablet
and the PC to the server and the cloud.

Why use Ubuntu for development?

• The fastest route from development to deployment on desktop, mobile, server or cloud
• The desktop of choice for developers at some of the world's leading technology companies
• The broadest and best development tools and libraries
• Lightweight to either run natively or in a VM, on a PC or a Mac
• Ideal for any resource-intensive environment

Ubuntu is the world's most popular open source OS for development

Ubuntu is used by thousands of development teams around the world because of its versatility,
reliability, constantly updated features, and extensive developer libraries.

If you're managing developers, Ubuntu is the best way to increase your team's productivity and
guarantee a smooth transition from development all the way to production. Ubuntu is the world’s
most popular open source OS for both development and deployment, from the data centre to the
cloud.

And, as the Ubuntu OS converges, these same applications will be able to run on desktop, tablets,
phone and even on the Internet of Things — one application across Ubuntu's full range of devices.

Source: www.ubuntu.com → Ubuntu Desktop for developers

Versions

Version Last-Modified Name


12.04.5 03-Jun-2015 21:11 Ubuntu 12.04.5 LTS (Precise Pangolin)

12.04 03-Jun-2015 21:11 Ubuntu 12.04.5 LTS (Precise Pangolin)

14.04.4 04-Aug-2016 20:46 Ubuntu 14.04.5 LTS (Trusty Tahr)

14.04.5 04-Aug-2016 20:46 Ubuntu 14.04.5 LTS (Trusty Tahr)

14.04 04-Aug-2016 20:46 Ubuntu 14.04.5 LTS (Trusty Tahr)

https://riptutorial.com/ 2
15.04 22-Apr-2016 13:55 Ubuntu 15.04 (Vivid Vervet)

16.04.1 04-Aug-2016 23:13 Ubuntu 16.04.1 LTS (Xenial Xerus)

16.04 04-Aug-2016 23:13 Ubuntu 16.04.1 LTS (Xenial Xerus)

16.10 13-Oct-2016 14:54 Ubuntu 16.10 (Yakkety Yak)

precise 03-Jun-2015 21:11 Ubuntu 12.04.5 LTS (Precise Pangolin)

trusty 04-Aug-2016 20:46 Ubuntu 14.04.5 LTS (Trusty Tahr)

vivid 22-Apr-2016 13:55 Ubuntu 15.04 (Vivid Vervet)

xenial 04-Aug-2016 23:13 Ubuntu 16.04.1 LTS (Xenial Xerus)

yakkety 13-Oct-2016 14:54 Ubuntu 16.10 (Yakkety Yak)

Examples
Installation or Setup

What is Ubuntu

Ubuntu is an open source software platform, but colloquially, when Ubuntu is referred to it's mainly
toward the Ubuntu operating system. Ubuntu is based on Debian and uses the same package
management system (deb and apt).

Installation

So you want to give Ubuntu a try! That's great. First off, let's grab the Ubuntu .iso file that you'll be
needing to install the operating system on your system. Note, an .iso file is an image file that we
can burn to a USB/CD. Think of it as a snapshot of the Ubuntu Operating System that we'll burn
onto some media disk.

• Head over to Ubuntu's download page Here


• Grab an .iso to USB burner.
○Pendrivelinux is a popular choice
○Rufus is another popular alternative
• Load up whichever program and load in the .iso file.
• Burn the image to the USB (be careful you choose the correct USB!)
• Once the burn is complete, eject safely
• Plug the USB into the system that you wan't to install Ubuntu on, flip the switch and follow
the on screen instructions

https://riptutorial.com/ 3
Keeping Ubuntu and your packages up to date

Once you installed Ubuntu, you might want to get the latest patches and updates. Using Ubuntu's
easy to use package manager Aptitude, the OS along with all future packages that is installed
using this manner can be kept up to date.

1. Download the latest package lists by refreshing information from the repositories: sudo apt-
get update

2. Then proceed to run the following command to review which packages can upgraded: sudo
apt-get upgrade

3. Assuming you are satisfied with the lists of packages that can be upgraded, enter y to start
the installation process.

Also you could just hit enter, when presented with a choice the capitalized choice is the default,
and is selected if you hit enter and type nothing.

https://riptutorial.com/ 4
Read Getting started with Ubuntu online: https://riptutorial.com/ubuntu/topic/848/getting-started-
with-ubuntu

https://riptutorial.com/ 5
Chapter 2: Apache Server
Examples
Php 5.6 with Apache 2 Server on Ubuntu 16.04

This tutorial will guide you through the process from scratch. Please note some preliminary notes
about this particular setup, useful in case that you already have some requested package:

• Is needed a version of php >=5.0 (I had troubles with php 7.0)


• Is requested any version of perl
• Is needed a version of Apache that supports php scripting

sudo apt-get update


sudo apt-get install perl apache2 zip gzip tar
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php5.6 libapache2-mod-php5.6 php5.6-curl php5.6-gd php5.6-mbstring php5.6-
mcrypt php5.6-mysql php5.6-xml php5.6-xmlrpc

If you need to disable php 7.0 (or any different version) before proceeding, do the following:

a2dismod php7.0

Then proceed with:

a2enmod php5.6

That last command should give 'enabled' or 'already enabled' as output!

If you are installing it under a virtual machine on VMware, please do the following:

sudo apt-get install open-vm-tools

Now restart Apache:

service apache2 restart

Now Apache is installed and configured for php. Try to open a Browser and type localhost, it
should display the test page for Apache.

To change the timezone for php, open the following file

sudo vim /etc/php/5.6/apache2/php.ini

And edit as following, uncommenting and editing with the timezone that you prefer:

https://riptutorial.com/ 6
date.timezone = Europe/Rome

Extra step 1

If you are installing a tarball (tar.gz) on Apache, unzip it into /var/www/html (it's the default root
location)

sudo cp tarball.tar.gz /var/www/html/


cd /var/www/html/
sudo tar -zxf tarball.tar.gz

Extra step 2

Please note that you may also need to change permissions to www-data, because default
permissions are to root and this can give some writing issues.

sudo chown -R www-data:www-data /var/www/

Read Apache Server online: https://riptutorial.com/ubuntu/topic/5194/apache-server

https://riptutorial.com/ 7
Chapter 3: Basic Terminal commands
Remarks
How to exract tar.gz/bz2/tbz files :

If Your File Extension is .tar.gz (or .tgz) use this command

tar xvzf file.tar.gz

• x: This tells tar to extract the files.

• v: This option will list all of the files one by one in the archive. The “v” stands for “verbose.”

• z: The z option is very important and tells the tar command to uncompress the file (gzip).

• f: This options tells tar that you are going to give it a file name to work with.

** If Your File Extension is .tar.bz2 (or .tbz)**

The major difference between these two is that the z option has been replaced by the j option.

• j: This will decompress a bzip2 file.

Examples
Changing password of current user

To change password of current user just type:

sudo passwd

It will ask you to enter your current password:

[sudo] password for <user>:

And then you will be asked to enter new password:

Enter new UNIX password:

And finally you will be asked to re-enter your password:

Retype new UNIX password:

Note: By default, the keys you press at a command-line password prompt are not displayed at all.
They are, however, still registered.

https://riptutorial.com/ 8
Adding new user

adduser command adds a user to the system. In order to add a new user type:

sudo adduser <user_name>

example:

sudo adduser tom

After typing the above command, you will be prompted to enter details about the new user, such
as new password, user Full name, etc.

Below is the information that user will be asked to fill in order to add a new user:

Enter new UNIX password:


Retype new UNIX password:
passwd: password updated successfully
Changing the user information for tom
Enter the new value, or press ENTER for the default
Full Name []: Test User
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

!!

(read as bangbang) is a shortcut to repeat the last command entered in console. It is especially
useful to run previous command with some changes

adduser tom

adduser: Only root may add a user or group to the system.

Oh snap, what now? Well you could retype the command with sudo in front or you could try

sudo !!

equivalent to sudo "previous command entered"

This is especially useful if the command you just typed is especially long.

It can also be used to change a part of previous commands

cd path/to/wrong/directory

With

https://riptutorial.com/ 9
!!:s/wrong/right/

Will do

cd path/to/right/directory

List files and folders

To list files and folders inside current directory, we use ls command:

user@host:/$ ls
bin boot cdrom dev etc home initrd.img lib lib64 lost+found
media mnt opt proc root run sbin srv sys tmp usr var vmlinuz

ls prints folder structure in simple view, color coded by type. The Ubuntu default colors for ls are:

blue for directories, green for executable files, sky blue for linked files, yellow with a black
background for devices, pink for image files, and red for archive files.

ls -la will print folder structure with additional info:

user@host:/$ ls -la
total 104
drwxr-xr-x 23 root root 4096 јул 25 12:40 .
drwxr-xr-x 23 root root 4096 јул 25 12:40 ..
drwxr-xr-x 2 root root 4096 јул 25 12:42 bin
drwxr-xr-x 4 root root 4096 јул 25 12:42 boot
drwxrwxr-x 2 root root 4096 јул 25 12:38 cdrom
drwxr-xr-x 16 root root 4300 јул 30 12:18 dev
drwxr-xr-x 134 root root 12288 јул 30 12:18 etc
drwxr-xr-x 5 root root 4096 јул 25 12:50 home
lrwxrwxrwx 1 root root 33 јул 25 12:40 initrd.img -> boot/initrd.img-3.19.0-39-generic
drwxr-xr-x 23 root root 4096 јул 25 12:42 lib
drwxr-xr-x 2 root root 4096 дец 9 2015 lib64
drwx------ 2 root root 16384 јул 25 12:32 lost+found
drwxr-xr-x 3 root root 4096 јул 25 14:56 media
drwxr-xr-x 2 root root 4096 апр 11 2014 mnt
drwxr-xr-x 3 root root 4096 јул 25 13:37 opt
dr-xr-xr-x 227 root root 0 јул 30 12:18 proc
drwx------ 2 root root 4096 јул 25 13:06 root
drwxr-xr-x 23 root root 780 јул 31 14:30 run
drwxr-xr-x 2 root root 12288 јул 25 12:46 sbin
drwxr-xr-x 2 root root 4096 дец 8 2015 srv
dr-xr-xr-x 13 root root 0 јул 30 12:18 sys
drwxrwxrwt 8 root root 4096 јул 31 16:05 tmp
drwxr-xr-x 10 root root 4096 дец 8 2015 usr
drwxr-xr-x 13 root root 4096 дец 9 2015 var
lrwxrwxrwx 1 root root 30 јул 25 12:40 vmlinuz -> boot/vmlinuz-3.19.0-39-generic

Another shortcut for ls -la is ll. However, this is not a builtin command. Rather its an alias
common in ubuntu systems, in full its ls -laF. The alias will give you the same output as ls -la,
but with additional slash (/) at the end of each folder, to help you with easier folder identification.

The ll alias can be viewed in full by typing alias ll. As illustrated below. If the alias is not set then

https://riptutorial.com/ 10
the command will give an error.

vagrant@host ~ ->>
08:05 AM Mon Sep 12$ alias ll
alias ll='ls -alF'

Restart Ubuntu

You can restart ubuntu from command line. Below is example of restarting ubuntu immediately.

sudo reboot

You need to have sudo privilege in order to use this command.

Another commands with same results are sudo shutdown -r now and sudo init 6.

Install new software

APT and APT-GET


Easiest and fastest way is with apt-get command. This command may be considered as lower-
level and "back-end", and support other APT-based tools. There are no fancy loaders, only basic
progress info. This is fastest way for installing apps.

Usage:

sudo apt-get install deluge openssh-server

This command will install two new apps: deluge and openssh-server. You can install as many
apps as you want in only one line of commands.

"Fancy" way of the same process is wits apt:

sudo apt install deluge openssh-server

Result is the same, but interaction with users is different from previous command. apt is designed
for end-users (human) and it's output may be changed between versions.

Both commands will handle dependencies automatically.

user@host:~$ sudo apt install vlc


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libtimezonemap1 sbsigntool
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libbasicusageenvironment0 libcddb2 libcrystalhd3 libdvbpsi8 libebml4
libfreerdp1 libgnutls28 libgroupsock1 libhogweed2 libiso9660-8
liblivemedia23 libmatroska6 libproxy-tools libresid-builder0c2a libsidplay2

https://riptutorial.com/ 11
libssh2-1 libtar0 libupnp6 libusageenvironment1 libva-x11-1 libvcdinfo0
libvlc5 libvlccore7 libxcb-composite0 libxcb-keysyms1 libxcb-randr0
libxcb-xv0 vlc-data vlc-nox vlc-plugin-notify vlc-plugin-pulse
Suggested packages:
firmware-crystalhd freerdp-x11 gnutls-bin videolan-doc
Recommended packages:
libdvdcss2
The following NEW packages will be installed:
libbasicusageenvironment0 libcddb2 libcrystalhd3 libdvbpsi8 libebml4
libfreerdp1 libgnutls28 libgroupsock1 libhogweed2 libiso9660-8
liblivemedia23 libmatroska6 libproxy-tools libresid-builder0c2a libsidplay2
libssh2-1 libtar0 libupnp6 libusageenvironment1 libva-x11-1 libvcdinfo0
libvlc5 libvlccore7 libxcb-composite0 libxcb-keysyms1 libxcb-randr0
libxcb-xv0 vlc vlc-data vlc-nox vlc-plugin-notify vlc-plugin-pulse
0 upgraded, 32 newly installed, 0 to remove and 308 not upgraded.
Need to get 10,5 MB of archives.
After this operation, 51,7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

DPKG
dpkgstands for Debian Package. This is basic, low-level package installer for Debian and other
Debian derivatives. dpkg have many options, but we are interested in -i, which stands for install.

sudo dpkg -i google-chrome-stable.deb

You can install .deb packages with dpkg.

If you get an error while installing .deb package, in most cases you don't have some
dependencies. To get rid of this error and install app correctly, run sudo apt-get -f install without
any other parameter. This will search for dependencies and install them before .deb. Installation
will continue and app will be installed.

Reading a text file

Using Ubuntu you have different ways to read a text file, all similar but useful in different context.

cat

This is the simplest way to read a text file; it simply output the file content inside the terminal. Be
careful: if the file is huge, it could take some time to complete the printing process! If you need to
stop it, you can always press CTRL+C. Note that if you need to navigate through the document, you
need to scroll the terminal output.

cat file_name.txt

more

An improved version of cat. If your file is longer than the display of the terminal, you can simply
type

https://riptutorial.com/ 12
more file_name.txt

and you'll have a downwards scrolling display of text, in which you can move down by pressing
ENTER.

less

This is the more command with some enhancements, and is typically a better choice than cat for
reading medium to big documents. It opens file showing them from the beginning, allowing to
scroll up/down/right/left using arrows.

less file_name.txt

Once the document is open, you can type some commands to enable some useful features, such
as:

• q:
close immediately the opened file.
• /word: search 'word' inside the document. Pressing n you can go to the following occurrence
of 'word'.
• ENTER: scrolls down of a single line.
• r: repaints the file content, if it's changing while reading.

This is the best choice for reading medium to big documents.

tail

This software shows only the last part of the file. It's useful if you need to read just a few lines in
the end of a very big document.

tail file_name.txt

The above command will show last 10 lines(default) of the file. To read last 3 lines, we need to
write:

tail -3 file_name.txt

There's another use case where this command is extremely useful. Imagine to have a empty
document, that is filled while you are watching it; if you want to see new lines in real time while
they are written to the file without reopening it, just open the file with the -f option. It's really useful
if you are watching some logs, for example.

tail -f file_name.txt

This is the best choice for reading growing documents.

head

This command does the opposite task of tail. For example the following command will show the

https://riptutorial.com/ 13
first 15 lines of the file file_name.txt.

head -15 file_name.txt

tailf

This is an alternative for tail -f filename .It follows the file changes as they occur and shows you
the output.

vim

Some of us like vi, some others like vim. This is not just for reading files, you can also edit them!
Now let's see only some features that regards reading documents. Please note that vim offers
syntax highlighting.

vim file_name.txt

Once the file is opened, be careful! Don't start typing, or you will mess everything up! In fact, even
if you can see the cursor, you have to press i to start typing and ESC after you finished typing. By
the way, now I'm going to showing you some useful commands that concern reading (not writing):

• : : you need to type colon before inserting each of the following commands!
• q! : exit from the file without asking a confirm. It's the same as q if you didn't edit the text.
• /word : search for 'word' inside the document.
• 230 : goes to line '230'.

Tip: a shortcut to insert a colon and then type wq! for writing edits to file and quit without asking a
confirm, you can hold down SHIFT and press twice z.

This is the best choice for reading code files.

Search the exact name of a packet for apt-get

If you know you need a packet <packet>, but you don't know the exact name <packet-exact-
name>, instead of searching with Google try with the following:

sudo apt-get update


apt-cache search <packet>

This will return you a list of packets name with a description. Once you have identified the exact
packet name <packet-exact-name> install it normally:

sudo apt-get install <packet-exact-name>

Limit output to lines with the desired string

If you are running a command that returns hundreds of lines, but your interest is just on the lines
that contains the word <word>, you should definitely use grep! For example try running:

https://riptutorial.com/ 14
ifconfig -a

Check the output, that could be only a few lines or quite long, if you have a server with multiple
network interfaces. To show (for example purpose) only the lines that contain 'HWaddr', try using
grep:

ifconfig -a | grep HWaddr

Now the output should be much shorter! Generally speaking, you could use grep in the following
way:

<command-with-output> | grep <word>

Compress files and folders using the tar command

Use the tar (tape archive) command to compress your files and folders. It is similar to creating .ZIP
files in Windows environment.

Syntax: tar -zcvf <output tar file> <source file>

Example: tar -zcvf outputfile.tar.gz source file

Here’s what those switches actually mean:

-c: Create an archive.


-z: Compress the archive with gzip.
-v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The
v is always optional in these commands, but it’s helpful.
-f: Allows you to specify the filename of the archive.

Read Basic Terminal commands online: https://riptutorial.com/ubuntu/topic/3179/basic-terminal-


commands

https://riptutorial.com/ 15
Chapter 4: Networking
Examples
Set proxy from CLI

If you need to add proxy of your network in a reboot-persistent way, edit:

sudo vim /etc/environment

Press i and after the row with PATH variable insert:

http_proxy=http://<proxy_server>:<port>/
https_proxy=http://<proxy_server>:<port>/
ftp_proxy=http://<proxy_server>:<port>/

Then press ESC, enter : and write wq! for save and exit from vim.

If you need to use wget, add the same three rows to (eventually uncommenting them inside the
file):

sudo vim /etc/wgetrc

Show network interfaces

If you want to show active network interfaces, type:

ifconfig

If you want to show also network interfaces that are down, type:

ifconfig -a

Configure network interface from CLI

You could use ethtool, but they are not going to be reboot persistent. If you want to achieve this,
edit the following file:

sudo vim /etc/network/interfaces

And edit the file with needed informations:

auto <interface_name>
iface <interface_name> inet static
address <ip_address>
netmask <netmask>

https://riptutorial.com/ 16
network <network>
gateway <gateway>
dns_nameservers <server_1> <server_2> <server_n>
dns_naesearch <server_name>

Then restart interface to make changes running:

sudo ifdown <interface_name> && sudo ifup <interface_name>

Read Networking online: https://riptutorial.com/ubuntu/topic/4972/networking

https://riptutorial.com/ 17
Chapter 5: Set up SSL
Remarks

a2ensite - a script that enables the specified site (which contains a block) within the apache2
configuration by creating symlinks within /etc/apache2/sites-enabled

apache2 - popular web server. Alternative web servers are tomcat, nginx, etc.

openssl - SSL works by using a private key to encrypt data transferred over an SSL-enabled
connection, thus thwarting eavesdropping of information. Use openssl to generate keys and
certificates.

vim - a popular text editor

Examples
Set up ssl for local testing in apache

Enable the module by typing:

sudo a2enmod ssl

Restart the web server (apache2) so the change is recognized:

sudo service apache2 restart

Optional (but a good idea): Create a directory that will contain our new certificate files:

sudo mkdir /etc/apache2/ssl

Create the key and self-signed certificate in that directory:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/apache2/ssl/your_domain.key -out /etc/apache2/ssl/your_domain.crt

You will be asked a series of questions for your security certificate. Answer each one as you are
prompted, but with your own company's information. Here is an example:

Country Name (2 letter code) [AU]:US


State or Province Name (full name) [Some-State]:Pennsylvania
Locality Name (eg, city) []:Philadelphia

https://riptutorial.com/ 18
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Cool Company
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:test_domain.com
Email Address []:my_email@test_domain.com

Open the file with root privileges:

sudo vim /etc/apache2/sites-available/default-ssl.conf

Configure your virtual host by adding your server details and certificate locations to the default-
ssl.conf file:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin [email protected]
ServerName your_domain.com
ServerAlias www.your_domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/your_domain.crt
SSLCertificateKeyFile /etc/apache2/ssl/your_domain.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /var/www/html>
SSLOptions +StdEnvVars
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>

Save your changes and enter the following to enable your new ssl configuration:

sudo a2ensite default-ssl.conf

To activate the new configuration, run:

service apache2 reload

Now, attempt to access your site locally using https!

Read Set up SSL online: https://riptutorial.com/ubuntu/topic/6823/set-up-ssl

https://riptutorial.com/ 19
Chapter 6: Software Installation
Syntax
• sudo apt-get install <package_name>

• sudo apt-get install <package1_name> <package2_name> <package3_name>

• apt-get [options] [-o config=string] [-c=cfgfile] command [pkg]

Parameters

Command Description

Used to re-synchronize the package index files from their sources. An


update
update should always be performed before an upgrade or dist-upgrade.

Used to install the newest versions of all packages currently installed on


upgrade
the system.

install This option is followed by one or more packages desired for installation.

remove Identical to install except that packages are removed instead of installed.

------ ------

Options Description

-y, --yes, -- Automatic yes to prompts. Assume "yes" as answer to all prompts and run
assume-yes non-interactively.

-h, --help Show a short usage summary.

Examples
Install software using APT

Installing software via APT (Advanced Package Tool) also know as 'apt-get'. To install Mozilla
Firefox:

1. Open a Terminal (Ctrl+Alt+T)


2. Type sudo apt-get install firefox
3. Hit Enter
4. When it asks to install type 'Y' to confirm.

https://riptutorial.com/ 20
Software will be downloaded and installed.

List all installed packages

To list all the packages installed in ubuntu, type below command

$ apt list --installed

Output will show all the installed packages.

Listing... Done
accountsservice/trusty-updates,now 0.6.35-0ubuntu7.3 i386 [installed]
acl/trusty,now 2.2.52-1 i386 [installed,automatic]
acpid/trusty,now 1:2.0.21-1ubuntu2 i386 [installed]
adduser/trusty,now 3.113+nmu3ubuntu3 all [installed]
apparmor/trusty-updates,trusty-security,now 2.10.95-0ubuntu2.6~14.04.1 i386 [installed]
apport/trusty-security,now 2.14.1-0ubuntu3.23 all [installed,upgradable to: 2.14.1-
0ubuntu3.24]
apport-symptoms/trusty,now 0.20 all [installed]
apt/trusty-updates,trusty-security,now 1.0.1ubuntu2.17 i386 [installed]
apt-transport-https/trusty-updates,trusty-security,now 1.0.1ubuntu2.17 i386 [installed]
apt-utils/trusty-updates,trusty-security,now 1.0.1ubuntu2.17 i386 [installed]
apt-xapian-index/trusty,now 0.45ubuntu4 all [installed]
aptitude/trusty,now 0.6.8.2-1ubuntu4 i386 [installed]

Read Software Installation online: https://riptutorial.com/ubuntu/topic/5973/software-installation

https://riptutorial.com/ 21
Chapter 7: Support lifespan
Remarks
New versions of Ubuntu are released by Canonical every 6 months. Every two years, the release
is a Long Term Support version.

Support lifespan

• Normal release - supported for 9 months


• Long Term Support (LTS) release
• LTS releases for Ubuntu Desktop, Ubuntu Server, Ubuntu Core, and Ubuntu Kylin are
supported for 5 years.
• LTS releases for Kubuntu, Xubuntu, Ubuntu MATE and Lubuntu are supported for 3
years.

What support means

• Updates for potential security problems and bugs (not new versions of software)
• Availability of commercial support contracts from Canonical
• Support by Landscape, Canonical's enterprise oriented server management tool set.

Examples
Currently supported releases

The table shows a list of currently supported release showing both original distribution releases
(e.g. Ubuntu 14.04) and point releases (e.g. 14.04.3). The Ubuntu versions which are still
supported will be delivered security updates.

Point releases include support for new hardware as well as rolling up all the updates published in
that series to date. So a fresh install of a point release will work on newer hardware and will also
not require a big download of additional updates.

Version Code name Release date End of life date

Ubuntu 16.04 LTS Xenial Xerus April 21, 2016 April 2021

Ubuntu 14.04.3 LTS Trusty Tahr August 6, 2015 August 2016

Ubuntu 14.04.2 LTS Trusty Tahr February 20, 2015 August 2016

Ubuntu 14.04.1 LTS Trusty Tahr July 24, 2014 April 2019

Ubuntu 14.04 LTS Trusty Tahr April 17, 2014

Ubuntu 12.04.5 LTS Precise Pangolin August 7, 2014 April 2017

https://riptutorial.com/ 22
Version Code name Release date End of life date

Ubuntu 12.04.4 LTS Precise Pangolin February 6, 2014

Ubuntu 12.04.3 LTS Precise Pangolin August 23, 2013

Ubuntu 12.04.2 LTS Precise Pangolin February 14, 2013

Ubuntu 12.04.1 LTS Precise Pangolin August 24, 2012

Ubuntu 12.04 LTS Precise Pangolin April 26, 2012

Read Support lifespan online: https://riptutorial.com/ubuntu/topic/3794/support-lifespan

https://riptutorial.com/ 23
Credits
S.
Chapters Contributors
No

Getting started with Anagh Hegde, Community, edwinksl, hellyale, James Wong,
1
Ubuntu karel, kelvinelove, kzh, Nicholas Qiao

2 Apache Server Andrea Romagnoli

Aleksandar, Anagh Hegde, Andrea Romagnoli, fitojb, Gideon


Basic Terminal
3 Maina, hellyale, johnao, karel, Reboot, roottraveller, Snehasish
commands
Karmakar, sudo bangbang, Utpal Bhatt

4 Networking Andrea Romagnoli, GAD3R, RamenChef

5 Set up SSL Mateusz Piotrowski, Rebecca Close

6 Software Installation Ralph Bisschops, Reboot

7 Support lifespan karel

https://riptutorial.com/ 24

You might also like