How to Install Kernel Headers in Ubuntu and Debian

In our last article, we have explained how to install kernel headers in CentOS 7. Kernel Headers contain the C header files for the Linux kernel, which offers the various function and structure definitions required when compiling any code that interfaces with the kernel, such as kernel modules or device drivers and some user programs.

It is very important to note that the kernel headers package you install should match with the currently installed kernel version on your system. If your kernel version ships with the default distribution installation or you have upgraded your Kernel using dpkg or apt package manager from the Ubuntu or Debian base repositories, then you must install matching kernel headers using package manager only. And if you’ve compiled kernel from sources, you must also install kernel headers from sources.

In this article, we will explain how to install Kernel Headers in Ubuntu and Debian Linux distributions using default package manager.

Install Kernel Headers in Ubuntu and Debian

First check your installed kernel version as well as kernel header package that matches your kernel version using following commands.

$ uname -r
$ apt search linux-headers-$(uname -r)
Check Kernel Version and Kernel Headers in Ubuntu

Check Kernel Version and Kernel Headers in Ubuntu


On Debian, Ubuntu and their derivatives, all kernel header files can be found under /usr/src directory. You can check if the matching kernel headers for your kernel version are already installed on your system using the following command.

$ ls -l /usr/src/linux-headers-$(uname -r)
Check Kernel Headers in Ubuntu

Check Kernel Headers in Ubuntu

From the above output, it’s clear that the matching kernel header directory doesn’t exist, meaning the package is not yet installed.

Before you can install the appropriate kernel headers, update your packages index, in order to grab information about the latest package releases, using the following command.

$ sudo apt update

Then run the following command that follows to install the Linux Kernel headers package for your kernel version.

$ sudo apt install linux-headers-$(uname -r)
Install Kernel Headers in Ubuntu

Install Kernel Headers in Ubuntu

Next, check if the matching kernel headers have been installed on your system using the following command

$ ls -l /usr/src/linux-headers-$(uname -r)
Verify Installed Kernel Headers in Ubuntu

Verify Installed Kernel Headers in Ubuntu

That’s all! In this article, we have explained how to install kernel headers in Ubuntu and Debian Linux and other distributions in the Debian family tree.

Always keep in mind that to compile a kernel module, you will need the Linux kernel headers. If you have any quires, or thoughts to share, use the comment form below to reach us.

Getting started with regular expressions

Regular expressions can be one of the most powerful tools in your toolbox as a Linux user, system administrator, or even as a programmer. It can also be one of the most daunting things to learn, but it doesn’t have to be! While there are an infinite number of ways to write an expression, you don’t have to learn every single switch and flag. In this short how-to, I’ll show you a few simple ways to use regex that will have you running in no time and share some follow-up resources that will make you a regex master if you want to be.

A quick overview

Regular expressions, also referred to as “regex” patterns or even “regular statements,” are in simple terms “a sequence of characters that define a search pattern.” The idea came about in the 1950s when Stephen Cole Kleene wrote a description of an idea he called a “regular language,” of which part came to be known as “Kleene’s theorem.” At a very high level, it says if the elements of the language can be defined, then an expression can be written to match patterns within that language.

Since then, regular expressions have been part of even the earliest Unix programs, including vi, sed, awk, grep, and others. In fact, the word grep is derived from the command that was used in the earliest “ed” editor, namely g/re/p, which essentially means “do a global search for this regular expression and print the lines.” Cool!

Why we need regular expressions

As mentioned above, regular expressions are used to define a pattern to help us match on or “find” objects that match that pattern. Those objects can be files in a filesystem when using the find command for instance, or a block of text in a file which we might search using grep, awk, vi, or sed, for example.

Start with the basics

Let’s start at the very beginning; it’s a very good place to start.

The first regex everyone seems to learn is probably one you already know and didn’t realize what it was. Have you ever wanted to print out a list of files in a directory, but it was too long? Maybe you’ve seen someone type \*.gif to list GIF images in a directory, like:

$ ls *.gif

That’s a regular expression!

When writing regular expressions, certain characters have special meaning to allow us to move beyond matching just characters to matching entire sets of characters. In this case, the * character, also called “star” or “splat,” takes the place of filenames and allows you to match all files ending with .gif.

Search for patterns in a file

The next step in your regex foo training is searching for patterns within a file, especially using the replace pattern to make quick changes.

Two common ways to do this are:

  1. Use vi to open the file, search for a pattern, and make the change (even automatically using replace).
  2. Use the “stream editor,” aka sed, to programmatically search within the file and make the change.

Let’s start by learning some regex by using vi to edit the following file:

The quick brown fox jumped over the lazy dog.
Simple test
Harder test
Extreme test case
ABC 123 abc 567
The dog is lazy

Now, with this file open in vi, let’s look at some regex examples that will help us find some matching strings inside and even replace them automatically.

To make things easier, let’s set vi to ignore case. Type set ic to enable case-insensitive searching.

Now, to start searching in vi, type the / character followed by your search pattern.

Search for things at the beginning or end of a line

To find a line that starts with “Simple,” use this regex pattern:

Notice in the image below that only the line starting with “Simple” is highlighted. The carat symbol (^) is the regex equivalent of “starts with.”

'Simple' highlighted

Next, let’s use the $ symbol, which in regex speak is “ends with.”

'Test' highlighted

See how it highlights both lines that end in “test”? Also, notice that the fourth line has the word test in it, but not at the end, so this line is not highlighted.

This is the power of regular expressions, giving you the ability to quickly look across a great number of matches with ease but specifically drill down on only exact matches.

Test for the frequency of occurrence

To further extend your skills in regular expressions, let’s take a look at some more common special characters that allow us to look for not just matching text, but also patterns of matches.

Frequency matching characters:

Character Meaning Example
* Zero or more ab* – the letter a followed by zero or more b‘s
+ One or more ab+ – the letter a followed by one or more b‘s
? Zero or one ab? – zero or just one b
{n} Given a number, find exactly that number ab{2} – the letter a followed by exactly two b‘s
{n,} Given a number, find at least that number ab{2,} – the letter a followed by at least two b‘s
{n,y} Given two numbers, find a range of that number ab{1,3} – the letter a followed by between one and three b‘s

Find classes of characters

The next step in regex training is to use classes of characters in our pattern matching. What’s important to note here is that these classes can be combined either as a list, such as [a,d,x,z], or as a range, such as [a-z], and that characters are usually case sensitive.

To see this work in vi, we’ll need to turn off the ignore case we set earlier. Let’s type: set noic to turn ignore case off again.

Some common classes of characters that are used as ranges are:

  • a-z – all lowercase characters
  • A-Z – all UPPERCASE characters
  • 0-9 – numbers

Now, let’s try a search similar to one we ran earlier:

Do you notice that it finds nothing? That’s because the previous regex looks for exactly “tT.” If we replace this with:

We’ll see that both the lowercase and UPPERCASE T’s are matched across the document.

Letter 't' highlighted

Now, let’s chain a couple of class ranges together and see what we get. Try:

capital letters and 123 are highlighted

Notice that the capital letters and 123 are highlighted, but not the lowercase letters (including the end of line five).

Flags

The last step in your beginning regex training is to understand flags that exist to search for special types of characters without needing to list them in a range.

  • . – any character
  • \s – whitespace
  • \w – word
  • \d – digit (number)

For example, to find all digits in the example text, use:

Notice in the example below that all of the numbers are highlighted.

numbers are highlighted

To match on the opposite, you usually use the same flag, but in UPPERCASE. For example:

  • \S – not a space
  • \W – not a word
  • \D – not a digit

Notice in the example below that by using \D, all characters EXCEPT the numbers are highlighted.

all characters EXCEPT the numbers are highlighted

Searching with sed

A quick note on sed: It’s a stream editor, which means you don’t interact with a user interface. It takes the stream coming in one side and writes it out the other side.

Using sed is very similar to vi, except that you give it the regex to search and replace, and it returns the output. For example:

sed s/dog/cat/ examples

will return the following to the screen:

Searching and replacing

If you want to save that file, it’s only slightly more tricky. You’ll need to chain a couple of commands together to a) write that file, and b) copy it over the top of the first file.

To do this, try:

sed s/dog/cat/ examples > temp.out; mv temp.out examples

Now, if you look at your examples file, you’ll see that the word “dog” has been replaced.

The quick brown fox jumped over the lazy cat.
Simple test
Harder test
Extreme test case
ABC 123 abc 567
The cat is lazy

For more information

I hope this was a helpful overview of regular expressions. Of course, this is just the tip of the iceberg, and I hope you’ll continue to learn about this powerful tool by reviewing the additional resources below.

Where to get help

For more examples, check out

Choosing the right open source tool for movie project management

One thing artists, engineers, and hackers share in common is their antipathy for management. So, when the time comes when we actually need project management, it comes as a painful growing experience.

For the Lunatics! animated open movie project, we started by using basic tools popular with open source software projects, like a version control system (Subversion), a wiki (MediaWiki), and a bug-tracker and online browser for the source code (Trac). This is viable for a team of a half-dozen people and an unhurried schedule on a volunteer project. But it quickly becomes unmanageable for larger teams and tighter schedules.

Fortunately, there are plenty of open source project management software packages, which can provide structural guidance and hold a lot more information about your project than you can comfortably keep in your own head, freeing you to apply yourself more creatively. The challenge is choosing the right package. And for that, we need to think more carefully about what we want from it.

My previous article dealt with the first and most concrete aspect of this problem: digital asset management. But even more important are the people working on the project and how they apply their time and resources to it, so we have to define what we need for that.

Defining what we need to manage

Breakdown

Project management starts with breaking down the big goal into lots of smaller goals—ideally down to the individual assets needed. This is called the breakdown.

Breakdown can be done by reviewing the script and identifying and listing the elements needed to produce each scene. At its simplest, it can be done in a text editor, but more streamlined solutions can speed things up.

Workflow

Once you have broken down the film into its individual assets, each asset will have to go through key phases of production—for example, a 3D model will need to be designed, modeled, textured, rigged, and animated. Each step might be done by a different person with specialized skills, so the asset will have to move from person to person.

Since asset formats (such as our Blender files) often can’t be merged if two people try to work on a file at once, it’s important to keep track of each asset’s phase and who has control of it. If you mess up and produce two parallel, out-of-sync versions of the file, you’ll probably have to ditch one of them and repeat the other work.

Scheduling and time management

Productions run on timetables. You want to be able to tell people when you will be finished, and you want to finish first things first.

You also may need to identify specific times when you can meet to discuss the project, and—depending on the terms of collaboration—you may need to keep track of the time spent by collaborators on the project.

Until now, we’ve handled most of these tasks through simple text files or LibreOffice Calc spreadsheets, in some cases shared through a MediaWiki site.

Communications

A key problem to solve for a team mediated by the internet is how to maintain context for conversations: you need everyone involved to know what you are talking about.

Much of the time spent on communications involves communicating the context of the conversation—what project, asset, or task are we talking about? We’ve done that using GIMP or Inkscape to produce quick markup images that we share by chat, email, or a phpBB forum.

Things can be done to speed that up. Blender contains its own internal markup system, called Grease Pencil, although it isn’t much faster to use than sketching over a screen capture (although it does work better in 3D, and in fact, it’s so sophisticated people have produced short animated films using it artistically).

We’ve considered using videoconferencing and digital whiteboard package Big Blue Button (on GitHub) for team communications, but it’s probably overkill for our project.

New platform options

To step up from our existing Trac site, we might first consider Trac-like alternatives for managing the project, such as Redmine, which would add several new project management tools, including search, workflow, and scheduling features in addition to handling multiple projects.

We could also look at what other projects are using. Blender Foundation runs a Software-as-a-Service subscription platform for open movies called Blender Cloud. Its core project management software is Attract (see its development site). This is tightly integrated with Blender and provides an API that can be accessed from Blender. It’s definitely an attractive option for a Blender-centered project.

Morevna Project has experimented with dotProject (development on GitHub) in the past and more recently with Open Project.

Urchn.org’s “Tube” project has been using Helga for years, but it is essentially orphaned now (see its development on the Internet Archive).

For business reasons, we are also considering installing an open source enterprise platform called Odoo (previously known as OpenERP), which includes the Odoo Project (with development on GitHub). That would potentially be an easy add for us as well.

Wikipedia offers a comparison of project management packages, of which 31 are open source. Aside from the ones mentioned above a few stand out as interesting.

ProjeQtor and TACTIC are among the most full-featured options on that list.

As mentioned in my previous Opensource.com article about asset management, TACTIC was a competitor for the production-management software used with the Blender Gooseberry Project (producing Cosmos Laundromat) before Blender Foundation decided to create a custom solution.

We chose the TACTIC platform because it is:

  • Designed specifically for animation production
  • Highly flexible in terms of workflow, scheduling, and collaboration features and allows template-based, per-project assignment of workflows and asset types
  • Tightly coupled with the digital asset management system, automatically associating tickets, workflow, schedules, and conversations within the context of each asset
  • Neutral on the choice of creative application (web-based interfaces)
  • Easy to integrate with clients through its web API
  • Written in Python, which is a clearly understandable language we have the skills to work with
  • Quite complete in available project management reports and features

Combined with Odoo for business commerce applications and Mumble for real-time voice communications, our new TACTIC platform should allow us to meet our goals of speeding production and growing our team to manage it.

Useful Linux Command Line Bash Shortcuts You Should Know

In this article, we will share a number of Bash command-line shortcuts useful for any Linux user. These shortcuts allow you to easily and in a fast manner, perform certain activities such as accessing and running previously executed commands, opening an editor, editing/deleting/changing text on the command line, moving the cursor, controlling processes etc. on the command line.

Although this article will mostly benefit Linux beginners getting their way around with command line basics, those with intermediate skills and advanced users might also find it practically helpful. We will group the bash keyboard shortcuts according to categories as follows.

Launch an Editor

Open a terminal and press Ctrl+X and Ctrl+E to open an editor (nano editor) with an empty buffer. Bash will try to launch the editor defined by the $EDITOR environment variable.

Nano Editor

Nano Editor

Controlling The Screen

These shortcuts are used to control terminal screen output:

  • Ctrl+L – clears the screen (same effect as the “clear” command).
  • Ctrl+S – pause all command output to the screen. If you have executed a command that produces verbose, long output, use this to pause the output scrolling down the screen.
  • Ctrl+Q – resume output to the screen after pausing it with Ctrl+S.

Move Cursor on The Command Line


The next shortcuts are used for moving the cursor within the command-line:

  • Ctrl+A or Home – moves the cursor to the start of a line.
  • Ctrl+E or End – moves the cursor to the end of the line.
  • Ctrl+B or Left Arrow – moves the cursor back one character at a time.
  • Ctrl+F or Right Arrow – moves the cursor forward one character at a time.
  • Ctrl + Left Arrow or Alt+B or Esc and then B – moves the cursor back one word at a time.
  • Ctrl + Right Arrow or Alt+C or Esc and then F – moves the cursor forward one word at a time.

Search Through Bash History

The following shortcuts are used for searching for commands in the bash history:

  • Up arrow key – retrieves the previous command. If you press it constantly, it takes you through multiple commands in history, so you can find the one you want. Use the Down arrow to move in the reverse direction through the history.
  • Ctrl+P and Ctrl+N – alternatives for the Up and Down arrow keys, respectively.
  • Ctrl+R – starts a reverse search, through the bash history, simply type characters that should be unique to the command you want to find in the history.
  • Ctrl+S – launches a forward search, through the bash history.
  • Ctrl+G – quits reverse or forward search, through the bash history.

Delete Text on the Command Line

The following shortcuts are used for deleting text on the command line:

  • Ctrl+D or Delete – remove or deletes the character under the cursor.
  • Ctrl+K – removes all text from the cursor to the end of the line.
  • Ctrl+X and then Backspace – removes all the text from the cursor to the beginning of the line.

Transpose Text or Change Case on the Command Line

These shortcuts will transpose or change the case of letters or words on the command line:

  • Ctrl+T – transposes the character before the cursor with the character under the cursor.
  • Esc and then T – transposes the two words immediately before (or under) the cursor.
  • Esc and then U – transforms the text from the cursor to the end of the word to uppercase.
  • Esc and then L – transforms the text from the cursor to the end of the word to lowercase.
  • Esc and then C – changes the letter under the cursor (or the first letter of the next word) to uppercase, leaving the rest of the word unchanged.

Working With Processes in Linux

The following shortcuts help you to control running Linux processes.

  • Ctrl+Z – suspend the current foreground process. This sends the SIGTSTP signal to the process. You can get the process back to the foreground later using the fg process_name (or %bgprocess_number like %1, %2 and so on) command.
  • Ctrl+C – interrupt the current foreground process, by sending the SIGINT signal to it. The default behavior is to terminate a process gracefully, but the process can either honor or ignore it.
  • Ctrl+D – exit the bash shell (same as running the exit command).

Learn more about: All You Need To Know About Processes in Linux [Comprehensive Guide]

Bash Bang (!) Commands

In the final part of this article, we will explain some useful ! (bang) operations:

  • !! – execute last command.
  • !top – execute the most recent command that starts with ‘top’ (e.g. !).
  • !top:p – displays the command that !top would run (also adds it as the latest command in the command history).
  • !$ – execute the last word of the previous command (same as Alt +., e.g. if last command is ‘cat tecmint.txt’, then !$ would try to run ‘tecmint.txt’).
  • !$:p – displays the word that !$ would execute.
  • !* – displays the last word of the previous command.
  • !*:p – displays the last word that !* would substitute.

For more information, see the bash man page:

$ man bash 

That’s all for now! In this article, we shared some common and useful Bash command-line shortcuts and operations. Use the comment form below to make any additions or ask questions.

How to Install Kernel Headers in CentOS 7

When you compile a custom kernel module such as device driver on a CentOS system, you need to have kernel header files installed on the system, which include the C header files for the Linux kernel. Kernel header files provide different kinds of function and structure definitions required when installing or compiling any code that interfaces with the kernel.

When you install Kernel Headers, make sure it matches with the currently installed kernel version on the system. If your Kernel version comes with the default distribution installation or you have upgraded your Kernel using yum package manager from system base repositories, then you must install matching kernel headers using package manager only. If you’ve compiled Kernel from sources, you can install kernel headers from sources only.

Read Also: How to Install Kernel Headers in Ubuntu and Debian

In this article, we will explain how to install Kernel Headers in CentOS/RHEL 7 and Fedora distributions using default package manager.

Install Kernel Headers in CentOS 7


First confirm that the matching kernel headers are already installed under /usr/src/kernels/ location on your system using following commands.

# cd /usr/src/kernels/
# ls -l
Check Kernel Headers in CentOS 7

Check Kernel Headers in CentOS 7

If no matching kernel headers are located in the /usr/src/kernels/ directory, go ahead and install kernel headers, which is provided by the kernel-devel package that can be installed using default package manager as shown.

# yum install kernel-devel [On CentOS/RHEL 7]
# dnf install kernel-devel [On Fedora 22+]
Install Kernel Headers in CentOS 7

Install Kernel Headers in CentOS 7

After installing the kernel-devel package, you can find all the kernel headers files in /usr/src/kernels directory using following command.

# ls -l /usr/src/kernels/$(uname -r) 

Note on a VPS (for instance a Linode VPS), a kernel may have a customized version name, in such scenario, you have to identify the kernel version manually and check the installed kernel header files using following commands.

# uname -r # ls -l /usr/src/kernels/3.10.0-862.2.3.el7.x86_64
Check Kernel Version in CentOS 7

Check Kernel Version in CentOS 7

Sample Output
total 4544
drwxr-xr-x. 32 root root 4096 May 16 12:48 arch
drwxr-xr-x. 3 root root 4096 May 16 12:48 block
drwxr-xr-x. 4 root root 4096 May 16 12:48 crypto
drwxr-xr-x. 119 root root 4096 May 16 12:48 drivers
drwxr-xr-x. 2 root root 4096 May 16 12:48 firmware
drwxr-xr-x. 75 root root 4096 May 16 12:48 fs
drwxr-xr-x. 28 root root 4096 May 16 12:48 include
drwxr-xr-x. 2 root root 4096 May 16 12:48 init
drwxr-xr-x. 2 root root 4096 May 16 12:48 ipc
-rw-r--r--. 1 root root 505 May 9 19:21 Kconfig
drwxr-xr-x. 12 root root 4096 May 16 12:48 kernel
drwxr-xr-x. 10 root root 4096 May 16 12:48 lib
-rw-r--r--. 1 root root 51205 May 9 19:21 Makefile
-rw-r--r--. 1 root root 2305 May 9 19:21 Makefile.qlock
drwxr-xr-x. 2 root root 4096 May 16 12:48 mm
-rw-r--r--. 1 root root 1093137 May 9 19:21 Module.symvers
drwxr-xr-x. 60 root root 4096 May 16 12:48 net
drwxr-xr-x. 14 root root 4096 May 16 12:48 samples
drwxr-xr-x. 13 root root 4096 May 16 12:48 scripts
drwxr-xr-x. 9 root root 4096 May 16 12:48 security
drwxr-xr-x. 24 root root 4096 May 16 12:48 sound
-rw-r--r--. 1 root root 3409102 May 9 19:21 System.map
drwxr-xr-x. 17 root root 4096 May 16 12:48 tools
drwxr-xr-x. 2 root root 4096 May 16 12:48 usr
drwxr-xr-x. 4 root root 4096 May 16 12:48 virt
-rw-r--r--. 1 root root 41 May 9 19:21 vmlinux.id

In addition, if you need header files for the Linux kernel for use by glibc, install the kernel-header package using following command.

# yum install kernel-headers [On CentOS/RHEL 7]
# dnf install kernel-headers [On Fedora 22+]

Now you are good to go with compiling your own or existing kernel modules for software such as VirtualBox and many more.

That’s it! In this article, we have explained how to install kernel-devel and kernel-header packages in CentOS/RHEL 7 and Fedora systems. Remember that before you can compile kernel modules such as device driver on a Linux system, you should have necessary kernel header files installed. If you have queries, please use the comment form below to reach us.

Linux Fun – Play Old Classic Snake Game in Linux Terminal

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘Linux Fun – Play Old Classic Snake Game in Linux Terminal’,media: ‘https://www.tecmint.com/wp-content/uploads/2018/05/Play-Snake-Game-in-Linux-Terminal.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

How to Install and Use Yaourt in Arch Linux

Yaourt (Yet Another User Repository Tool) is an advanced command line tool for installing packages on Arch Linux. It is a powerful wrapper for Pacman, the standard package management utility for Arch Linux with extended features and remarkable AUR (Arch Linux User Repository) support.

It is used to search, install and upgrade packages from AUR interactively, supports checking conflicts and dependency resolution. It can display colored output, show information about available packages, allows you to query packages based on different options, supports building packages directly from AUR or ABS (Arch Build System) source.

Yaourt is also used to manage backup files (typically .pac* files), query directly from a backup file; it can save and restore alpm databases, test local databases and also search orphaned packages. In addition, it supports splitting packages, and can sort packages by installation date and so much more.

Unfortunately, Yaourt doesn’t exist in the official package repository of Arch Linux Installation. You need to manually install Yaourt on Arch Linux using following two different ways.

Method 1: Install Yaourt in Arch Linux Using AUR


This method is a little longer, if you want a quick way of installing Yaourt, then check out the second method. Here, you need to start by installing all required packages as shown.

$ sudo pacman -S --needed base-devel git wget yajl
$ cd /tmp
$ git clone https://aur.archlinux.org/package-query.git
$ cd package-query/
$ makepkg -si && cd /tmp/
$ git clone https://aur.archlinux.org/yaourt.git
$ cd yaourt/
$ makepkg -si

Method 2: Install Yaourt in Arch Linux Using Custom Repository

Begin by adding the custom repository to the pacman package manager repository list.

$ sudo /etc/pacman.conf

Copy and paste the following custom repository configuration in the file.

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Save the changes and exit the file. Then issue the following command to install yaourt.

$ sudo pacman -Sy yaourt

How to Use Yaourt Package Manger in Arch Linux

1. To install or update a package, for example glances, use the -S as shown.

$ sudo yaourt -S glances

2. To remove the package, use the -R flag as shown.

$ sudo yaourt -R glances

3. You can upgrade installed packages with the -U option as shown.

$ sudo yaourt -U target_here

4. To query the local database of packages, use the -Q flag.

$ sudo yaourt -Q | less

5. The next command is used to gather and show info about installed packages as well as configured repositories on a Arch Linux system.

$ yaourt --stats

6. You can sync the pacman package databases with the following command.

$ sudo yaourt -Sy

For more information, refer to the yaourt man page.

$ man yaourt

That’s it! In this article, we have explained two ways of installing Yaourt package management tool in Arch Linux. Use the comment form below to share any queries or thoughts with us.