Manual install of base Gentoo Linux x86_64 with openrc (init) and uefi using minimal installation cd

Here we are going to show the minimum steps to install a base Gentoo Linux on your computer – server or desktop using “Minimal Installation CD”.
The installation ISO CD is generated on 11.09.2018, but you can use an older or newer one, this guide uses commands, which are available in really old ISOs (10 years ago) and probably will be available in the future, too! The idea is not to change this ISO a lot and to have only the basic tools for installation, which should be the same for a really long time! If you need more tools there two other options: Hybrid IS0, which is a LiveDVD – a system with GUI and Admin CD, which is an extended version of the minimal installation CD (no GUI).

Our base Gentoo system will use:

  1. OpenRC, which is based on init to boot the server. This is the default in Gentoo, but you might have problems using Gnome
  2. GRUB 2 UEFI enabled and the server will be booted in UEFI mode. Recently most of the desktop machine and server support it and in many cases it is mandatory to use a new hardware.
  3. No GUI will be installed (KDE, Gnome, Xfce and so on), there are other tutorials for this, you can check here (coming soon)

Keep on reading!

Gentoo Minimal Installation CD (amd64 aka x86_64) – booting (in UEFI mode)

Here is the process of booting from a Gentoo Minimal Installation CD amd64 (x86_64) with UEFI mode enabled. This is not an installation guide!
You can download the CD from here: https://www.gentoo.org/downloads/ Here is the ISO file: http://distfiles.gentoo.org/releases/amd64/autobuilds/20180911T214502Z/install-amd64-minimal-20180911T214502Z.iso or you can check it in some mirror like leaseweb – http://mirror.leaseweb.com/gentoo/releases/amd64/autobuilds/current-install-amd64-minimal/install-amd64-minimal-20180911T214502Z.iso.

Our motherboard is Asus ROG Zenith Extreme motherboard using X399 chipset https://www.asus.com/th/Motherboards/ROG-ZENITH-EXTREME/ and you’ll see the BIOS options for it, but they do not differ much with the other motherboard boot options. Here also setup the network and start up an openssh server to manage our Gentoo Linux installation – (coming soon).

SCREENSHOT 1) Starting the machine

main menu
Start up

Keep on reading!

Gentoo update tips when updating packages with blocks and masked files

It’s not so rear to have

blocks or masked files

when using Gentoo emerge system, but it is not complex and in most cases it is easy to resolve

To summarize it up at the beginning and then we are going to show you other articles using these advises here where you’ll see what are the steps we took to resolve the conflicts and masked packages:

  • Use verbose,verbose-conflicts and backtrack with emerge
  • Remove only big GUI packages, which have really big dependency graph like office suites or development IDEs
  • Remove obsolete packages – you do not need them, they can just make problems when updating, because emerge will take into consideration their requirements and dependencies and your update could be impossible!
  • Do not update everything with one line, you could update only the base libraries like QT, which are very important for the Linux GUI in general
  • Include explicitly packages, which block our updates in the emerge line! You could specify packages with the versions.
  • use tools like “equery” (part of app-portage/gentoolkit) for checking dependencies and/or which packages depend on the queried package. You can use it with specific version for the package. “qlist” (part of app-portage/portage-utils) also is a handful tool.
  • Sometimes when updating a group or a package with big dependency graph it is much easier to drop the -“u” update argument and to rebuild some packages with the updates.
  • In rear cases you can use “–nodeps” when updating or installing a new package (we do not need and show this one here!)
  • Do NOT rebuild the entire system with “emerge -v world” every time when you rebuild glibc, gcc, it is not mandatory to do it to have a healthy system.
  • Add or remove USE flags if needed – emerge will show you information about it. Use package.use, package.mask, package.unmask and so on.
  • use qlist to update/re(build) to pull currently installed packages with some name or category (categories)
    emerge -v $(qlist -IC|grep <NAME>)
    

    and for update just add “u” to “-v”:

    emerge -vu $(qlist -IC|grep <NAME>)
    

Keep on reading!

Gentoo updating KDE – package blocks

