Problems on Ubuntu

Bluetooth Cannot Connect Airpods

sudo vim /etc/bluetooth/main.conf
# add `ControllerMode = dual`
sudo /etc/init.d/bluetooth restart

It works!



Boot Slowly

$ neofetch          
            .-/+oossssoo+/-.               [email protected] 
        `:+ssssssssssssssssss+:`           ------------------ 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04.2 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: HP Laptop 14s-cr0xxx 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.8.0-50-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 24 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2072 (dpkg), 9 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: zsh 5.8 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1920x1080, 1600x900 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: Adwaita 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: Yaru [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: Yaru [GTK2/3] 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: gnome-terminal 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: Intel i5-8250U (8) @ 3.400GHz 
    .ossssssssssssssssssdMMMNysssso.       GPU: Intel UHD Graphics 620 
      -+sssssssssssssssssyyyssss+-         GPU: AMD ATI Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile 
        `:+ssssssssssssssssss+:`           Memory: 3947MiB / 23809MiB 

If you have Intel CPU and are using regular Ubuntu (Gnome) and want a user-friendly way to check CPU speed and adjust it, and even set it to auto-scale based on being plugged vs battery, try CPU Power Manager.

$ systemd-analyze                             
Startup finished in 8.653s (firmware) + 4.558s (loader) + 4.153s (kernel) + 1min 14.380s (userspace) = 1min 31.745s reached after 1min 14.241s in userspace
# from
$ systemd-analyze blame
34.544s plymouth-quit-wait.service                                                               
21.085s snapd.service                                                                            
19.557s dev-sda1.device                                                                          

Plymouth is not slowing your boot-up process! Plymouth is responsible for the boot-up splash screen. Please read Plymouth.

It loads the boot-up logo at the beginning of the boot-up process and then waits until the boot-up process has finished so it unloads the splash screen. That is all it does and that is why it has to run in parallel and co-exist throughout the whole boot-up process. It does not delay anything, it just waits.

systemd-analyze plot > SystemdAnalyzePlot.svg

You can, however, reduce your boot-up time by disabling NetworkManager-wait-online.service so plymouth has one less process to wait for. This can indeed reduce your boot-up time. To do this please follow the steps in this answer.


If this system is not a server in a network, you can start by cutting down on time used by NetworkManager-wait-online.service, to do this please disable the service like so:

sudo systemctl disable NetworkManager-wait-online.service

If it shows up again after reboot, you can follow the above command with this:

sudo systemctl mask NetworkManager-wait-online.service

The purpose of the NetworkManager-wait-online.service is to wait for the network to come online before proceeding with the boot process.

This is needed in case of for example servers that rely on network resources as part of the boot process ( eg. mounting remote drives ) or in the case of workstations that rely on the network to boot correctly ( eg. Thin Clients ).

Otherwise, desktop users can disable NetworkManager-wait-online.service and network will connect normally after boot has finished minus the unneeded wait time.

It is safe to disable in this case.

Next time:

Startup finished in 5.798s (firmware) + 3.640s (loader) + 4.111s (kernel) + 3min 8.299s (userspace) = 3min 21.849s reached after 1min 28.245s in userspace


  1. Reduce the default grub load time

  2. Manage startup applications

  3. Install preload to speed up application load time

  4. Choose the best mirror for software updates

  5. Use apt-fast instead of apt-get for a speedy update

  6. Remove language related ign from apt-get update

  7. Reduce overheating

  8. Tweak LibreOffice to make it faster

  9. Use a lightweight desktop environment

  10. Use lighter alternatives for different applications









  8. 10 Killer Tips To Speed Up Ubuntu Linux

No Pip On Ubuntu20.04

sudo apt update sudo apt install python3-pip


Cannot Connect Wi-Fi Ubuntu20.04


Way 1:

sudo vim /etc/network/interfaces
# Add following lines:
# auto wlp5s0
# iface wlan0 inet static
ifconfig wlp5s0 down
ifconfig wlp5s0 up

But ifconfig is not found.

Way 2:

$ ls /sys/class/net
enp2s0 lo  wlp3s0
$ ls /etc/netplan/
$ sudoedit /etc/netplan/01-network-manager-all.yaml
$ sudo netplan apply # or sudo netplan --debug apply
$ ip a

Finally I found I add my PC to blacklist with the Wi-Fi I want to connect.

Connect Wifi

I just seclect the Using instead of Do not.

More info

H.264 Not Found

sudo apt install ubuntu-restricted-extras

Remap Key Bug

I check Swap Ctrl and Caps Lock, which is under Ctrl position -> Additional Layout Options -> Keyboard & Mouse -> GNOME Tweaks.

But it’s lost when I reboot the PC recently.

I found talks about it officially and unofficially:

A way to recover it:

Alt + F2 -> Type r -> hit enter, so it works again until it breaks again.




Install kubuntu-desktop error

When I install kubuntu-desktop use sudo apt-get install -y kubuntu-desktop, get error:

Setting up samba-common-bin (2:4.11.6+dfsg-0ubuntu1.6) ...
Checking smb.conf with testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
ERROR: lock directory /run/samba does not exist

ERROR: pid directory /run/samba does not exist


dpkg: error processing package samba-common-bin (--configure):
 installed samba-common-bin package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

samba-common-bin was installed as a dependency of smbclient, the “server role” message is misleading as I don’t have any need for a SMB server (and for any lock or pidfile, afaik).

Solved by run /bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/samba.conf.