Monday 27 December 2021

Unsupervised Machine Learning

Data is, by default, unlabeled. Labeling data is manual (or somewhat automated) process, thus timely and expensive. Unsupervised machine learning uses unlabeled data (raw, cheap, widely available) for model training. Nevertheless, this comes with the cost of unsupervised learning requiring higher volumes of data for the training if comparing to supervised learning.

Typical use cases for unsupervised ML:
  • Clustering
  • Anomaly Detection
  • Dimensionality Reduction

Clustering


Unsupervised learning algorithms extract features and patterns from unlabeled data which can then be used to label and group together data points that share same or similar features. This is known as clustering and is one of typical problems solved by unsupervised learning.

image source: KDNuggets

Clustering algorithms:
  • k-means clustering
  • neural networks
    • hypothesis function is a mapping from input space back into this input space
    • the goal of an unsupervised learning loss function is to measure the difference between the hypothesis function and the input itself

Example: Image set clustering


Each cluster contains images which have the same object in them. Model does not know the name of that object, that it is e.g. bird. It only knows (learns) that objects in each cluster share the same/similar features. We might only need to set in advance the number of clusters we want to get.

In supervised learning, if we have a labeled dataset which contains images of birds, fish and mammals, our model will learn to identify if the image contains a bird, a fish or a mammal. In unsupervised learning, model will learn to distinguish and separate images that share same/similar features and it would group them in three clusters but it would not know that in one cluster are birds and in another fish for example, it would just know that there are three (or maybe even more) types of objects. 


image credits: Devin Pickell, g2.com


Example: Customer segmentation


Each cluster contains customers of some differentiable profile. This helps in e.g. targeted marketing.

image source: data-flair.training


Example: Spam detection


Unsupervised learning algorithm can analyze huge volumes of emails and uncover the features and patterns that indicate spam (and keep getting better at flagging spam over time).


Anomaly Detection


Another type of problems solved by unsupervised learning is anomaly detection. The goal here is to find abnormal data points. Model is trained to detect if data point has some unusual features.

Example: Fraud detection (Anomaly Detection)


Fraudulent transactions tend to involve larger sums of money. Fraud only occurs with transfers and cash-out transactions.

image credit: Shirin Elsinghorst, codecentric.de

Class 0 is normal transaction. Class 1 is fraudulent transaction.


Dimensionality Reduction


Data dimensionality refers to feature space. Each data point can be defined as a vector in N-dimensional space where N is number of features. Some features are more and some less important, in a way how much do they contribute in differentiating data points. The more features, the more complex model is, the more time and storage is required for its training and inference. The idea here is to reduce number of features without losing the semantic meaning of the data. E.g. bird can still be distinguished from other animals by recognising that it has features like beak, wings and a tail but eye color or feather color pattern is not important.

Some dimensionality reduction techniques:
  • Independent Components Analysis (ICA)
  • Principal Components Analysis (PCA)
Sometimes, before applying k-means clustering, a dimensionality reduction is applied on data.


Principal Component Analysis (PCA)


Transforms data from d-dimensional to p-dimensional feature space where p < d. It first finds the dimension of the highest variance (e.g. direction where the data is most spread out) - principal component. Data points are then projected onto this dimension. Small amount of information gets lost but overall data integrity is not changed.

PCA is based on reducing correlation (linear dependence) between features. If two features are linearly dependent, we can derive value of one feature if value of the another one is known. PCA removes this redundancy by projecting a set of linearly dependent features into a smaller set of new, uncorrelated features. 


Original data points are in 2-dimensional feature space. Features are denoted as x and y.
 

PCA finds the direction along which values have the highest variance. It is a red diagonal in our case.


Data points are projected onto component which carries the highest variance. That principal component becomes a newly derived feature. The next principal component (pc2) which carries the most variance is the one defined by the line perpendicular to the direction of pc1.


As pc2 exhibits low variance, this component does not carry much information (that helps differentiating data points). It can be ignored (small amount of information is lost) thus reducing the feature space to a single dimension.

image credits: V. Powell, setosa.io

Example: Solution to “Cocktail Party” problem


Dimension Reduction via Independent Components Analysis (ICA) is used to extract independent sources of audio signal from a recording which contains mixed signals.


image source: 2014, J. Shlens: "A Tutorial on Independent Component Analysis"

References



Monday 20 December 2021

Installing Python3 on Mac Big Sur

Mac comes with Python 2 by default and I wanted to install and use Python 3. I installed it by using brew