In continuing our tips for updating big or multiple packages in Gentoo this time we show how to update KDE Platform, Plasma and Apps packages. In Gentoo KDE Desktop GUI is split into three major categories:

  1. kde-frameworks
  2. kde-plasma
  3. kde-apps

How we managed to update in our current situation:

  1. Sometimes when updating a group or a package with big dependency graph it is much easier to drop the -“u” update argument and to rebuild some packages with the updates.
  2. use qlist to update/re(build) to pull currently installed packages with some name or category (categories)
  3. Remove obsolete packages – you do not need them, they can just make problems when updating, because emerge will take into consideration their requirements and dependencies and your update could be impossible!

More on the subject of update tips here: Gentoo update tips when updating packages with blocks and masked files
Keep on reading!

Ubuntu 16/18 LTS – load a new kernel without rebooting the server

Here are the commands needed to load a new kernel without rebooting your server or desktop computer. Why you need this? As said in our first article for CentOS 7 – sometime rebooting a server could take 5 to 10 minutes and loading a new kernel is just up to a minute. In fact in most cases loading the new kernel and starting the system then is just under 20-30 seconds, so upgrading your server even with new kernel is super easy lately. We tested it on Ubuntu 16 and Ubuntu 18 servers and it was successful. The system uses systemd and the process is really easy and safe for the systems.

When the processes is initiated the system shutdowns normally (shutting down all running service with systemd) and then load the system immediately with the new kernel and starts the services as usual!

So no need to worry about unflushed data or not proper shutdown of a service! It’s like a normal reboot but without a hardware reboot and is a lot faster!
Here is what is required to load a kernel without hardware rebooting your computer box:

  1. kexec-tools
  2. Load the new kernel, initram file and the command line arguments with “kexec”
  3. Start a systemd target – kexec.target

Ubuntu 16/18 LTS using kexec to load a new kernel

The real commands only for Ubuntu 16/18 LTS:

sudo apt -y install kexec-tools
sudo kexec -l /boot/vmlinuz-4.15.0-33-generic --initrd=/boot/initrd.img-4.15.0-33-generic --command-line="root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro  quiet splash"
sudo systemctl start kexec.target

Here is a real world example with all the output:
And again update your system to see if there is a new kernel and install “kexec-tools”. In our case indeed there is a new kernel – vmlinuz-4.15.0-33-generic

myuser@srv:~$ sudo apt -y upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libllvm5.0
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  amd64-microcode autotools-dev dblatex debhelper dh-strip-nondeterminism docbook-dsssl docbook-utils docbook-xml docbook-xsl fonts-lato fonts-lmodern fonts-texgyre
  intel-microcode iucode-tool jadetex javascript-common kernel-common kernel-package kernel-patch-scripts kernel-wedge kerneloops kerneloops-applet kernelshark kerneltop
  libfile-homedir-perl libfile-stripnondeterminism-perl libfile-which-perl libjs-jquery libllvm6.0 libmail-sendmail-perl libosp5 libostyle1c2 libpotrace0 libptexenc1
  libqpdf21 libruby2.3 libsgmls-perl libsp1c2 libsynctex1 libsys-hostname-long-perl libtexlua52 libtexluajit2 libwebpdemux1 libxml2-utils libzzip-0-13
  linux-headers-4.15.0-33 linux-headers-4.15.0-33-generic linux-image-4.15.0-33-generic linux-modules-4.15.0-33-generic linux-modules-extra-4.15.0-33-generic lmodern lynx
  lynx-common openjade po-debconf preview-latex-style prosper ps2eps python-apt rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit
  ruby2.3 rubygems-integration sgml-data sgmlspl sp tex-common tex-gyre texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra
  texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-luatex texlive-math-extra texlive-pictures texlive-pictures-doc texlive-pstricks
  texlive-pstricks-doc tipa trace-cmd xmlto xsltproc
The following packages will be upgraded:
.....
.....
Running mktexlsr /var/lib/texmf ... done.
Building format(s) --all.
        This may take some time... done.
