Useful Ubuntu Tips

Here I collect various Ubuntu commands and tips I’ve had to use from time to time – saves me searching every time. I’ll add to it as I go. I hope you may find it useful too.

Youtube-dl not Working

In Ubuntu 20+ it appears youtube-dl doesn’t work. The alternative is to use the youtube-dlc fork:

sudo apt-get install python3-pip

python pip install --upgrade youtube-dlc

chmod u+x ~/.local/bin/youtube-dlc

ln -s ~/.local/bin/youtube-dlc ./ytube

chmod ugo+x ./ytube

sudo mv ./ytube /usr/bin/

You can now download a video from the terminal using the ytube command:

ytube https://www.youtube.com/watch?v=z5iw2SeFx2M

Another alternative is to install the utube application:

snap install utube –classic

SMPlayer Blank Screen on Pause in KDE Plasma

In KDE Plasma (Kubuntu / KDE Neon) pausing a video in SMPlayer causes the video to go blank.

Set the Multimedia engine to something else, mpv works well. You’ll need to install mpv first:

sudo apt install mpv mplayer

Android Emulator Sound Problems

In KDE Neon the Android Emulator affects sound and music output.

Step #1: sudo vim /etc/pulse/default.pa

change load-module module-udev-detect

to load-module module-udev-detect tsched=0

Step #2: sudo vim /etc/pulse/daemon.conf

change default-sample-rate = 44100

to default-sample-rate = 48000

Step #3: sudo reboot

See here for more information.

Download YouTube Video as mp3

youtube-dl -x –audio-format mp3 https://youtu.be/ldiaiDt1w9g

Improve Gnome Performance

Ubuntu 19.04 felt a bit laggy for me, telling the power system to use performance mode improved it. Note: On a laptop this will drain battery fast.

To inspect the value of this variable for each core:

cat /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference

To set it to performance:

echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference

Increasing or decreasing the volume of a video using FFMPEG

ffmpeg -i input.wav -af 'volume=2' output.wav

Replace volume=X with a suitable number. For example 0.5 will half, 2 will double the volume. For more information see here and here.

Mounting a USB Device in Virtual Box

After installing VirtualBox I was unable to connect to any USB Devices from within my virtual machine. The solution was to add my user to the vboxusers group:

sudo usermod -a -G vboxusers $USER

You’ll need to log out and back in to effect the change. See here for more information.

Finding a Missing Shared Library

I like to use Clipgrab on KDE Neon, but when I try to run it, I get the following error (older Ubuntu):

error while loading shared libraries: libQtWebKit.so.4

Solution: use apt-file to identify the package which provides this shared library, and install it:

apt-file search libQtWebKit.so.4
sudo apt install libqtwebkit4

See here for more information.

Wierd Mouse in KDE

Change the “System setting -> Display and Monitor -> Compositor -> Rendering Backend” from openGL 2.0 to XRender.

see here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s