Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 – Part Two

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

In the previous blog post we installed the Ubuntu 18.04 LTS system. Now, I, Old Wu, plan to delve into some basic concepts of Ubuntu.

Ubuntu is a South African concept focusing on the loyalty and connection between people. The word comes from Zulu and Xhosa. Ubuntu (pronounced “oo-BOON-too”) is regarded as a traditional African philosophy and is one of the fundamental principles for building the new South African republic, closely related to the ideals of African renaissance. The essence of the Ubuntu spirit is to “treat others with humanity” (humanity towards others). Another translation could be: “the belief that the world is shared, connecting everyone”.

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

“A person with the spirit of Ubuntu is open-hearted, helpful, and aspires to emulate the virtuous without being jealous of the capable, because he/she possesses a moderate level of confidence, stemming from the recognition that one belongs to a larger whole. When others are harmed or die, when others are tortured or oppressed, this whole disappears.”

Free Software

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

The Ubuntu project fully adheres to the principles of open-source software development and encourages people to use, improve, and spread open-source software. This means that Ubuntu is currently and will always be free. However, this does not just mean zero cost; the philosophy of free software is that people should be able to use software freely in all “socially useful” ways. “Free software” does not only mean you do not have to pay for it; it also means you can use the software in any way you want: anyone can download, modify, fix, and use the code that makes up free software in any manner. Therefore, apart from the fact that free software is often provided at no cost, this freedom also has technical advantages: during program development, one can leverage the results of others or build upon them. This is not possible with non-free software, where one must always start from scratch. For these reasons, the development of free software is swift, efficient, and exciting.

What Makes Ubuntu Different

There are currently many different operating systems based on GNU/Linux, such as Debian, SuSE, Gentoo, RedHat, and Mandriva. In this already competitive world, Ubuntu is another participant. So what makes Ubuntu different? Debian is a well-regarded, technically advanced distribution with good support, and Ubuntu is based on Debian, aiming to create a consistent and up-to-date Linux system for desktops and servers.

Ubuntu encompasses a large number of carefully selected software packages from the Debian distribution while retaining Debian’s powerful package management system for easy installation or complete removal of programs. Unlike most distributions that come with a huge number of optional software, Ubuntu’s package list contains only high-quality essential applications. While focusing on quality, Ubuntu provides a robust and feature-rich computing environment suitable for both home use and commercial environments. This project spends a significant amount of necessary time striving for excellence, releasing a new version every six months to provide the latest and most powerful software. Ubuntu supports a variety of architectures, including i386, AMD64, and PowerPC.

Ubuntu and Debian are two of the most influential Linux distributions ever. Among approximately 285 active distributions, 132 are derived from Debian (including Ubuntu itself), while 67 are directly derived from Ubuntu. However, the experience of using these two distributions is almost different in every aspect. Therefore, making a choice between Ubuntu and Debian is not an easy task.

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

If you were asked to explain the difference between Ubuntu and Debian, most would respond: Ubuntu is a beginner-oriented distribution, while Debian is expert-oriented. This description is partially correct but also exaggerated.

Also, from a design perspective, Ubuntu is very easy to use. If your work habits do not align with these concepts, you might strongly oppose the idea of Ubuntu being easy to use.

However, although Ubuntu is derived from Debian, the differences between the two are still very pronounced. From installation and desktop environments to package management and community, people may believe they understand Ubuntu and Debian, but this understanding may be incorrect or at least need strict limitations—this makes the choice of which distribution fits your business strategy very difficult.

  • Differences in Installation

Currently, which distribution you can use depends on the hardware you have. Debian currently supports approximately 13 hardware architectures: from standard 32-bit and 64-bit Intel architectures to ARM and PowerPC architectures, as well as two other architectures that are in development. In contrast, Ubuntu supports both 32-bit and 64-bit versions of these two different desktop environments and is currently developing an Ubuntu ARM version for mobile devices.

Another aspect to consider is the installer for each distribution. Ubuntu’s standard installer is designed to require minimal user input to ensure that installation is simple and as fast as possible. If you encounter any issues, you can try the expert mode installer, which is a slightly modified version of the Debian installer.

The Debian installer clearly has other priorities. For example, its graphical version is GUI, which differs from the primarily text-based installer in the toolkit: aside from reassuring those users who are afraid of using the command line, there is no advantage to it.

In contrast, Debian has a reputation for being installable simply by following online instructions and accepting default settings at each stage. However, if you decide to make your own choices, you can select every setting at each step during the installation process, significantly increasing the time required for installation. The Debian installer does not cater to inexperienced users but accommodates users of all skill levels. It is not very pretty, but you do not have to compile your own packages, so you cannot find a more flexible installer.

  • Differences in Management and Package Management