Processing triggers for linux-image-4.15.0-33-generic (4.15.0-33.36~16.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-33-generic
/etc/kernel/postinst.d/vboxadd:
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.15.0-33-generic
Found initrd image: /boot/initrd.img-4.15.0-33-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

myuser@srv:~$ sudo apt -y install kexec-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm5.0
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  kexec-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 77,4 kB of archives.
After this operation, 276 kB of additional disk space will be used.
Get:1 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main amd64 kexec-tools amd64 1:2.0.16-1ubuntu1~16.04.1 [77,4 kB]
Fetched 77,4 kB in 0s (707 kB/s)      
Preconfiguring packages ...
Selecting previously unselected package kexec-tools.
(Reading database ... 253895 files and directories currently installed.)
Preparing to unpack .../kexec-tools_1%3a2.0.16-1ubuntu1~16.04.1_amd64.deb ...
Unpacking kexec-tools (1:2.0.16-1ubuntu1~16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up kexec-tools (1:2.0.16-1ubuntu1~16.04.1) ...
Generating /etc/default/kexec...
Processing triggers for systemd (229-4ubuntu21.4) ...
Processing triggers for ureadahead (0.100.0-19) ...

     ┌──────────────────────────────────────────────────────────────────┤ Configuring kexec-tools ├───────────────────────────────────────────────────────────────────┐
     │                                                                                                                                                                │ 
     │ If you choose this option, a system reboot will trigger a restart into a kernel loaded by kexec instead of going through the full system boot loader process.  │ 
     │                                                                                                                                                                │ 
     │ Should kexec-tools handle reboots (sysvinit only)?                                                                                                             │ 
     │                                                                                                                                                                │ 
     │                                                 <Yes>                                                    <No>                                                  │ 
     │                                                                                                                                                                │ 
     └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 

On the above configuration question mark “” and press Enter.

So we performed an update and there was a new kernel vmlinuz-4.15.0-33-generic, which we would like to load without hardware reboot.
Here is our new kernel in “/boot”

myuser@srv:~$ ls -altr /boot/
total 130420
-rw-r--r--  1 root root   184840 Jan 28  2016 memtest86+_multiboot.bin
-rw-r--r--  1 root root   184380 Jan 28  2016 memtest86+.elf
-rw-r--r--  1 root root   182704 Jan 28  2016 memtest86+.bin
-rw-------  1 root root  3879946 Feb 17  2018 System.map-4.13.0-36-generic
-rw-r--r--  1 root root     2850 Feb 17  2018 retpoline-4.13.0-36-generic
-rw-r--r--  1 root root   213220 Feb 17  2018 config-4.13.0-36-generic
-rw-r--r--  1 root root  1501359 Feb 17  2018 abi-4.13.0-36-generic
-rw-r--r--  1 root root  7710912 May 17 16:50 vmlinuz-4.13.0-36-generic
-rw-------  1 root root  4041375 Aug 16 00:00 System.map-4.15.0-33-generic
-rw-r--r--  1 root root        0 Aug 16 00:00 retpoline-4.15.0-33-generic
-rw-r--r--  1 root root   216913 Aug 16 00:00 config-4.15.0-33-generic
-rw-r--r--  1 root root  1537455 Aug 16 00:00 abi-4.15.0-33-generic
-rw-------  1 root root  8108600 Aug 16 21:58 vmlinuz-4.15.0-33-generic
drwxr-xr-x 24 root root     4096 Sep  7 14:15 ..
-rw-r--r--  1 root root 51290506 Sep  7 14:15 initrd.img-4.13.0-36-generic
-rw-r--r--  1 root root 54451680 Sep  7 14:15 initrd.img-4.15.0-33-generic
drwxr-xr-x  3 root root     4096 Sep  7 14:15 .
drwxr-xr-x  5 root root     4096 Sep  7 14:16 grub

Now we know the kernel and initram file names we just check the kernel arguments in the kernel, load them with kexec and start an systemd target to load the new kernel:

myuser@srv:~$ grep vmlinuz-4.15.0-33-generic /boot/grub/grub.cfg 
        linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro  quiet splash $vt_handoff
                linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro  quiet splash $vt_handoff
                linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro  quiet splash $vt_handoff init=/sbin/upstart
                linux   /boot/vmlinuz-4.15.0-33-generic root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro recovery nomodeset 
myuser@srv:~$ sudo kexec -l /boot/vmlinuz-4.15.0-33-generic --initrd=/boot/initrd.img-4.15.0-33-generic --command-line="root=UUID=061b2936-34bf-4da3-b7d2-b8bde0899f03 ro  quiet splash"
myuser@srv:~$ sudo systemctl start kexec.target
Connection to srv closed by remote host.
Connection to srv closed.

Use the first line of the grep output above (or you can cat the file and see what is in it if you have any doubts) to take the proper kernel boot arguments and do not include anything starting with “$”.

As you can see systemd performs a normal shutdown of all services and targets.

main menu
Normal shutdown

The ssh connection is immediately closed because the reboot is initiated.
After 10-15 seconds our host is alive and the new kernel is loaded successfully:

root@test ~ $ ssh root@srv
root@srv's password: 
Last login: Wed Sep  5 17:15:08 2018 from test
[root@srv ~]# uname -a
Linux srv.local 4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@srv ~]# 

Because we do not wanted to mess up the two output in one article we decided to split it in two separate ones, so here is the previous one for CentOS 7 – “CentOS 7 – load a new kernel without rebooting the CentOS 7 server”

CentOS 7 – load a new kernel without rebooting the server

Here are the commands needed to load a new kernel without rebooting your server or desktop computer. Why you need this? Sometime rebooting a server could take 5 to 10 minutes and loading a new kernel is just up to a minute. In fact in most cases loading the new kernel and starting the system then is just under 20-30 seconds, so upgrading your server even with new kernel is super easy lately. We tested it on CentOS 7 server and it was successful. The system uses systemd and the process is really easy and safe for the systems.

When the processes is initiated the system shutdowns normally (shutting down all running service with systemd) and then load the system immediately with the new kernel and starts the services as usual!

So no need to worry about unflushed data or not proper shutdown of a service! It’s like a normal reboot but without a hardware reboot and is a lot faster!
Here is what is required to load a kernel without hardware rebooting your computer box:

  1. kexec-tools
  2. Load the new kernel, initram file and the command line arguments with “kexec”
  3. Start a systemd target – kexec.target

CentOS 7 using kexec to load a new kernel

The real commands only for CentOS 7:

yum install -y kexec-tools
kexec -l /boot/vmlinuz-3.10.0-862.11.6.el7.x86_64 --initrd=/boot/initramfs-3.10.0-862.11.6.el7.x86_64.img --command-line="root=/dev/mapper/centos_srv-root ro crashkernel=auto rd.lvm.lv=centos_srv/root rd.lvm.lv=centos_srv/swap rhgb quiet LANG=en_US.UTF-8"
systemctl start kexec.target

Here is a real world example with all the output:
As you can see it is important to load the initram file and the exact arguments to the kernel. You should take them from the grub 2 configuration – /boot/grub2/grub.cfg
Here is the real output:

[root@srv ~]# yum -y update
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.neterra.net
 * extras: mirrors.neterra.net
 * updates: mirrors.neterra.net
base                                                                                                                                                 | 3.6 kB  00:00:00     
centos-sclo-rh                                                                                                                                       | 3.0 kB  00:00:00     
centos-sclo-sclo                                                                                                                                     | 2.9 kB  00:00:00     
extras                                                                                                                                               | 3.4 kB  00:00:00     
updates                                                                                                                                              | 3.4 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                                                                                                    | 187 kB  00:00:00     
(2/4): updates/7/x86_64/primary_db                                                                                                                   | 5.2 MB  00:00:01     
(3/4): centos-sclo-sclo/x86_64/primary_db                                                                                                            | 292 kB  00:00:01     
(4/4): centos-sclo-rh/x86_64/primary_db                                                                                                              | 3.7 MB  00:00:02     
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-862.11.6.el7 will be installed
---> Package kernel-headers.x86_64 0:3.10.0-862.3.2.el7 will be updated
---> Package kernel-headers.x86_64 0:3.10.0-862.11.6.el7 will be an update
---> Package kernel-tools.x86_64 0:3.10.0-862.3.2.el7 will be updated
---> Package kernel-tools.x86_64 0:3.10.0-862.11.6.el7 will be an update
---> Package kernel-tools-libs.x86_64 0:3.10.0-862.3.2.el7 will be updated
---> Package kernel-tools-libs.x86_64 0:3.10.0-862.11.6.el7 will be an update
....
....
[root@srv ~]# yum install -y kexec-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.neterra.net
 * extras: mirrors.neterra.net
 * updates: mirrors.neterra.net
Package kexec-tools-2.0.15-13.el7.x86_64 already installed and latest version
Nothing to do

So we performed an update and there was a new kernel kernel.x86_64 0:3.10.0-862.11.6.el7, which we would like to load without hardware reboot.
Here is our new kernel in “/boot”

[root@srv ~]# ls -altr /boot/
total 171812
-rw-------.  1 root root  3228420 22 Aug  2017 System.map-3.10.0-693.el7.x86_64
-rw-r--r--.  1 root root   140894 22 Aug  2017 config-3.10.0-693.el7.x86_64
-rw-r--r--.  1 root root      166 22 Aug  2017 .vmlinuz-3.10.0-693.el7.x86_64.hmac
-rwxr-xr-x.  1 root root  5877760 22 Aug  2017 vmlinuz-3.10.0-693.el7.x86_64
-rw-r--r--.  1 root root   293027 22 Aug  2017 symvers-3.10.0-693.el7.x86_64.gz
drwxr-xr-x.  3 root root       17 20 Feb  2018 efi
drwxr-xr-x.  2 root root       27 20 Feb  2018 grub
-rw-r--r--.  1 root root   611343 20 Feb  2018 initrd-plymouth.img
-rw-------.  1 root root 51315067 20 Feb  2018 initramfs-0-rescue-cc7889764e86441b8d1eb54e29e81a91.img
-rwxr-xr-x.  1 root root  5877760 20 Feb  2018 vmlinuz-0-rescue-cc7889764e86441b8d1eb54e29e81a91
-rw-------.  1 root root  3409912 21 May 23,50 System.map-3.10.0-862.3.2.el7.x86_64
-rw-r--r--.  1 root root   147823 21 May 23,50 config-3.10.0-862.3.2.el7.x86_64
-rw-r--r--.  1 root root      170 21 May 23,50 .vmlinuz-3.10.0-862.3.2.el7.x86_64.hmac
-rwxr-xr-x.  1 root root  6228832 21 May 23,50 vmlinuz-3.10.0-862.3.2.el7.x86_64
-rw-r--r--.  1 root root   304943 21 May 23,52 symvers-3.10.0-862.3.2.el7.x86_64.gz
dr-xr-xr-x. 17 root root      224 14 Jun  7,18 ..
-rw-------.  1 root root 12997841 14 Jun  7,19 initramfs-3.10.0-693.el7.x86_64kdump.img
-rw-------.  1 root root 20771492 14 Jun  7,20 initramfs-3.10.0-693.el7.x86_64.img
-rw-------.  1 root root 13007444 14 Jun  7,23 initramfs-3.10.0-862.3.2.el7.x86_64kdump.img
-rw-r--r--.  1 root root   147859 14 Aug 22,02 config-3.10.0-862.11.6.el7.x86_64
-rw-------.  1 root root  3414344 14 Aug 22,02 System.map-3.10.0-862.11.6.el7.x86_64
-rw-r--r--.  1 root root      171 14 Aug 22,02 .vmlinuz-3.10.0-862.11.6.el7.x86_64.hmac
-rwxr-xr-x.  1 root root  6242208 14 Aug 22,02 vmlinuz-3.10.0-862.11.6.el7.x86_64
-rw-r--r--.  1 root root   305158 14 Aug 22,05 symvers-3.10.0-862.11.6.el7.x86_64.gz
-rw-------.  1 root root 20774393  5 Sep 15,20 initramfs-3.10.0-862.11.6.el7.x86_64.img
drwx------.  5 root root       97  5 Sep 15,20 grub2
dr-xr-xr-x.  5 root root     4096  5 Sep 15,21 .
-rw-------.  1 root root 20782404  5 Sep 15,21 initramfs-3.10.0-862.3.2.el7.x86_64.img

Now we know the kernel and initram file names we just check the kernel arguments in the kernel, load them with kexec and start an systemd target to load the new kernel:

[root@srv ~]# grep vmlinuz-3.10.0-862.11.6.el7.x86_64 /boot/grub2/grub.cfg 
        linux16 /vmlinuz-3.10.0-862.11.6.el7.x86_64 root=/dev/mapper/centos_srv-root ro crashkernel=auto rd.lvm.lv=centos_srv/root rd.lvm.lv=centos_srv/swap rhgb quiet LANG=en_US.UTF-8
[root@srv ~]# kexec -l /boot/vmlinuz-3.10.0-862.11.6.el7.x86_64 --initrd=/boot/initramfs-3.10.0-862.11.6.el7.x86_64.img --command-line="root=/dev/mapper/centos_srv-root ro crashkernel=auto rd.lvm.lv=centos_srv/root rd.lvm.lv=centos_srv/swap rhgb quiet LANG=en_US.UTF-8"
[root@srv ~]# systemctl start kexec.target
Connection to srv closed by remote host.
Connection to srv closed.

As you can see systemd performs a normal shutdown of all services and targets.

main menu
Normal Shutdown

The ssh connection is immediately closed because the reboot is initiated.
After 10-15 seconds our host is alive and the new kernel is loaded successfully:

root@test ~ $ ssh root@srv
root@srv's password: 
Last login: Wed Sep  5 15:16:08 2018 from test
[root@srv ~]# uname -a
Linux srv.local 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@srv ~]# 

