Showing posts with label Adminstration. Show all posts
Showing posts with label Adminstration. Show all posts

Wednesday, April 22, 2026

Understanding Package Managers in Linux

Package managers make managing software very easy and much simpler on Linux than on Macs or Windows PCs. Learn how...
Photo by Anastasiya Doicheva on Unsplash

Package managers make managing software very easy, making it much simpler to install software on Linux than it is on Macs or Windows PCs.

With package managers, both regular users and sysadmins have access to a simple process to install, upgrad, revert, and remove applications in Linux.

In this article, we'll explore the package managers associated with some of the most popular Linux distributions: Alpine, Debian/Ubuntu, Arch, RHEL, and SUSE.

Understanding Package Managers in Linux

Package managers are programs that allow users install and uninstall software packages efficiently, manage dependencies, and ensure that systems remain organized and secure.

The process behind package managers is simple. First, the user passes the name of a software package as an argument. The package manager then performs a lookup against a package repository to see whether that package exists. If it is found, the package manager installs the application defined by the package and its dependencies to the specified locations on the system.

Package managers can be divided into two categories: binary package managers, which handle precompiled binaries, and source package managers, which build software from source.

Each major Linux distribution often has its own package management system that is tailored to its unique needs. Let's see the most popular ones next.

Package Managers for Popular Distributions

Alpine (apk)

Alpine Package Keeper (apk) is a lightweight package manager designed for simplicity and speed. It uses .apk files and is focused on minimalism and security.

# Install a package
$ apk add <package>

# Remove a package
$ apk del <package>

# Search packages
$ apk search <keyword>

# Update the package index.
$ apk update

# Upgrade installed packages
$ apk upgrade

Debian/Ubuntu (apt)

Advanced Package Tool (apt) is a powerful command-line tool for managing packages. It works with .deb files and allows users to search for, install, and update software across repositories.

# Install a package
$ apt install <package>

# Remove a package
$ apt remove <package>

# Search packages
$ apt search <package>

# Update the package index
$ apt update

# Upgrade all installed packages
$ apt upgrade

Arch (pacman)

Pacman is the package manager for Arch Linux and its derivatives. It uses a simple syntax and manages both binary packages and the sources of the software. Pacman is known for its speed and simplicity.

# Install a package
$ pacman -S <package>

# Remove a package
$ pacman -R <package>

# Search packages
$ pacman -Ss <package>

# Synchronize and update the package database
$ pacman -Sy

# Upgrade all installed packages
$ pacman -Su

RHEL/CentOS (yum/dnf)

Yellowdog Updater Modified (yum) and Dandified YUM (dnf) are package managers for Red Hat-based distributions. They handle .rpm files and are known for their dependency resolution and repository management. DNF is the next-generation version of YUM.

# Install a package
$ yum install <package>
$ dnf install <package>

# Search packages
$ yum search <package>
$ dnf search <package>

# Remove a package
$ yum remove <package>
$ dnf update

SUSE (zypper)

Zypper is the command line package manager for SUSE, designed to manage .rpm packages and their dependencies effectively. It offers features such as delta RPMs, enabling faster downloads and updates. |

# Install a package
$ zypper install <package>

# Remove a package
$ zypper remove <package>

# Search packages
$ zypper search <package>

# Refresh the repository data
$ zypper refresh

# Upgrade all installed packages.
$ zypper update

Conclusion

Understanding package managers is crucial for effective Linux system management.

Each distribution has tailored its package manager, so if you use many distros, make sure you understand well the package manager for your distro.

Mastering these tools can significantly enhance your Linux experience, making software management seamless and efficient. As Linux continues to evolve, familiarity with these package managers will remain a valuable skill for users and administrators alike.

Wednesday, March 25, 2026

What is a Shell in Linux?

Learn what is a shell in Linux, your shortcut to a successful career with Linux and open source software
Photo by Content Pixie on Unsplash

Commonly mentioned in the Linux (and systems administration) world is the word shell. But what is it?

