Monday, September 18, 2017

Ubuntu Basics

In this article, I am going to write some basic Ubuntu operations which we need day today. I am gonna describe everything like a list and this list goes on updated.

Font Installation

One of the frequently facing problems we get is the required fonts are not installed and we have to install by ourselves. Yes, there are several ways to install fonts in Ubuntu system. First of all, we have to know where the fonts are located and what is the purpose of the fonts.

First of all, we have to know about user-defined fonts i.e. every defines their fonts in their home directory:

~/.fonts

The fonts in this directory are only for the specific user and not available globally.

If we have to make the fonts globally available, then we have to copy the fonts into other locations.The locations can be defined in

/etc/fonts/fonts.conf 

The default directories are
/usr/share/fonts, 
/usr/local/share/fonts 
and
~/.fonts

So, if we copy directly into the /usr/share/fonts or /usr/local/share/fonts to make the font available for all users. Of course, you have to be an administrator to copy the fonts into the above-mentioned directories.

Here is the sample fonts to test. 

Sample Fonts


After copying into the corresponding directories, we have to run the following commands:

sudo fc-cache -fv

If the system is rebooted, we do not need to execute the above command, fonts are loaded automatically.

After installation is complete, we check if the fonts have been successfully installed.

sudo fc-list |grep verdana

If the font is successfully installed, then it shows the newly installed font.

Note: we need to restart the application which is using the font to reflect the newly installed fonts.

Localization

This is one of the common problems I have faced. Basically, when using the German alphabets with umlauts, they are not properly displayed because of unicode related problems.

Here, I will try to explain as simple as possible to work around with that:

  • Check the current local settings:
      $ locale

  • See the available locales
      $ locale -a  

  • If locale is not in the list, then it should be generated(installed)
     $ locale-gen fr_FR.UTF-8


  • To regenarate locales, 
     $ locale-gen  
  • The default settings are stored in /etc/default/locale file. 
      We can directly change the contents of this file. Or we can use the command update-locale.
      $ update-locale LANG=de_DE.UTF-8

Note: the supported locales are located in the file /usr/share/i18n/SUPPORTED.

Shortcut Method:  

From a terminal, run the following command, and select the required locales. That does everything we needed!

$ sudo dpkg-reconfigure locales


Yes, it is recommended to restart the system to properly load the locales.

Quickly Test USB Boot

  • Install qumu

            sudo apt install qemu

  • Test ISO
      qemu-system-x86_64 -cdrom filename.iso
  • Test USB
      qemu-system-x86_64 -hda /dev/sdx



Date Time Settings


This section describes how can we set date and time in the Ubuntu system from the command terminal. The auto-update of date-time is carried out through the NTP server, the configuration of datetime sync server is a different topic. We simply set the date and time here.

First of all, there are two clocks: 1) System clock, 2) Hardware clock

Here, the date-time set in the hardware clock is what we see the time in Bios, and if Bios time is not correct, then the system time could be also incorrect because when system boots, it gets time from Hardware clock.

So, if the hardware clock is wrong by any chance, the system time also gets wrong.

1) See system date and time
$ date
2) Set system date and time
$ sudo date -s '2017-10-04 16:31:32'
3) See hardware clock time
$ sudo hwclock
4) Set hardware clock time from system time
$sudo hwclock -w
5) Set system time from hardware clock time
$sudo hwclock -s

In the above commands, -w can be replaced with --systohc and -s can be replaced with --hctosys.

Enable Remote Desktop in Ubuntu Server  

If we install a standalone Ubuntu server and want it to be accessible via remote desktop, we have to do some extra tasks. Since, ubuntu-server comes without any desktop application, i.e. no GUI possible, only terminal. That's cool if you are familiar with the command line terminal. If you still want to make your server available via remote desktop, we have to install the desktop application on the server. The program we need for remote desktop is xrdp.

So, we install it using the terminal as follows:

sudo apt update
sudo apt upgrade
sudo apt install xrdp
sudo apt install ubuntu-mate-core ubuntu-mate-desktop 
echo mate-session >~/.xsession
sudo service xrdp restart


Then we are ready to connect using rdesktop from Linux and remote desktop from windows based systems.



No comments:

Post a Comment