Because we do not wanted to mess up the two output from different linux distros in one article we decided to split it in two separate ones, so here is the one for Ubuntu 16/18 LTS – “Ubuntu 16/18 LTS – load a new kernel without rebooting the server

Gentoo updating perl with many masked and blocked packages

After our previous howto Gentoo – update dev-libs/icu on a desktop box with KDE GUI and many masked packages we want to show you another example of how to update perl, which could have hundreds dependencies installed as perl modules. You can check for more details above howto, details about what to do when there are masked and blocked packages, because here we use only some of the options we have the proper ones for this case.
Just to note when updating perl you must reinstall (recompile, rebuild) all the external modules (additional packages) and all perl modules installed with CPAN module (if you do not know what is this, you probably have not used it so no worries).

How we managed to update in our current situation:

  • use qlist to update/re(build) to pull currently installed packages with some name or category (categories)
  • Add or remove USE flags if needed – emerge will show you information about it. Use package.use, package.mask, package.unmask and so on.
  • Use verbose,verbose-conflicts and backtrack with emerge
  • Include explicitly packages, which block our updates in the emerge line! You could specify packages with the versions.

More on the subject of Perl update tips here: Gentoo update tips when updating packages with blocks and masked files
And a new article on the subject – Gentoo – updating perl and problems like perl-core/ is blocking virtual/perl-
Keep on reading!