Both Debian and Ubuntu encourage using root accounts for management and restricted accounts for daily operations, which is not surprising. However, the chosen security modes differ.

In Debian, users typically log into the root account directly to perform administrative tasks and then log out as soon as possible to minimize the security risk. However, Ubuntu hides the root password; instead of using sudo, it allows at least one user to enter their own password to issue administrative commands.

Debian’s packages are primarily divided into three categories: testing, stable, and unstable. New packages enter stable, then transform into testing after debugging. Once the official version is ready, existing packages in testing undergo further scrutiny before becoming the new stable version.

In recent years, additional packages, both official and unofficial, have been added, such as Backports, Experimental, Security, Old Stable, and Update. However, users need to focus primarily on the three main categories of software repositories.

One of the advantages of the Debian system is that you can choose between two extremes: extremely stable, but with older versions; or very advanced, but with less stable software, where significant changes in technology might cause the systems of uninformed users to crash. The choice here depends on whether you want to upgrade core components (like the Linux kernel) or upgrade standalone utility tools in the built-in code library that do not affect anything else when a disaster occurs.

In contrast, Ubuntu’s packages come from Debian’s testing or unstable versions. Ubuntu’s software repositories are organized according to different criteria rather than by testing status. Main contains software supported by Canonical, and Universe contains software supported by the Ubuntu community. Restricted contains proprietary drivers, while Multiverse contains software with copyright or other legal restrictions.

Another major difference is that Debian is more committed to advocating software freedom. By default, it only installs free software, and the installer even provides a kernel without proprietary firmware. If you need non-free software, you must add the Nonfree and Contrib components for each repository.

In contrast, the distinction between free and proprietary is not as clear in Ubuntu. Here, Debian does not encourage the use of proprietary software but allows users to make their own choices; on the other hand, Ubuntu encourages users to install proprietary software to obtain a computing experience comparable to other commercial operating systems. If you want to try, you can achieve the same experience on Debian, but Debian makes it clearer that you sacrifice software freedom when you do so.

  • Differences in Desktop Environments

Ubuntu and Debian use different desktop environments by default. Ubuntu uses Unity by default; in recent years, the company behind Ubuntu, Canonical, has been developing this desktop. However, with Ubuntu 18.04, the Ubuntu desktop has returned to GNOME, now featuring GNOME 3.28.

However, those default desktops mean little beyond convenience. Both Debian and Ubuntu support multiple desktops. In Ubuntu, desktops are semi-independent distributions, including Xubuntu for Xfce and Kubuntu for KDE. These variants use the same underlying GNOME technology as standard Ubuntu, but it is uncertain whether they will sync with the official version, as the time difference is less than a few weeks.

In Debian, the choices in terms of desktop are roughly the same, but the teams developing the desktops are more closely related to the teams developing standard Debian. The timelines for those versions vary, so it is always expected to spend some time online searching to check the status of the development results from the teams you might be interested in.

Besides Unity, most software written for Ubuntu also has versions for Debian. Software written for Debian almost always has versions for Ubuntu, as Ubuntu’s packages come from Debian’s repositories. Because Debian’s release cycle is notoriously slow, Ubuntu’s software is often more up-to-date than Debian’s. However, the advantage is that Debian tends to be more stable and undergoes more comprehensive testing.

As a reminder: do not assume that the shared origin makes the two packages compatible; as although many packages can be installed on both Ubuntu and Debian, there is a significant chance that about 20% of Ubuntu packages will be incompatible with Debian due to differences in naming and file locations.

  • Differences in Community

For users involved in development work, the Ubuntu community and the Debian community are also factors to consider when making a choice. It is well-known that Debian often discusses everything in meticulous detail, especially controversial topics, even to the extent of collective voting.

In recent years, Debian seems to have matured, but discussions can still sometimes turn into a free-for-all. In the past, Debian was described as an unfriendly environment for women; recently, the debate over replacing init with systemd has become very intense, resulting in several senior developers choosing to leave rather than endure the abuse.

Meanwhile, Debian practices elite democracy, where all official maintainers vote to elect Debian leaders and address other issues. While appointed positions can sometimes be a source of power, the leadership style generally practiced by Debian staff is to make suggestions and implement democracy rather than to issue direct orders.

Ubuntu differs from Debian in that it has a code of conduct for community activities. To this day, Ubuntu’s community manager is Jono Bacon, who has written a book introducing “The Art of Community” and has invested significant energy in conflict resolution. Additionally, every year, some members of the Technical Board and Community Council are elected.

However, this apparent democracy differs from actual democracy. Mark Shuttleworth, the founder of Ubuntu, holds a permanent seat on the management board and has decision-making power. Mark and his representatives from Canonical usually have veto power over the community, which has sparked user backlash on several occasions.

  • How to Make the Best Choice

