How to compile virt-manager on CentOS, Fedora or RHEL

Question: I would like to install the latest virt-manager which is available from its official website. How can I compile and install virt-manager from the source on [CentOS, Fedora or RHEL]? virt-manager is a popular GUI-frontend for libvirt, allowing users to create and manage guest virtual machines on libvirt-supported hypervisors such as QEMU/KVM or Xen. […]
Continue reading…

 

How to search and replace a multi-line string in a file

Question: I have a text file in which I want to change multiple lines of text to something else, but without using a text editor. Is there a way to find and replace a multi-line string pattern from the Linux command line? Suppose you have a text file that looks like the following. Beginning of […]
Continue reading…

 

How to skip existing files when copying with scp

Question: I want to download (or upload) files from (or to) a remote server using the scp command. In this case, I want to skip existing files, so that they will not get overwritten by scp. But the scp command would blindly overwrite existing files if the same name files exist at either host. How […]
Continue reading…

 

How to compile virt-manager on Debian or Ubuntu

Question: I want to build and install the latest virt-manager from its source on my Linux desktop. What is the procedure for compiling virt-manager on [Debian, Ubuntu]? virt-manager is a GUI-based virtual machine manager which allows you to create and manage (local or remote) virtual machines and containers via libvirt APIs. It supports multiple hypervisors […]
Continue reading…

 

How to enable ELRepo repository on CentOS or RHEL

Question: I would like to install a device driver from ELRepo on my CentOS box. How can I install and enable the ELRepo repository on [CentOS or RHEL]? While CentOS/RHEL platforms maintain several official repositories (e.g., base, updates, contrib), they are lacking in terms of software coverage and release cycles. To bridge the gap between […]
Continue reading…

 

How to mount qcow2 disk image on Linux

Question: I have a qcow2-type disk image which is used by one my guest VMs on QEMU/KVM. I want to modify the content of the disk image without powering on the VM, and for this I need to mount the disk image somewhere. Is there a way to mount a qcow2 disk image on Linux? […]
Continue reading…

 

How to upgrade Docker on Debian or Ubuntu using the official source

Question: I installed Docker from the base repository of my distro, which seems to be out-of-date. How can I upgrade Docker on [Ubuntu or Debian], preferably using the official source? While Debian, Ubuntu or their derivatives offer Docker in their base repositories, the version of their Docker tends to be quickly outdated as Docker has […]
Continue reading…

 

How to back up and restore file permissions on Linux

Question: I want to back up the file permissions of the local filesystem, so that if I accidentally mess up the file permissions, I can restore them to the original state. Is there an easy way to back up and restore file permissions on Linux? You may have heard of a tragic mistake of a […]
Continue reading…

 

How to reset the password in an LXC container

Question: I created an LXC container, but I cannot log in to the container as I forgot the default user’s password and the root password. How can I reset the password on an LXC container? When you create an LXC container, it will have the default username/password set up. The default username/password will vary depending […]
Continue reading…

 

How to change boot splash screen on Ubuntu or Linux Mint

Question: On my desktop, I want to change the initial splash screen which is shown during boot time. How can I customize boot splash screen on [Ubuntu, Linux Mint]? When you power up your Ubuntu/Mint desktop and the boot procedure gets started in the background, you see a nice graphical animation appear in the screen. […]
Continue reading…

 

How to add disks to LVM volume on Linux

Question: I have new unused hard drives, and want to add them to an existing LVM volume to increase its size. How can I add disks to LVM to extend an LVM volume? The biggest advantage of LVM over traditional disk partitions is its support for “dynamic partitions”; you can create and resize (grow or […]
Continue reading…

 

How to install Gparted on Linux

Question: I need to (re)partition my hard disk. How can I install Gparted on [insert your Linux distro]? GParted is an open-source GUI-based disk partition editor originally developed for Linux GNOME Desktop. Gparted allows you to create, resize, copy and paste, move, and repair disk partitions using easy-to-use GUI. It supports many filesystems including btrfs, […]
Continue reading…

 

How to convert OVA image to QCOW2 format on Linux

Question: I have downloaded a virtual appliance packaged in OVA format. I want to convert the OVA image to QCOW2 format, so that I can run the virtual appliance on KVM hypervisor. How can I convert OVA image to QCOW2 format on Linux? When virtual appliances are created and distributed, they are packaged in a […]
Continue reading…

 

How to boot into command line on Ubuntu or Debian

Question: I am running Ubuntu desktop, but I want to boot straight into text-mode console temporarily. What is a convenient way to disable desktop GUI and boot into a terminal? Linux desktop comes with a display manager (e.g., GDM, KDM, LightDM), which lets the desktop machine automatically boot into a GUI-based login environment. However, what […]
Continue reading…

 

How to install Python3 on CentOS

Question: I am trying to install a Python app that requires python3 on CentOS system. However, my CentOS only has python 2.X installed, but not python 3.X. How can I install python3 on CentOS? As of the latest CentOS 7, the default Python version still remains python 2.7, and python3 is not available in base […]
Continue reading…

 

How to list all installed packages on CentOS or RHEL

Question: I want to find out what packages are installed on my CentOS box, so that I can replicate all the installations on another computer. Is there a way to get a full list of all RPM packages that I installed since I set up my initial CentOS system? When you want to create a […]
Continue reading…

 

How to disable GNOME Keyring on GNOME desktop

Question: I am trying to use gpg-agent for SSH authentication when my key is on a separate USB security key card. However, I notice that when I log in to my GNOME desktop, gnome-keyring-daemon is already running, which appears to interfere with gpg-agent. How can I disable GNOME keyring on my Linux desktop? GNOME Keyring […]
Continue reading…

 

How to disable Flash plugin on Google Chrome browser

Question: When I browse websites on Google Chrome web browser, sometimes the Chrome tab that I am on freezes or is significantly lagging for a while, and then at the top of the tab it says: “A plugin (Shockwave Flash) isn’t responding.” Apparently the Google Chrome’s Flash plugin is misbehaving. How can I disable Flash […]
Continue reading…