Build your own kernel under Ubuntu using mainline (latest) kernel

Here we will show how to build your own kernel under Ubuntu 16/17/18. We are going to use

mainline kernel

because most of the cases when we need to build our own is when we need some new feature presented in the new kernels. So Ubuntu mainline kernels are selected new kernels, which are packed in deb packets for simplicity and can be used to test new features, but they are not supported by Ubuntu teams and you should test them really carefully if you want to use them in production!
The mainline kernels are here: http://kernel.ubuntu.com/~kernel-ppa/mainline/. This is the main address, where you could download the latest kernels and some other legacy one if you have old system.
This howto is based on https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel and https://wiki.ubuntu.com/Kernel/MainlineBuilds – we summarize the commands needed to build your new and latest kernel and show you some typical mistakes and problems during the process.
To show you more information our purpose will be to build the one of the latest kernels with low latency features enabled (Ubuntu has such type of kernel configuration)! And here is one of the most important dependency, which is not explicitly included or even mentioned in most of the tutorials for building your own kernels –

you MUST include new or even latest Linux firmware package

All Linux distros have a package or packages containing files with different firmware for multiple devices supported by the kernel modules. Basically firmware is used by a kernel module and it can be a micro code (program), which is uploaded in the device or just complete the kernel module to function properly with a device. Recent days firmware is like a black box the manufacturer of the devices pack a proprietary code in a firmware blob and the source code is unknown to the community.