Are you an expert or a beginner? Do you prefer freedom or proprietary software? Usability or control? Do you need platform support? Are you looking for advancement or stability? Unity or GNOME? Moderation and politeness, or open expression and democratic style?

You may have noticed that choosing between Ubuntu and Debian often boils down to which aspect is more important to you.

Before you choose one distribution, I strongly recommend clarifying your situation regarding all these binary choices. You might prioritize one aspect over the others.

However, regardless of what decision you make, you are unlikely to choose incorrectly. Despite the various differences mentioned above, Ubuntu and Debian did not randomly become the two leading distributions in the free software domain. The joint dominance of Ubuntu and Debian indicates that either is a reasonable choice as long as you understand your priorities.

Long-Term Support Versions (LTS)

All versions of Ubuntu provide at least 18 months of security and other upgrade support. LTS versions are somewhat special; they have become quasi-enterprise-grade versions, with Ubuntu’s LTS now releasing an LTS version every two years for both desktop and server editions, providing five years of support updates.

Ubuntu’s Desktop Environments

In addition to the official Ubuntu desktop version, there are several derivative versions:

  • Kubuntu – KDE desktop version of Ubuntu

  • Lubuntu – LXDE desktop version of Ubuntu

  • Xubuntu – Xfce desktop version of Ubuntu

Official Version of Ubuntu

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoSince Ubuntu 18.04 (April 2018), GNOME has become the official desktop environment of Ubuntu Linux. Besides being an extremely stable and easy-to-use desktop environment, one great reason to choose the official version is support services. This official version of Ubuntu is commercially supported by Canonical. You can purchase official support services for Ubuntu desktop at $150.00 per year. Of course, for this level of support, you must purchase support services for at least 50 desktops. For individuals, the best support comes from the Ubuntu forums, Ubuntu documentation, or community help wikis.

Outside of commercial support, another reason to choose the official version of Ubuntu is that if you want a modern and fully functional desktop, it is very reliable and easy to use. GNOME is designed to fit perfectly on desktop and laptop environments. Unlike its predecessor Unity, GNOME can be customized more easily to suit your needs. If you do not like tinkering with the desktop, do not worry; GNOME works great. In fact, the out-of-the-box experience of GNOME might be one of the best desktops on the market, even comparable to (or better than) Mac OS X. If patching and tweaking are your main interests, you will find that GNOME is somewhat limited in that regard. GNOME tuning tools and GNOME Shell extensions will only provide more than you want.

Kubuntu

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoThe K Desktop Environment (KDE) has coexisted with GNOME for a long time and is sometimes misunderstood as a less common desktop. However, with the release of KDE Plasma 5, this has changed. KDE has become a powerful, efficient, and stable desktop, gradually becoming one of the best desktop systems. But why choose Kubuntu over the official version of Ubuntu? The answer is simple—you are accustomed to the desktop style of Windows XP / 7. The start menu, taskbar, system tray, etc., KDE has these and more, all of which will make you feel like you are using the best technology from the past and present. In fact, if you are looking for the Ubuntu version that resembles Windows 7 the most, you will not find a better option than this.

One of the advantages of Kubuntu is that you will find it more flexible than any version of Windows you have used before, while still being reliable/friendly. Do not think that because the desktop provided by KDE resembles Windows 7, it lacks modern features. In fact, Kubuntu has done a great job of updating the Windows 7-like interface to meet more modern aesthetics.

The official version of Ubuntu is not the only featured version providing desktop support. Kubuntu users can also purchase commercial support. Note that it is not cheap; one hour of support service will cost you $103.88.

Lubuntu

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoIf you are looking for a desktop that is easy to use, very fast (so that old hardware feels new), and more flexible than any desktop you have ever used, then Lubuntu is what you want. The only warning about Lubuntu is that you may see a more sparse desktop than you are used to. Lubuntu uses the LXDE desktop and includes a list of applications that maintain a lightweight theme. Therefore, if you want a speedy experience on your desktop, Lubuntu might be a good choice.

However, there is a reminder about Lubuntu that may affect some users’ choices. Due to Lubuntu’s low configuration, its pre-installed applications may not be sufficient for certain tasks. For example, instead of a mature office suite, you will find AibWord word processor and Gnumeric chart tool. Do not misunderstand; both are great tools. However, if you are looking for software suitable for commercial use, you will find they lack friendly support. On the other hand, if you want to install more work-centric tools (like LibreOffice), Lubuntu includes the Synaptic package manager to simplify the installation of third-party software.

Xubuntu

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoAnother excellent Ubuntu official variant that provides low configuration support is Xubuntu. Xubuntu uses the Xfce desktop, while Lubuntu uses LXDE. That is the only difference; this lightweight desktop is more configurable than Lubuntu and includes the more business-friendly LibreOffice office suite.