% brew install python3
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
abi-compliance-checker     gotify                     pam-reattach
abi-dumper                 hurl                       payload-dumper-go
biber                      imap-backup                pip-audit
brigade-cli                isa-l                      pocsuite3
chroma                     jsonschema                 rpki-client
coursier                   kubernetes-cli@1.22        salt-lint
djhtml                     lua-language-server        sevenzip
dynomite                   mcfly                      statix
fastp                      mist                       tsduck
goawk                      openliberty-jakartaee9     vtable-dumper
goplus                     openliberty-webprofile9
==> Updated Formulae
Updated 1431 formulae.
==> Deleted Formulae
ape             es              jerasure        makepp          swiftplate
balance         eventlog        kakasi          marst           torrentcheck
bbcolors        flasm           l-smash         mboxgrep        udns
colorsvn        fondu           libbind         md              whitedb
contacts        gconf           liberasurecode  namazu          xidel
csv-fix         gcore           libmill         postmark        xtail
dlite           gf-complete     libopendkim     redsocks        zdelta
dnsrend         git-hooks       libpuzzle       sdhash
drip            git-sh          libvbucket      shorten
dshb            henplus         m2c             srmio
eject           httptunnel      magnetix        svdlibc
==> New Casks
appflowy            finalshell          projector           teamspeak-client
appium-inspector    folder-colorizer    schildichat         tidgi
centered            grammarly-desktop   sitala              volley
citrix-workspace    handyprintpro       soundtoys           wolai
cron                linearmouse         spaceid             xstation5
emmetapp            ludwig              supermjograph
equinox             macrorecorder       tablecruncher
==> Updated Casks
Updated 648 casks.
==> Deleted Casks
air-connect                              lelivrescolairefr
aja-system-test                          napari
anka-build-cloud-registry                octoscreen
asc-timetables                           platelet
avast-secureline-vpn                     pullover
chameleon-ssd-optimizer                  punto-switcher
chocolat                                 qit
domainbrain                              river-sparkle
drama                                    scrutiny
everweb                                  tmnotifier
freeter                                  unity-linux-support-for-editor
gitbook                                  unity-lumin-support-for-editor
inboard                                  visicut

python@3.9 3.9.6 is already installed but outdated (so it will be upgraded).
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.22
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:7e9737ec99942
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2021-
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:1b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1m
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:ad0413
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.1.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:c596199dc
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.37.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:ae0b38a858a
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/manifests/3.9.9
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/blobs/sha256:4b56d09
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Upgrading python3
  3.9.6 -> 3.9.9 

==> Installing dependencies for python@3.9: gdbm, ca-certificates, openssl@1.1, readline and sqlite
==> Installing python@3.9 dependency: gdbm
==> Pouring gdbm--1.22.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/gdbm/1.22: 24 files, 957.9KB
==> Installing python@3.9 dependency: ca-certificates
==> Pouring ca-certificates--2021-10-26.all.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /usr/local/Cellar/ca-certificates/2021-10-26: 3 files, 208.5KB
==> Installing python@3.9 dependency: openssl@1.1
==> Pouring openssl@1.1--1.1.1m.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/openssl@1.1/1.1.1m: 8,081 files, 18.5MB
==> Installing python@3.9 dependency: readline
==> Pouring readline--8.1.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/readline/8.1.1: 48 files, 1.6MB
==> Installing python@3.9 dependency: sqlite
==> Pouring sqlite--3.37.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/sqlite/3.37.0: 11 files, 4.3MB
==> Installing python@3.9
==> Pouring python@3.9--3.9.9.big_sur.bottle.tar.gz
==> /usr/local/Cellar/python@3.9/3.9.9/bin/python3 -m ensurepip
==> /usr/local/Cellar/python@3.9/3.9.9/bin/python3 -m pip install -v --no-deps -
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.9/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.9/site-packages

tkinter is no longer included with this formula, but it is available separately:
  brew install python-tk@3.9

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
🍺  /usr/local/Cellar/python@3.9/3.9.9: 3,080 files, 55.0MB
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/gdbm/1.20... (24 files, 825.0KB)
Removing: /Users/bojan/Library/Caches/Homebrew/gdbm--1.20... (221KB)
Removing: /Users/bojan/Library/Caches/Homebrew/mpdecimal--2.5.1... (548.3KB)
Removing: /usr/local/Cellar/openssl@1.1/1.1.1k... (8,071 files, 18.5MB)
Removing: /Users/bojan/Library/Caches/Homebrew/openssl@1.1--1.1.1k... (5.4MB)
Removing: /usr/local/Cellar/python@3.9/3.9.6... (3,085 files, 54.7MB)
Removing: /Users/bojan/Library/Caches/Homebrew/python@3.9--3.9.6... (13.6MB)
Removing: /usr/local/Cellar/readline/8.1... (48 files, 1.6MB)
Removing: /Users/bojan/Library/Caches/Homebrew/readline--8.1... (536KB)
Removing: /Users/bojan/Library/Caches/Homebrew/rtmpdump--2.4+20151223_1... (170.2KB)
Removing: /usr/local/Cellar/sqlite/3.36.0... (11 files, 4.2MB)
Removing: /Users/bojan/Library/Caches/Homebrew/sqlite--3.36.0... (2MB)
Removing: /Users/bojan/Library/Caches/Homebrew/xz--5.2.5... (417.6KB)
Removing: /Users/bojan/Library/Caches/Homebrew/you-get--0.4.1536... (2.2MB)
Removing: /Users/bojan/Library/Caches/Homebrew/xz_bottle_manifest--5.2.5... (5.7KB)
Removing: /Users/bojan/Library/Caches/Homebrew/rtmpdump_bottle_manifest--2.4+20151223_1... (7KB)
Removing: /Users/bojan/Library/Caches/Homebrew/sqlite_bottle_manifest--3.36.0... (5.9KB)
Removing: /Users/bojan/Library/Caches/Homebrew/openssl@1.1_bottle_manifest--1.1.1k... (6KB)
Removing: /Users/bojan/Library/Caches/Homebrew/python@3.9_bottle_manifest--3.9.6... (15.4KB)
Removing: /Users/bojan/Library/Caches/Homebrew/readline_bottle_manifest--8.1... (5.5KB)
Removing: /Users/bojan/Library/Caches/Homebrew/you-get_bottle_manifest--0.4.1536... (11.2KB)
Removing: /Users/bojan/Library/Caches/Homebrew/gdbm_bottle_manifest--1.20... (5.2KB)
Removing: /Users/bojan/Library/Caches/Homebrew/mpdecimal_bottle_manifest--2.5.1... (5.2KB)
Removing: /Users/bojan/Library/Logs/Homebrew/gdbm... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/mpdecimal... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/rtmpdump... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/readline... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/sqlite... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/xz... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/openssl@1.1... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/you-get... (64B)
Removing: /Users/bojan/Library/Logs/Homebrew/python@3.9... (2 files, 2.4KB)
Pruned 0 symbolic links and 2 directories from /usr/local
==> Upgrading 1 dependent:
Disable this behaviour by setting HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
you-get 0.4.1536 -> 0.4.1555
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/manifests/3.10.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/blobs/sha256:c4f29a
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/you-get/manifests/0.4.1555
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/you-get/blobs/sha256:df0dc12c74
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Upgrading you-get
  0.4.1536 -> 0.4.1555 