The first thing you should do is to choose the kernel version you want to build. We want version 4.17.x as more stable of the latest 4.18, which was released a few days weeks ago (let’s wait for a month after the initial release before using it!).
So the main address is here http://kernel.ubuntu.com/~kernel-ppa/mainline/ and the kernel files, which we are going to use to rebuild are here http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17.19/
Keep on reading!

Delay loading all pages in the Chromium and Google Chrome browsers tabs during start up and save a lot of memory

Recently we noticed our Chromium began to behavior really strange (we noticed it from Chromium version 69). When starting the Chromium browser the system tended to lag for 4-8 seconds and it was apparently connected with the browsers’ tabs opened in the previous session.
These days many people open multiple Internet pages in the browsers’ tabs and even more use the feature of

quitting the browser and then starting it back and the browser restores the previous session – all tabs with the pages loaded before.

. And time passes and we get used to open and leave more and more tabs, so not it is normal to have more than 30 opened page tabs in your browser, but last versions of the Chromium something has changed, because when you start the browser it completely loads all the pages, we do not think this was the case before so we dig it into the problem.
We use Chromium under (Gentoo) Linux and here is the problem:

top - 16:20:09 up 16 days, 16:36, 14 users,  load average: 4.77, 0.55, 0.43
Tasks: 288 total,  10 running, 201 sleeping,   0 stopped,   0 zombie
%Cpu(s): 82.6 us, 16.2 sy,  0.0 ni,  1.2 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  8143960 total,  3012776 free,  3828732 used,  1302452 buff/cache
KiB Swap:  7606268 total,  6855752 free,   750516 used.  2554612 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                 
16082 myuser     20   0 3975632 371280 191940 S 106.9  4.6   0:05.86 /usr/lib64/chromium-browser/chrome --extra-plugin-dir=/usr/lib64/nsbrowser/plugins --ppapi-flash-path=+ 
16380 myuser     20   0 1779900 116276  76624 S  28.4  1.4   0:00.41 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16420 myuser     20   0 1777396 117096  85464 S  18.6  1.4   0:00.30 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16540 myuser     20   0 1850308 109576  76616 R  17.6  1.3   0:00.24 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16565 myuser     20   0 1769716 108588  81336 S  17.6  1.3   0:00.23 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16400 myuser     20   0 1775876 105220  76932 R  12.7  1.3   0:00.21 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16334 myuser     20   0 1770128 111588  83760 S  11.8  1.4   0:00.26 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
 5644 myuser      9 -11 3474604  11112   8368 S   9.8  0.1  14:50.60 /usr/bin/pulseaudio --start --log-target=syslog                                                         