Xubuntu is ready to use out-of-the-box for anyone, regardless of experience. However, do not think that familiarity means this Ubuntu variant can let you do whatever you want immediately. If you want the traditional out-of-the-box experience of Ubuntu and want to tweak it extensively to become a more modern desktop, then Xubuntu is what you want.

I have always loved one very convenient feature of Xubuntu (like the previous Enlightenment), which is to open the “Start” menu by right-clicking anywhere on the desktop, which can significantly enhance efficiency.

What is Linux?

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoThe Linux kernel, pronounced ‘lee-nucks’, is the core of the Ubuntu operating system. The kernel is an important component of the operating system, serving as a bridge for communication between hardware and software. Linux was born in 1991, initiated by Finnish student Linus Torvalds. At that time, it could only run on i386 systems, essentially a standalone clone of the UNIX kernel, designed to fully utilize the then-new i386 architecture. Nowadays, Linux can run on almost all modern architectures, thanks to the extensive development work done by people around the world. The Linux kernel occupies a significant technical position and also holds an important ideological place. A whole community of people believes in the philosophy of free software and spends a lot of time helping to perfect open-source technology. It is these people in the community that led to the emergence of Ubuntu, contributed to the establishment of many standard committees that regulate Internet development, facilitated the emergence of organizations like the Mozilla Foundation (responsible for creating Mozilla Firefox), and promoted countless other software projects that benefit you.

Ubuntu and Linux Relationship

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoStrictly speaking, the term Linux itself refers only to the Linux kernel, but in practice, people have become accustomed to using Linux to describe entire operating systems based on the Linux kernel that use various tools and databases from the GNU project (also referred to as GNU/Linux). The software based on these components is called Linux distributions.

Distributions are typically written by individuals, teams, as well as commercial organizations and volunteer groups. They usually include other system software and application software, along with an installation tool that simplifies the initial installation of the system and an integrated manager for software installation and upgrades. Distributions are made for many different purposes, including support for different computer architectures, localization for specific regions or languages, real-time applications, and embedded systems; even many versions intentionally include only free software. Currently, over three hundred distributions are actively developed, with about twelve being the most commonly used.

A typical Linux distribution includes: the Linux kernel, some GNU libraries and tools, command line shell, graphical interface X Window system, and corresponding desktop environments, such as KDE or GNOME, and includes thousands of application software from office suites, compilers, text editors to scientific tools.

With limited default software, Lubuntu provides a simple and easy-to-use desktop (Figure 3), allowing anyone to start using it with almost no learning curve.

Ubuntu is the world’s most popular Linux distribution.

What is GNU?

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part TwoThe GNU project, pronounced “guh-noo”, was initiated in 1984 with the goal of developing a complete UNIX-like operating system—the GNU system, composed entirely of free software. Variants of the GNU operating system using the Linux kernel have been widely used; although these systems are often referred to as “Linux”, they should more accurately be called GNU/Linux systems. The GNU project is closely tied to the philosophy of free software, and it is key to projects like Ubuntu that are derived from GNU.

Linux Directory and File System

Linux and Unix file systems are organized into a hierarchical tree structure. The top level of the file system is /, also known as the root directory. In the design philosophy of Unix and Linux, everything is a file, note, everything! is a file!!!—including hard disks, partitions, and removable media. This means that all other files and directories (including other disks and partitions) are located within the root directory. For example: /home/wuchuanbin/hello.c gives the correct complete path, pointing to the hello.c file, which is located in the wuchuanbin directory, which in turn is located in the home directory, and finally, the home directory is located within the root (/) directory.

At the root (/) directory, there is a set of important system directories that are common across most Linux distributions. The common directories directly located at the root (/) directory are as follows:

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

  • /bin – Important binary applications

  • /boot – Boot configuration files

  • /dev – Device files

  • /etc – Configuration files, startup scripts, etc.

  • /home – Local user home directories

  • /lib – System library files

  • /lost+found – Provides a lost+found system at the root (/) directory

  • /media – Mounts removable media, such as CDs, digital cameras, etc.

  • /mnt – Mounted file systems

  • /opt – Provides a directory for optional applications installation

  • /proc – Special dynamic directory for maintaining system information and status, including information about currently running processes.

  • /root – Root user’s home folder, pronounced “slash-root”

  • /sbin – Important system binary files

  • /sys – System files

  • /tmp – Temporary files

  • /usr – Contains most applications and files accessible to all users

  • /var – Frequently changing files, such as logs or databases

Step-by-Step Guide to Setting Up Embedded Development Environment on Ubuntu 18.04 - Part Two

Leave a Comment