==> Installing dependencies for you-get: python@3.10
==> Installing you-get dependency: python@3.10
==> Pouring python@3.10--3.10.1.big_sur.bottle.tar.gz
==> /usr/local/Cellar/python@3.10/3.10.1/bin/python3 -m ensurepip
==> /usr/local/Cellar/python@3.10/3.10.1/bin/python3 -m pip install -v --no-deps
🍺  /usr/local/Cellar/python@3.10/3.10.1: 3,132 files, 56MB
==> Installing you-get
==> Pouring you-get--0.4.1555.big_sur.bottle.tar.gz
==> Caveats
To use post-processing options, run `brew install ffmpeg` or `brew install libav`.
==> Summary
🍺  /usr/local/Cellar/you-get/0.4.1555: 736 files, 8.5MB
==> Running `brew cleanup you-get`...
Removing: /usr/local/Cellar/you-get/0.4.1536... (845 files, 8.6MB)
==> Checking for dependents of upgraded formulae...
==> No broken dependents found!
==> Caveats
==> python@3.9
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.9/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.9/site-packages

tkinter is no longer included with this formula, but it is available separately:
  brew install python-tk@3.9

See: https://docs.brew.sh/Homebrew-and-Python
==> you-get
To use post-processing options, run `brew install ffmpeg` or `brew install libav`.


If zsh configuration file does not exist, create it and open it:

% touch ~/.zshrc
% vi ~/.zshrc

Type in it:

export PATH=/usr/local/opt/python@3.9/libexec/bin:$PATH

Restart the terminal.

% which python
/usr/local/opt/python@3.9/libexec/bin/python
% python --version
Python 3.9.9

If using VSCode, restart it and it will also pick up this version of Python in its Terminal.


Wednesday 1 December 2021

Installing Go on Mac Big Sur

 I followed instructions listed here. I downloaded go1.17.3.darwin-amd64.pkg and run it.



Upon installation I checked that Go bin path is indeed added to $PATH and also that go command works fine:

~ % echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin

~ % go version
go version go1.17.3 darwin/amd64


Saturday 9 October 2021

How to copy files from Ubuntu to Mac

If remote login is not enabled on Mac, SSH connection will fail:

~/Videos$ scp -r MyDir/ user@192.168.0.30:/Users/user/Movies
ssh: connect to host 192.168.0.30 port 22: Connection refused
lost connection

We need to enable remote login on Mac (System Preferences >>  Sharing):



~/Videos$ scp -r MyDiruser@192.168.0.30:/Users/user/Movies
The authenticity of host '192.168.0.30 (192.168.0.30)' can't be established.
ECDSA key fingerprint is SHA256:fvlF0KH/l1N/fHmg4etTM/OR9DJYl1mnzD2iD43R+j5.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.30' (ECDSA) to the list of known hosts.
Password:
file1.m4v         100%  137MB   1.6MB/s   01:28    
file2.m4v         100%  151MB   1.5MB/s   01:40    

Files are copied to /Users/user/Movies/MyDir/.

Friday 11 June 2021

Using Meld for a 3-way merge

meld is available on Ubuntu via standard package manager:
 
$ sudo apt-get update && $ sudo apt-get install meld




There is a conflict in file test.txt on branch feature which we want to merge to dev.

$ git checkout dev
 
$ git merge feature
Auto-merging test.txt
CONFLICT (content): Merge conflict in test.txt
Automatic merge failed; fix conflicts and then commit the result.
 
$ git config merge.tool meld
 
$ git mergetool
Merging:
test.txt

Normal merge conflict for 'test.txt':
  {local}: modified file
  {remote}: modified file
test.txt seems unchanged.
Was the merge successful [y/n]? n
merge of test.txt failed
 
$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.

You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

...
Unmerged paths:
  (use "git add <file>..." to mark resolution)
    both modified:   test.txt
...


 

Friday 23 April 2021

How to link Google Colab with GitHub

Create a GitHub repository in which you want to keep Colaboratory notebooks.
Go to https://colab.research.google.com/github/ and add your GitHub account.



GitHub website window will open asking you to accept Colab's access to your GitHub account.
Once accepted that window will close and back in https://colab.research.google.com/github/ a popup window above will contain a list of all repositories in connected GitHub account. Select the one you created. As it's currently empty, there are no notebooks in there, it will show "No results".