16346 myuser     20   0 1772160 103924  76920 R   9.8  1.3   0:00.17 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16369 myuser     20   0 1772060 101696  74928 R   9.8  1.2   0:00.16 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16409 myuser     20   0 1783340 115752  77116 R   9.8  1.4   0:00.18 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16435 myuser     20   0 1770664 105088  81656 S   9.8  1.3   0:00.19 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16483 myuser     20   0 1772228 112008  83176 S   9.8  1.4   0:00.17 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16509 myuser     20   0 1772116 108544  81732 S   9.8  1.3   0:00.20 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16448 myuser     20   0 1771368 101300  74956 R   8.8  1.2   0:00.14 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16459 myuser     20   0 1692864 102668  80676 R   8.8  1.3   0:00.15 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16506 myuser     20   0 1766364  99588  78384 S   7.8  1.2   0:00.15 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16577 myuser     20   0 1767296 102268  80272 S   7.8  1.3   0:00.14 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
21462 myuser     20   0 2599480 493592  95284 S   7.8  6.1  17:00.39 /usr/lib64/firefox/firefox -contentproc -childID 13 -isForBrowser -prefsLen 51222 -schedulerPrefs 0001+ 
16417 myuser     20   0 1767568  99584  75992 R   5.9  1.2   0:00.12 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16530 myuser     20   0 1764332  99036  78768 S   5.9  1.2   0:00.11 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16341 myuser     20   0 1688088  96856  77776 S   4.9  1.2   0:00.09 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16395 myuser     20   0 1765648  96284  75132 S   4.9  1.2   0:00.10 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16464 myuser     20   0 1773864 104360  76260 S   4.9  1.3   0:00.12 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16467 myuser     20   0 1765740  96184  75520 S   4.9  1.2   0:00.10 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16491 myuser     20   0 1691968  96864  75744 S   3.9  1.2   0:00.14 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16496 myuser     20   0 1691964  97048  75852 S   3.9  1.2   0:00.18 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16501 myuser     20   0 1691492  92592  72604 S   3.9  1.1   0:00.10 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16578 myuser     20   0 1765432  93580  73868 S   3.9  1.1   0:00.10 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16587 myuser     20   0 1765416  93624  73856 S   3.9  1.1   0:00.10 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
28861 myuser     20   0 3503208 405676  91716 S   3.9  5.0  11:41.21 /usr/bin/firefox                                                                                        
16454 myuser     20   0 1617744  87852  70072 R   2.9  1.1   0:00.09 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
16548 myuser     20   0 1692100  97336  76440 S   2.9  1.2   0:00.13 /usr/lib64/chromium-browser/chrome --type=renderer --file-url-path-alias=/gen=/usr/lib64/chromium-brow+ 
 5430 root      20   0  510884 133980 116036 S   2.0  1.6  39:33.10 /usr/bin/X -nolisten tcp -auth /var/run/sddm/{0c17f929-befd-402b-a80b-207e92f61272} -background none -+ 
