Posts

Showing posts with the label apt

Minimizing a linux virtual disk image with zerofree

How to make your linux drive image smaller with zerofree and virtualbox-manage First you need to write zeroes on top of old unallocated data (the files you have deleted) on the virtual drive. This is done with zerofree. zerofree will only overwrite unallocated data so the Virtualbox drive image file will not get any bigger than it already is. Then we use vboxmanage to compact the virtual disk image. Note that this will not work if you are using an encrypted hard disk. This is because the zeroes written by zerofree will be encrypted. In that case, the virtual disk image will grow to it's full size. 1. Install zerofree First, install zerofree on your virtual machine: sudo apt install zerofree 2. Log in to recovery mode Log in to your machine in recovery mode. At startup, press shift to see GRUB menu. Select Advanced options and recovery mode for the newest kernel. Then select Root from the menu. Press enter when it asks you to "Press enter for maintenance". 3. Remount the d...

Fix the login loop in Xubuntu 24.04

 I had some problems logging into my brand new Xubuntu 24.04 LTS install running on Virtualbox. On the first login, I was booted back to the login screen. Opening some apps would also throw me out of the GUI session to the login screen. Eventually, I got into a loop where I get continually thrown into a login screen. This bug is mentioned on the Xubuntu homepage as a known issue: Xorg crashes and the user is logged out after logging in or switching users on some virtual machines  Seems that this bug also affects Ubuntu 24.04 . To get a terminal from the login screen, I pressed Ctrl-Alt-F1 and logged in. To get back to the GUI login, you can press Ctrl-Alt-F7. To fix the problem, I had to remove libva-wayland2: sudo apt remove libva-wayland2  After this, login is possible again in GUI mode (Ctrl-Alt-F7). However, this also uninstalled some apps I wanted. Looks like I have to skip Xubuntu 24.04 or Ubuntu 24.04 for now until this is fixed.

How to install yle-dl on OSMC Linux

Yle Areena is a really great free streaming site run by the Finnish goverment funded media house Yleisradio . It has a Netflix-like browser interface. I am using a Home Theater PC (HTPC) called Vero 4K to watch content. It is running the OSMC Linux distro with Kodi as the interface. However, this guide should work on anything running OSMC, for example a Raspberry Pi . Lately, Yle changed their API, making the yle-areena Kodi plugin obsolete. After that I have been using yle-dl by Antti Ajanki to download and watch movies. It's a bit of a hassle to use. Compared to just using the Areena plugin, you have to first download the content on the command line and then find it on Kodi and play it. But it works well enough. Keep in mind, this is all legal according to Finnish law. Yle Areena is a legal streaming site and you can make recordings for your own use. So, here's how to get yle-dl running on OSMC.  Connect to the OSMC device with an SSH terminal program like PuTTY . Updat...

Using the backup-manager Linux utility

Here's a quick rundown of a simple backup-manager configuration. In addition to the basic tarballs, I set it up to backup the mysql database. I did not automate the backup process. I will use the configuration to backup stuff manually on a USB drive. I am also not using the upload functionality of backup-manager. These should be relatively easy to set up once you try out the manual process. Installation Installing backup-manager with apt-get is easy: sudo apt-get update sudo apt-get install backup-manager It will ask for some of the configuration. Don't worry about that now, we will change the configuration later. Disable unnecessary cron job (optional) With the following commands I found all the backup-manager files strewn across the system: updatedb locate backup-manager From there, I could see that backup-manager installed a cron job: /etc/cron.monthly/backup-manager-clean-upload-db As I am not using the upload jobs, I disabled that cron job. This should not be necessary. su...

How to fix apt "Cannot initiate the connection" on Ubuntu headless

Today, while updating my Ubuntu headless server, I got some errors from the mirror I was using: sudo apt-get update Err:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease Cannot initiate the connection to fi.archive.ubuntu.com:80 connect (101: Network is unreachable)  ...and so on. Seems there is some problem with fi.archive.ubuntu.com, or maybe they stopped serving updates for my old LTS version of Ubuntu. This was solved with some editing of /etc/apt/sources.list sudo nano /etc/apt/sources.list I replaced http://fi.archive.ubuntu.com/ubuntu/ with mirror://mirrors.ubuntu.com/mirrors.txt. If you want to be sure, leave the old lines there commented with #, so you can go back if this doesn't help. So the lines would look like this now: deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted  # deb http://fi.archive.ubuntu.com/ubuntu/ xenial main restricted  deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted # deb ...