If you create a notebook in Colab (https://colab.research.google.com/) and want to add it to that GitHub repo, go to Colab's tab in the browser, File >> Save a copy in GitHub. 




After this, this notebook will appear in the list of notebooks available to be loaded into Colab:






Monday 19 April 2021

PostgreSQL on Ubuntu

Here are some my notes on PostgreSQL on Ubuntu.


To check the PostgreSQL version running:

$ postgres -V

Command 'postgres' not found, did you mean:

  command 'postgrey' from deb postgrey (1.36-5.1)

Try: sudo apt install <deb name>

Let's try to locate binaries:

$ locate bin/postgres
/usr/lib/postgresql/10/bin/postgres
/usr/lib/postgresql/12/bin/postgres

From the ouput above we can see that I have two versions of PostgreSQL installed on my system: 10 and 12. Let's find their full version numbers:

$ /usr/lib/postgresql/10/bin/postgres -V
postgres (PostgreSQL) 10.14 (Ubuntu 10.14-0ubuntu0.18.04.1)

$ /usr/lib/postgresql/12/bin/postgres -V
postgres (PostgreSQL) 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)


PostgreSQL Service


To check if postgres is listening on ports:

$ sudo netstat -ltnp | grep postgres
tcp        0      0 127.0.0.1:5432      0.0.0.0:*      LISTEN      1448/postgres     
tcp        0      0 127.0.0.1:5433      0.0.0.0:*      LISTEN      1456/postgres       

Let's see paths to these processes:

$ sudo pwdx 1448
1448: /var/lib/postgresql/12/main

$ sudo pwdx 1456
1456: /var/lib/postgresql/10/main

So it turned out that both versions of Postgres are currently running in parallel on my system. 


To check the current state of the service:

$ systemctl status postgresql
  postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2021-04-18 21:13:14 BST; 18h ago
   Main PID: 1843 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 38289)
     Memory: 0B
     CGroup: /system.slice/postgresql.service

Apr 18 21:13:14 my_computer systemd[1]: Starting PostgreSQL RDBMS...
Apr 18 21:13:14 my_computer systemd[1]: Finished PostgreSQL RDBMS.


To start/stop the service:

$ systemctl start postgresql
$ systemctl stop postgresql

By default (upon installation) postgresql service is configured to start automatically upon computer launch:

$ cat /etc/postgresql/10/main/start.conf
# Automatic startup configuration
#   auto: automatically start the cluster
#   manual: manual startup with pg_ctlcluster/postgresql@.service only
#   disabled: refuse to start cluster
# See pg_createcluster(1) for details. When running from systemd,
# invoke 'systemctl daemon-reload' after editing this file.

auto

The same output is for postgres v12.

To prevent service from starting upon computer reboot:

$ sudo vi /etc/postgresql/10/main/start.conf

...and replace auto with manual.




psql


To get psql prompt if DB is running locally:

$ psql -h 127.0.0.1 -U root -d test-db
Password for user root: 
psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1), server 11.2 (Debian 11.2-1.pgdg90+1))
WARNING: psql major version 10, server major version 11.
         Some psql features might not work.
Type "help" for help.

Now we can list all tables:

test-db=# \dt
Did not find any relations.

To quit:

test-db-# \q

TBC...

Friday 19 March 2021

How to rip DVD disc on Ubuntu

 I used HandBrake application and it was incredibly easy and fast.

To install it, we need to add developer's package repository first:

$ sudo add-apt-repository ppa:stebbins/handbrake-releases
$ sudo apt-get update

HandBrake installation:

$ sudo apt-get install handbrake-cli handbrake-gtk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
handbrake-gtk is already the newest version (1:1.3.3.1-zhb-1ppa1~focal1).
The following NEW packages will be installed
  handbrake-cli
0 to upgrade, 1 to newly install, 0 to remove and 35 not to upgrade.
Need to get 8,623 kB of archives.
After this operation, 40.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu focal/main amd64 handbrake-cli amd64 1:1.3.3.1-zhb-1ppa1~focal1 [8,623 kB]
Fetched 8,623 kB in 3s (3,041 kB/s)        
Selecting previously unselected package handbrake-cli.
(Reading database ... 351992 files and directories currently installed.)
Preparing to unpack .../handbrake-cli_1%3a1.3.3.1-zhb-1ppa1~focal1_amd64.deb ...
Unpacking handbrake-cli (1:1.3.3.1-zhb-1ppa1~focal1) ...
Setting up handbrake-cli (1:1.3.3.1-zhb-1ppa1~focal1) ...

After this, the application is installed and we can run it by clicking on its exotically looking icon:


This is the main window of the application:


To rip the DVD disc we need to click on Open Source icon and select the DVD drive. Once this is done, HandBrake automatically reads all video sections (titles) from the DVD (these are videos that we can choose from the main menu that is displayed when we play DVD):


All we have to do now is to select a title and press Start. This will rip selected title into a new m4v (mp4) video file on your local disk. This has to be repeated for each title. Job done!

Wednesday 17 March 2021

How to play DVD disc on Ubuntu

Here is what I needed to do on my PC in order to play a DVD disc. 

I am running the Ubuntu 20.04:

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal


I chose to use VLC media player.


VLC installation:

$ sudo apt install vlc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liba52-0.7.4 libaribb24-0 libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4 libdvdread7 libebml4v5 libfaad2 libgroupsock8 libixml10 libkate1 liblivemedia77 libmad0
  libmatroska6v5 libmpcdec6 libmpeg2-4 libopenmpt-modplug1 libplacebo7 libproxy-tools libresid-builder0c2a libsdl-image1.2 libsidplay2 libspatialaudio0 libsrt1 libssh2-1 libupnp13
  libusageenvironment3 libva-wayland2 libvlc-bin libvlc5 libvlccore9 vlc-bin vlc-data vlc-l10n vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2
  vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
Suggested packages:
  libdvdcss2