16011 myuser     20   0  140316   3192   2632 R   2.0  0.0   0:00.44 top -d1                                                                                                 
 5193 root     -51   0       0      0      0 S   1.0  0.0  97:33.55 [irq/46-iwlwifi]                                                                                        
 5601 myuser     20   0 3422104  59664  23276 S   1.0  0.7  41:55.20 /usr/bin/kwin_x11 -session 10147150e9da000152673938100000083010144_1534452204_442575

As you can see starting Chromium it just flooded the system with hungry for CPU processes, so many that even a decent machine with 4 cores will get into troubles with 9 running Chromium process for a while! The load at the first seconds goes to 5-9 (as you can see here is 4.77 from below 1 – actually 0.5 ).
Keep on reading!

Gentoo – update dev-libs/icu on a desktop box with KDE GUI and many masked packages

No, we are not going to answer why someone will use Gentoo for Desktop, but well such human beings still exist and we have one piece of snippet the updating old dev-libs/icu package, because KDE Platform and new version of Chromium depend on a new version >=dev-libs/icu-59.
The main reason to include this update here is show how to deal with the dependency hell in Gentoo – multiple blocked packages and some old and deprecated packages, but still installed.

To summarize it up at the beginning how we did it

and then you’ll see what are the steps we took to resolve the conflicts and masked packages:

  • Use verbose,verbose-conflicts and backtrack with emerge
  • Remove only big GUI packages, which have really big dependency graph like office suites or development IDEs
  • Remove obsolete packages – you do not need them, they can just make problems when updating, because emerge will take into consideration their requirements and dependencies and your update could be impossible!
  • Include explicitly packages, which block our updates in the emerge line!
  • use tools like “equery” (part of app-portage/gentoolkit) for checking dependencies and/or which packages depend on the queried package. You can use it with specific version for the package. “qlist” (part of app-portage/portage-utils) also is a handful tool.
  • Sometimes when updating a group or a package with big dependency graph it is much easier to drop the -“u” update argument and to rebuild some packages with the updates.

More on the subject of update tips here: Gentoo update tips when updating packages with blocks and masked files
Keep on reading!