A shell in the context of Linux is a user interface that allows users to interact with the operating system. It provides a way to execute commands, run programs, and manage files from a command-line interface (CLI) instead of a graphical user interface (GUI). 

Types of Shells

There are several types of shells available in Linux, each with its own features. The most common are listed below.

Bash

The Bourne Again SHell, the default shell for many Linux distributions, known for its rich feature set and scripting capabilities.

Zsh

Z Shell, an extended version of Bash with enhanced features such as improved auto-completion and globbing.

Fish

Friendly Interactive SHell, designed for user-friendliness, with syntax highlighting and automatic suggestions.

Tcsh

An enhanced version of the C shell (csh), offering command-line editing and job control. |

Key Functions of a Shell

Let's review why a shell exists in the first place.

Command Execution

You can run commands to perform tasks such as file manipulation, program execution, and system monitoring.

Scripting

Shells allow users to write scripts to automate repetitive tasks, making system administration more efficient.

Environment Management

Users can set and manage environment variables, affecting how processes behave.

Job Control

You can manage running processes, including background tasks and foreground processes.

How to Access the Shell

So how does one access a shell in Linux?

Open the Terminal

You can typically find the terminal in the applications menu or by using a shortcut like `Ctrl + Alt + T`, using the mouse (click on the terminal icon) or in Gnome, press the Super key -> terminal to start it.

Command Line Interface

Once open, you will see a command prompt where you can type commands.

Basic Commands

Here are some basic commands everyone should know while using the shell.

  • ls Lists files and directories.
  • cd [directory]: Changes the current directory.
  • cp [source] [destination]: Copies files or directories.
  • mv [source] [destination]: Moves or renames files or directories.
  • rm [file]: Deletes files.

What to learn next

We recommend learning Bash next. Bash is the default shell in most Linux distros, and also default on enterprise Linux distributions such as Ubuntu or RHEL. 

Conclusion

The shell is an essential component of Linux, giving users powerful functionalities for interaction without needing a graphical interface. Understanding how to use the shell can greatly enhance productivity and system control. Whether you're a beginner or advanced user, getting comfortable with the shell will improve your efficiency in managing a Linux environment.

Monday, March 16, 2026

How to Mount Windows Network Drives in WSL

Mounting network drives in Windows Subsystem for Linux (WSL) opens up a whole new dimension for file management and development. Learn how.
The Linux terminal on Ubuntu

Mounting network drives in Windows Subsystem for Linux (WSL) opens up a whole new dimension for file management and development. This process allows you to access files stored on remote servers or shared folders directly from your WSL environment, making it easier to work across platforms.

In this article we'll review a step-by-step guide on how to do it.

Prerequisites

Before diving in, ensure you have the following:

  • Windows 10 or Windows 11: Ensure WSL is enabled.
  • WSL Installed: You should have WSL set up (either WSL1 or WSL2).
  • Network Share Details: Know the network path (e.g., `\\SERVER\ShareName`) of the shared drive you want to mount.

Mounting Network drives in WSL

1. Enable WSL (If Not Already Done)

If you haven’t enabled WSL on your Windows machine, do so with these steps.

First, oen PowerShell as Administrator by searching for PowerShell in the Start menu, right-click, and choose "Run as Administrator".

Next, let's run the WSL Installation Command:
$ wsl --install

If needed, restart your computer by following any prompts to complete the installation.

2. Install Required Packages in WSL

To work with network drives, you might need the `cifs-utils` package for WSL. Open your WSL terminal and run:

sudo apt update
sudo apt install cifs-utils

3. Create a Mount Point

Next, you'll need to create a directory where the network drive will be mounted. Choose a convenient location, like `/mnt/`.

sudo mkdir /mnt/my_network_drive

4. Mount the Network Drive

Now it's time to mount the network drive. Use the following command, replacing the placeholders with your actual server address, share name, username, and password:

sudo mount -t cifs //SERVER/ShareName /mnt/my_network_drive -o username=YOUR_USERNAME,password=YOUR_PASSWORD
- **Example**:
sudo mount -t cifs //192.168.1.10/SharedFolder /mnt/my_network_drive -o username=user,password=pass

5. Access the Mounted Drive

You can now access your network drive at `/mnt/my_network_drive`. Use commands like `ls` to view the contents:

ls /mnt/my_network_drive

6. Unmounting the Drive

When you're finished, you can unmount the drive with:

sudo umount /mnt/my_network_drive

Additional Tips

Persistent Mounting

To automatically mount the drive at WSL startup, add the following line to your `/etc/fstab`:
//SERVER/ShareName /mnt/my_network_drive cifs username=YOUR_USERNAME,password=YOUR_PASSWORD 0 0

Security Considerations

Storing passwords in plain text in `fstab` can be insecure. Instead, consider using a credentials file:

Create a file to store your credentials:

nano ~/.smbcredentials

Add the following lines:

username=YOUR_USERNAME
password=YOUR_PASSWORD

Change permissions to secure the file:

chmod 600 ~/.smbcredentials

Update the `fstab` entry to use the credentials file:

//SERVER/ShareName /mnt/my_network_drive cifs credentials=/home/YOUR_USERNAME/.smbcredentials 0 0

Conclusion

By following these steps, you can seamlessly access Windows network drives from your WSL environment. This integration not only enhances your productivity but also provides a robust way to manage files across different operating systems. Whether you're developing applications or handling files, having access to network resources in WSL is invaluable. 

With this guide, you should be well-set to access your Windows network drive in WSL. Happy coding!

Monday, March 2, 2026

Using WebDAV on Linux

Learn to use WebDAV, a networking tool to mount filesystems, a great option for collaborative environments
Photo by Philipp Katzenberger on Unsplash
WebDAV (Web Distributed Authoring and Versioning) is an extension of the HTTP protocol that facilitates collaborative editing and management of files on remote web servers. It provides a framework for users to create, change, and move documents on a server, enabling various functionalities crucial for web collaboration.

Key Features

File Management

WebDAV allows users to manage files on a server, including creating, editing, deleting, and moving files.

Collaborative Editing

Multiple users can edit the same document simultaneously, helping in teamwork and collaboration.

Locking Mechanisms

To prevent conflicts, WebDAV supports file locking, which ensures that only one user can edit a document at a time.

Metadata Support

Users can attach metadata to web resources, enhancing information management.

Cross-Platform Compatibility

Compatible with various operating systems and applications, allowing seamless integration.

Deploying WebDAV

So let's see how to deploy and use WebDAV

1. Install davfs2

Install from your package manager (in Ubuntu it's named davfs2) or download the latest version of davfs2 from the davfs2 download page.

2. Configure the davfs2.conf file.

Make sure the following properties in the file are configured as shown below:if_match_bug 1 delay_upload 0 use_locks 0

3. Create the mount point.mkdir

$ sudo mkdir /mnt/dav

4. Mount a share in the dav directory on your server.

For example, to set up a WebDAV connection to dotcms.org at the mount point /mnt/dav on your local host, use the following command:

mount -t davfs http://<IP>/webdav/live/1 /mnt/dav

You will then be prompted for your username and password which will give you access to your WebDAV server.

Unmounting

You must manually unmount the WebDAV folders when you are finished:
$ sudo umount /mnt/dav

Common Use Cases

Content Management Systems (CMS)

WebDAV is often used in CMSs for file management and editing.

Cloud Storage Solutions

Many cloud storage services use WebDAV for file access and editing.

Version Control

WebDAV can be integrated with version control systems to manage document versions effectively. Today, this would be more common to host documents (think Word, Excel, etc) than to replace Git.

Conclusion

WebDAV enhances the capabilities of web servers by providing a structured way to deal with resources, making it an essential tool for collaborative environments.

Featured Article

Flatpak and Snap: What are the differences?

Flatpak and Snaps are constantly mentioned in the context of the Linux desktop. Do you understand them? ...