The following NEW packages will be installed
  liba52-0.7.4 libaribb24-0 libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4 libdvdread7 libebml4v5 libfaad2 libgroupsock8 libixml10 libkate1 liblivemedia77 libmad0
  libmatroska6v5 libmpcdec6 libmpeg2-4 libopenmpt-modplug1 libplacebo7 libproxy-tools libresid-builder0c2a libsdl-image1.2 libsidplay2 libspatialaudio0 libsrt1 libssh2-1 libupnp13
  libusageenvironment3 libva-wayland2 libvlc-bin libvlc5 libvlccore9 vlc vlc-bin vlc-data vlc-l10n vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2
  vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
0 to upgrade, 45 to newly install, 0 to remove and 18 not to upgrade.
Need to get 13.7 MB of archives.
After this operation, 71.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 liba52-0.7.4 amd64 0.7.4-20 [30.5 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libaribb24-0 amd64 1.0.3-2 [26.9 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libusageenvironment3 amd64 2020.01.19-1build1 [6,960 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libbasicusageenvironment1 amd64 2020.01.19-1build1 [15.2 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libcddb2 amd64 1.3.2-6fakesync1 [34.3 kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvbpsi10 amd64 1.3.3-1 [47.1 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvdread7 amd64 6.1.0+really6.0.2-1 [49.9 kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdvdnav4 amd64 6.0.1-1build1 [39.0 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libebml4v5 amd64 1.3.10-1build1 [49.1 kB]
Get:10 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libfaad2 amd64 2.9.1-1 [154 kB]
Get:11 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libgroupsock8 amd64 2020.01.19-1build1 [20.7 kB]
Get:12 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libixml10 amd64 1:1.8.4-2ubuntu2 [23.6 kB]
Get:13 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libkate1 amd64 0.4.1-11build1 [39.4 kB]
Get:14 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 liblivemedia77 amd64 2020.01.19-1build1 [318 kB]
Get:15 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmad0 amd64 0.15.1b-10ubuntu1 [63.1 kB]
Get:16 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmatroska6v5 amd64 1.5.2-3build1 [124 kB]
Get:17 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmpcdec6 amd64 2:0.1~r495-2 [32.4 kB]
Get:18 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libmpeg2-4 amd64 0.5.1-9 [50.7 kB]
Get:19 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libopenmpt-modplug1 amd64 0.4.11-1build1 [20.0 kB]
Get:20 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libplacebo7 amd64 1.7.0-2 [721 kB]
Get:21 http://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libproxy-tools amd64 0.4.15-10ubuntu1.2 [5,440 B]
Get:22 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libresid-builder0c2a amd64 2.1.1-15ubuntu2 [31.3 kB]
Get:23 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsdl-image1.2 amd64 1.2.12-12 [30.0 kB]
Get:24 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsidplay2 amd64 2.1.1-15ubuntu2 [89.2 kB]
Get:25 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libspatialaudio0 amd64 0.3.0+git20180730+dfsg1-2build1 [32.9 kB]
Get:26 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libsrt1 amd64 1.4.0-1build1 [236 kB]
Get:27 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libssh2-1 amd64 1.8.0-2.1build1 [75.4 kB]
Get:28 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libupnp13 amd64 1:1.8.4-2ubuntu2 [87.9 kB]
Get:29 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libva-wayland2 amd64 2.7.0-2 [8,924 B]
Get:30 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlccore9 amd64 3.0.9.2-1 [428 kB]
Get:31 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlc5 amd64 3.0.9.2-1 [65.8 kB]
Get:32 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libvlc-bin amd64 3.0.9.2-1 [17.1 kB]
Get:33 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-bin amd64 3.0.9.2-1 [54.2 kB]
Get:34 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-data all 3.0.9.2-1 [339 kB]
Get:35 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 libdca0 amd64 0.0.6-1 [91.0 kB]
Get:36 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-base amd64 3.0.9.2-1 [2,854 kB]
Get:37 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-qt amd64 3.0.9.2-1 [1,054 kB]
Get:38 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-video-output amd64 3.0.9.2-1 [160 kB]
Get:39 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc amd64 3.0.9.2-1 [34.0 kB]
Get:40 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-l10n all 3.0.9.2-1 [5,584 kB]
Get:41 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-notify amd64 3.0.9.2-1 [18.2 kB]
Get:42 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-samba amd64 3.0.9.2-1 [18.8 kB]
Get:43 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-skins2 amd64 3.0.9.2-1 [471 kB]
Get:44 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-video-splitter amd64 3.0.9.2-1 [32.4 kB]
Get:45 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 vlc-plugin-visualization amd64 3.0.9.2-1 [36.2 kB]
Fetched 13.7 MB in 4s (3,493 kB/s)                    
Extract templates from packages: 100%
Selecting previously unselected package liba52-0.7.4:amd64.
(Reading database ... 350491 files and directories currently installed.)
Preparing to unpack .../00-liba52-0.7.4_0.7.4-20_amd64.deb ...
Unpacking liba52-0.7.4:amd64 (0.7.4-20) ...
Selecting previously unselected package libaribb24-0:amd64.
Preparing to unpack .../01-libaribb24-0_1.0.3-2_amd64.deb ...
Unpacking libaribb24-0:amd64 (1.0.3-2) ...
Selecting previously unselected package libusageenvironment3:amd64.
Preparing to unpack .../02-libusageenvironment3_2020.01.19-1build1_amd64.deb ...
Unpacking libusageenvironment3:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libbasicusageenvironment1:amd64.
Preparing to unpack .../03-libbasicusageenvironment1_2020.01.19-1build1_amd64.deb ...
Unpacking libbasicusageenvironment1:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libcddb2.
Preparing to unpack .../04-libcddb2_1.3.2-6fakesync1_amd64.deb ...
Unpacking libcddb2 (1.3.2-6fakesync1) ...
Selecting previously unselected package libdvbpsi10:amd64.
Preparing to unpack .../05-libdvbpsi10_1.3.3-1_amd64.deb ...
Unpacking libdvbpsi10:amd64 (1.3.3-1) ...
Selecting previously unselected package libdvdread7:amd64.
Preparing to unpack .../06-libdvdread7_6.1.0+really6.0.2-1_amd64.deb ...
Unpacking libdvdread7:amd64 (6.1.0+really6.0.2-1) ...
Selecting previously unselected package libdvdnav4:amd64.
Preparing to unpack .../07-libdvdnav4_6.0.1-1build1_amd64.deb ...
Unpacking libdvdnav4:amd64 (6.0.1-1build1) ...
Selecting previously unselected package libebml4v5:amd64.
Preparing to unpack .../08-libebml4v5_1.3.10-1build1_amd64.deb ...
Unpacking libebml4v5:amd64 (1.3.10-1build1) ...
Selecting previously unselected package libfaad2:amd64.
Preparing to unpack .../09-libfaad2_2.9.1-1_amd64.deb ...
Unpacking libfaad2:amd64 (2.9.1-1) ...
Selecting previously unselected package libgroupsock8:amd64.
Preparing to unpack .../10-libgroupsock8_2020.01.19-1build1_amd64.deb ...
Unpacking libgroupsock8:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libixml10:amd64.
Preparing to unpack .../11-libixml10_1%3a1.8.4-2ubuntu2_amd64.deb ...
Unpacking libixml10:amd64 (1:1.8.4-2ubuntu2) ...
Selecting previously unselected package libkate1:amd64.
Preparing to unpack .../12-libkate1_0.4.1-11build1_amd64.deb ...
Unpacking libkate1:amd64 (0.4.1-11build1) ...
Selecting previously unselected package liblivemedia77:amd64.
Preparing to unpack .../13-liblivemedia77_2020.01.19-1build1_amd64.deb ...
Unpacking liblivemedia77:amd64 (2020.01.19-1build1) ...
Selecting previously unselected package libmad0:amd64.
Preparing to unpack .../14-libmad0_0.15.1b-10ubuntu1_amd64.deb ...
Unpacking libmad0:amd64 (0.15.1b-10ubuntu1) ...
Selecting previously unselected package libmatroska6v5:amd64.
Preparing to unpack .../15-libmatroska6v5_1.5.2-3build1_amd64.deb ...
Unpacking libmatroska6v5:amd64 (1.5.2-3build1) ...
Selecting previously unselected package libmpcdec6:amd64.
Preparing to unpack .../16-libmpcdec6_2%3a0.1~r495-2_amd64.deb ...
Unpacking libmpcdec6:amd64 (2:0.1~r495-2) ...
Selecting previously unselected package libmpeg2-4:amd64.
Preparing to unpack .../17-libmpeg2-4_0.5.1-9_amd64.deb ...
Unpacking libmpeg2-4:amd64 (0.5.1-9) ...
Selecting previously unselected package libopenmpt-modplug1:amd64.
Preparing to unpack .../18-libopenmpt-modplug1_0.4.11-1build1_amd64.deb ...
Unpacking libopenmpt-modplug1:amd64 (0.4.11-1build1) ...
Selecting previously unselected package libplacebo7:amd64.
Preparing to unpack .../19-libplacebo7_1.7.0-2_amd64.deb ...
Unpacking libplacebo7:amd64 (1.7.0-2) ...
Selecting previously unselected package libproxy-tools.
Preparing to unpack .../20-libproxy-tools_0.4.15-10ubuntu1.2_amd64.deb ...
Unpacking libproxy-tools (0.4.15-10ubuntu1.2) ...
Selecting previously unselected package libresid-builder0c2a.
Preparing to unpack .../21-libresid-builder0c2a_2.1.1-15ubuntu2_amd64.deb ...
Unpacking libresid-builder0c2a (2.1.1-15ubuntu2) ...
Selecting previously unselected package libsdl-image1.2:amd64.
Preparing to unpack .../22-libsdl-image1.2_1.2.12-12_amd64.deb ...
Unpacking libsdl-image1.2:amd64 (1.2.12-12) ...
Selecting previously unselected package libsidplay2.
Preparing to unpack .../23-libsidplay2_2.1.1-15ubuntu2_amd64.deb ...
Unpacking libsidplay2 (2.1.1-15ubuntu2) ...
Selecting previously unselected package libspatialaudio0:amd64.
Preparing to unpack .../24-libspatialaudio0_0.3.0+git20180730+dfsg1-2build1_amd64.deb ...
Unpacking libspatialaudio0:amd64 (0.3.0+git20180730+dfsg1-2build1) ...
Selecting previously unselected package libsrt1:amd64.
Preparing to unpack .../25-libsrt1_1.4.0-1build1_amd64.deb ...
Unpacking libsrt1:amd64 (1.4.0-1build1) ...
Selecting previously unselected package libssh2-1:amd64.
Preparing to unpack .../26-libssh2-1_1.8.0-2.1build1_amd64.deb ...
Unpacking libssh2-1:amd64 (1.8.0-2.1build1) ...
Selecting previously unselected package libupnp13:amd64.
Preparing to unpack .../27-libupnp13_1%3a1.8.4-2ubuntu2_amd64.deb ...
Unpacking libupnp13:amd64 (1:1.8.4-2ubuntu2) ...
Selecting previously unselected package libva-wayland2:amd64.
Preparing to unpack .../28-libva-wayland2_2.7.0-2_amd64.deb ...
Unpacking libva-wayland2:amd64 (2.7.0-2) ...
Selecting previously unselected package libvlccore9:amd64.
Preparing to unpack .../29-libvlccore9_3.0.9.2-1_amd64.deb ...
Unpacking libvlccore9:amd64 (3.0.9.2-1) ...
Selecting previously unselected package libvlc5:amd64.
Preparing to unpack .../30-libvlc5_3.0.9.2-1_amd64.deb ...
Unpacking libvlc5:amd64 (3.0.9.2-1) ...
Selecting previously unselected package libvlc-bin:amd64.
Preparing to unpack .../31-libvlc-bin_3.0.9.2-1_amd64.deb ...
Unpacking libvlc-bin:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-bin.
Preparing to unpack .../32-vlc-bin_3.0.9.2-1_amd64.deb ...
Unpacking vlc-bin (3.0.9.2-1) ...
Selecting previously unselected package vlc-data.
Preparing to unpack .../33-vlc-data_3.0.9.2-1_all.deb ...
Unpacking vlc-data (3.0.9.2-1) ...
Selecting previously unselected package libdca0:amd64.
Preparing to unpack .../34-libdca0_0.0.6-1_amd64.deb ...
Unpacking libdca0:amd64 (0.0.6-1) ...
Selecting previously unselected package vlc-plugin-base:amd64.
Preparing to unpack .../35-vlc-plugin-base_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-base:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-qt:amd64.
Preparing to unpack .../36-vlc-plugin-qt_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-qt:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-video-output:amd64.
Preparing to unpack .../37-vlc-plugin-video-output_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-video-output:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc.
Preparing to unpack .../38-vlc_3.0.9.2-1_amd64.deb ...
Unpacking vlc (3.0.9.2-1) ...
Selecting previously unselected package vlc-l10n.
Preparing to unpack .../39-vlc-l10n_3.0.9.2-1_all.deb ...
Unpacking vlc-l10n (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-notify:amd64.
Preparing to unpack .../40-vlc-plugin-notify_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-notify:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-samba:amd64.
Preparing to unpack .../41-vlc-plugin-samba_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-samba:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-skins2:amd64.
Preparing to unpack .../42-vlc-plugin-skins2_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-skins2:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-video-splitter:amd64.
Preparing to unpack .../43-vlc-plugin-video-splitter_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-video-splitter:amd64 (3.0.9.2-1) ...
Selecting previously unselected package vlc-plugin-visualization:amd64.
Preparing to unpack .../44-vlc-plugin-visualization_3.0.9.2-1_amd64.deb ...
Unpacking vlc-plugin-visualization:amd64 (3.0.9.2-1) ...
Setting up libsdl-image1.2:amd64 (1.2.12-12) ...
Setting up libkate1:amd64 (0.4.1-11build1) ...
Setting up libdvbpsi10:amd64 (1.3.3-1) ...
Setting up libebml4v5:amd64 (1.3.10-1build1) ...
Setting up libdvdread7:amd64 (6.1.0+really6.0.2-1) ...
Setting up libspatialaudio0:amd64 (0.3.0+git20180730+dfsg1-2build1) ...
Setting up vlc-l10n (3.0.9.2-1) ...
Setting up libmpeg2-4:amd64 (0.5.1-9) ...
Setting up libaribb24-0:amd64 (1.0.3-2) ...
Setting up libusageenvironment3:amd64 (2020.01.19-1build1) ...
Setting up libmpcdec6:amd64 (2:0.1~r495-2) ...
Setting up libcddb2 (1.3.2-6fakesync1) ...
Setting up liba52-0.7.4:amd64 (0.7.4-20) ...
Setting up libmatroska6v5:amd64 (1.5.2-3build1) ...
Setting up libixml10:amd64 (1:1.8.4-2ubuntu2) ...
Setting up libresid-builder0c2a (2.1.1-15ubuntu2) ...
Setting up libfaad2:amd64 (2.9.1-1) ...
Setting up libbasicusageenvironment1:amd64 (2020.01.19-1build1) ...
Setting up libvlccore9:amd64 (3.0.9.2-1) ...
Setting up libsidplay2 (2.1.1-15ubuntu2) ...
Setting up libva-wayland2:amd64 (2.7.0-2) ...
Setting up libmad0:amd64 (0.15.1b-10ubuntu1) ...
Setting up libsrt1:amd64 (1.4.0-1build1) ...
Setting up vlc-plugin-qt:amd64 (3.0.9.2-1) ...
Setting up libdca0:amd64 (0.0.6-1) ...
Setting up libssh2-1:amd64 (1.8.0-2.1build1) ...
Setting up libopenmpt-modplug1:amd64 (0.4.11-1build1) ...
Setting up vlc-data (3.0.9.2-1) ...
Setting up libplacebo7:amd64 (1.7.0-2) ...
Setting up vlc-plugin-notify:amd64 (3.0.9.2-1) ...
Setting up libdvdnav4:amd64 (6.0.1-1build1) ...
Setting up libproxy-tools (0.4.15-10ubuntu1.2) ...
Setting up vlc-plugin-video-output:amd64 (3.0.9.2-1) ...
Setting up vlc-plugin-samba:amd64 (3.0.9.2-1) ...
Setting up libgroupsock8:amd64 (2020.01.19-1build1) ...
Setting up vlc-plugin-skins2:amd64 (3.0.9.2-1) ...
Setting up vlc-plugin-video-splitter:amd64 (3.0.9.2-1) ...
Setting up libvlc5:amd64 (3.0.9.2-1) ...
Setting up libupnp13:amd64 (1:1.8.4-2ubuntu2) ...
Setting up vlc-plugin-visualization:amd64 (3.0.9.2-1) ...
Setting up libvlc-bin:amd64 (3.0.9.2-1) ...
Setting up liblivemedia77:amd64 (2020.01.19-1build1) ...
Setting up vlc-bin (3.0.9.2-1) ...
Setting up vlc-plugin-base:amd64 (3.0.9.2-1) ...
Setting up vlc (3.0.9.2-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.5 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for libvlc-bin:amd64 (3.0.9.2-1) ...


It was necessary to install several packages. 
 
libdvd-pkg package provides libraries that are needed for playing video DVDs with a media player (such as VLC, SMplayer, Totem, etc.). 
 
libdvdnav4 is a DVD navigation library, which provides an interface to the advanced features of DVDs, like menus and navigation. It contains the VM and other parts useful for writing DVD players.
 
libdvdread7 is a package for reading DVDs.

$ sudo apt install libdvd-pkg libdvdnav4 libdvdread7 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libdvdnav4 is already the newest version (6.0.1-1build1).
libdvdnav4 set to manually installed.
libdvdread7 is already the newest version (6.1.0+really6.0.2-1).
libdvdread7 set to manually installed.
The following NEW packages will be installed
  libdvd-pkg
0 to upgrade, 1 to newly install, 0 to remove and 18 not to upgrade.
Need to get 14.9 kB of archives.
After this operation, 80.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/multiverse amd64 libdvd-pkg all 1.4.2-1-1 [14.9 kB]
Fetched 14.9 kB in 0s (212 kB/s)    
Preconfiguring packages ...
Selecting previously unselected package libdvd-pkg.
(Reading database ... 351510 files and directories currently installed.)
Preparing to unpack .../libdvd-pkg_1.4.2-1-1_all.deb ...
Unpacking libdvd-pkg (1.4.2-1-1) ...
Setting up libdvd-pkg (1.4.2-1-1) ...
libdvd-pkg: dpkg database is locked. You may need to use command "sudo dpkg-reco
nfigure libdvd-pkg".
libdvd-pkg: Building and installation of package(s) [libdvdcss2 libdvdcss-dev] p
ostponed till after next APT operation.





$ sudo dpkg-reconfigure libdvd-pkg
libdvd-pkg: Downloading orig source...
I: libdvdcss_1.4.2
/usr/bin/wget --tries=3 --timeout=40 --read-timeout=40 --continue -O libdvdcss_1.4.2.orig.tar.bz2 \
          http://download.videolan.org/pub/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2 \
        || /usr/bin/uscan --noconf --verbose --rename --destdir=/usr/src/libdvd-pkg --check-dirname-level=0 --force-download --download-current-version /usr/share/libdvd-pkg/debian
--2021-03-17 08:02:21--  http://download.videolan.org/pub/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2
Resolving download.videolan.org (download.videolan.org)... 2a01:e0d:1:3:58bf:fa02:c0de:5, 213.36.253.2
Connecting to download.videolan.org (download.videolan.org)|2a01:e0d:1:3:58bf:fa02:c0de:5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 366824 (358K) [application/octet-stream]
Saving to: ‘libdvdcss_1.4.2.orig.tar.bz2’

libdvdcss_1.4.2.orig.tar 100%[=================================>] 358.23K  2.27MB/s    in 0.2s    

2021-03-17 08:02:22 (2.27 MB/s) - ‘libdvdcss_1.4.2.orig.tar.bz2’ saved [366824/366824]

libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: Unpacking and configuring...
libdvd-pkg: Building the package... (it may take a while)
libdvd-pkg: Build log will be saved to /usr/src/libdvd-pkg/libdvdcss2_1.4.2-1~local_amd64.build
Current: =ep
Bounding set =cap_chown,cap_dac_override,cap_fowner,cap_wake_alarm,cap_block_suspend,cap_audit_read
Ambient set =
Securebits: 024/0x14/5'b10100
 secure-noroot: no (unlocked)
 secure-no-suid-fixup: yes (unlocked)
 secure-keep-caps: yes (unlocked)
 secure-no-ambient-raise: no (unlocked)
uid=0(root) euid=0(root)
gid=0(root)
groups=0(root)
Guessed mode: UNCERTAIN (0)
libdvd-pkg: Installing...
Selecting previously unselected package libdvdcss-dev:amd64.
(Reading database ... 351541 files and directories currently installed.)
Preparing to unpack .../libdvdcss-dev_1.4.2-1~local_amd64.deb ...
Unpacking libdvdcss-dev:amd64 (1.4.2-1~local) ...
Selecting previously unselected package libdvdcss2:amd64.
Preparing to unpack .../libdvdcss2_1.4.2-1~local_amd64.deb ...
Unpacking libdvdcss2:amd64 (1.4.2-1~local) ...
Setting up libdvdcss2:amd64 (1.4.2-1~local) ...
Setting up libdvdcss-dev:amd64 (1.4.2-1~local) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.5 is not a symbolic link


Upon installing dependencies, I was able to open and play DVD disc:






References: