Skip to content

Ubuntu

laptop

Installing Ubuntu 20.04 LTS on 2011 MacBook Air

My laptop is a 2011 MacBook Air. I’m not a huge Apple fan, it’s just that at the time it had the most interesting hardware features compared to similar laptops. And it’s quite sturdy, so that’s nice.

Over the years I have experimented with installing Linux in parallel to the OS X operating system, but in the end I settled on installing my favorite Linux tools inside OS X using Homebrew, because having two different operating systems on one laptop was Too Much Effort. In recent times Apple has decided, in it’s infinite wisdom (no sarcasm at all *cough*), that it will no longer provide operating system upgrades for older hardware. Okay, then. Lately the laptop had become slow as molasses anyway, so I decided to replace OS X entirely with Ubuntu. No more half measures! I chose 20.04 LTS for the laptop because reasons. 🙂

The laptop was really slow…

According to the Ubuntu Community Help Wiki, all hardware should be supported, except Thunderbolt. I don’t use anything Thunderbolt, so that’s OK for me. The installation was pretty straightforward: I just created a bootable USB stick and powered on the Mac with the Option/Alt (⌥) key pressed. Choose EFI Boot in the Startup Manager, and from there on it’s all a typical Ubuntu installation.

screenshot
Startup Manager

I did not bother with any of the customizations described on the Ubuntu Wiki, because everything worked straight out of the box, and besides, the wiki is terribly outdated anyway.

The end result? I now have a laptop that feels snappy again, and that still gets updates for the operating system and the installed applications. And it’s my familiar Linux. What’s next? I’m thinking about using Ansible to configure the laptop.

To finish, I want to show you my sticker collection on the laptop. There’s still room for a lot more!

sticker collection on my laptop. Photo copyright: me.
black internal hdd on black surface

How big is a clean install of Ubuntu Jammy Jellyfish (22.04)?

Because curiosity killed the cat, not because it’s useful! 😀

Start with a clean install in a virtual machine

I start with a simple Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/jammy64"
  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "playbook.yml"
  end
end

This Ansible playbook updates all packages to the latest version and removes unused packages.

- name: Update all packages to the latest version
  hosts: all
  remote_user: ubuntu
  become: yes

  tasks:

  - name: Update apt cache
    apt:
      update_cache: yes
      cache_valid_time: 3600
      force_apt_get: yes

  - name: Upgrade all apt packages
    apt:
      force_apt_get: yes
      upgrade: dist

  - name: Check if a reboot is needed for Ubuntu boxes
    register: reboot_required_file
    stat: path=/var/run/reboot-required get_md5=no

  - name: Reboot the Ubuntu box
    reboot:
      msg: "Reboot initiated by Ansible due to kernel updates"
      connect_timeout: 5
      reboot_timeout: 300
      pre_reboot_delay: 0
      post_reboot_delay: 30
      test_command: uptime
    when: reboot_required_file.stat.exists

  - name: Remove unused packages
    apt:
      autoremove: yes
      purge: yes
      force_apt_get: yes

Then bring up the virtual machine with vagrant up --provision.

Get the installation size

I ssh into the box (vagrant ssh) and run a couple of commands to get some numbers.

Number of installed packages:

$ dpkg-query --show | wc --lines
592

Size of the installed packages:

$ dpkg-query --show --showformat '${Installed-size}\n' | awk '{s+=$1*1024} END {print s}' | numfmt --to=iec-i --format='%.2fB'
1.14GiB

I need to multiply the package size with 1024 because dpkg-query outputs size in kilobytes.

Total size:

$ sudo du --summarize --human-readable --one-file-system /
1.9G	/

Get the installation size using Ansible

Of course, I can also add this to my Ansible playbook, and then I don’t have to ssh into the virtual machine.

  - name: Get the number of installed packages
    shell: dpkg-query --show | wc --lines
    register: package_count
    changed_when: false
    failed_when: false
  - debug: msg="{{ package_count.stdout }}"

  - name: Get the size of installed packages
    shell: >
      dpkg-query --show --showformat '${Installed-size}\n' 
      | awk '{s+=$1*1024} END {print s}' 
      | numfmt --to=iec-i --format='%.2fB'
    register: package_size
    changed_when: false
    failed_when: false
  - debug: msg="{{ package_size.stdout }}"

  - name: Get the disk size with du
    shell: >
      du --summarize --one-file-system /
      | numfmt --to=iec-i --format='%.2fB'
    register: du_used
    changed_when: false
    failed_when: false
  - debug: msg="{{ du_used.stdout }}"

The output is then:

TASK [Get the number of installed packages] ************************************
ok: [default]

TASK [debug] *******************************************************************
ok: [default] => {
    "msg": "592"
}

TASK [Get the size of installed packages] **************************************
ok: [default]

TASK [debug] *******************************************************************
ok: [default] => {
    "msg": "1.14GiB"
}

TASK [Get the disk size with du] ***********************************************
ok: [default]

TASK [debug] *******************************************************************
ok: [default] => {
    "msg": "1.82MiB /"
}
wooden runes and stones scattered on wool plaid

Bluetooth werkt eindelijk naar behoren in Feisty

  • Linux

Ik heb dus een Logitech Bluetooth Desktop MX5000. Al van in het begin heb ik daar problemen mee gehad in Ubuntu. Ofwel werken muis&toetsenbord, maar kon ik geen foto’s van mijn Nokia 6680 naar de pc sturen, ofwel omgekeerd. Lastig…

Gisteren was er een langverwachte update (3.9-0ubuntu2) van bluetooth in Ubuntu Feisty. Resultaat: muis en gsm werken, maar het toetsenbord niet. Dat is nog altijd lastig, maar het is een interessante wijziging!

Ik heb dan een oud PS/2-toetsenbord vanonder het stof gehaald, daarmee de gebruikelijke mantra ingetypt om verbinding te maken met een bluetooth device: sudo hidd --connect 00:07:61:XX:XX:XX terwijl ik tegelijkertijd op de connect-knopjes drukte op het toetsenbord en de bluetooth dongle. Ik moest wel héél snel zijn en een aantal keer opnieuw proberen, maar… (tromgeroffel) mijn toetsenbord werkt nu!

Beer++ voor de bluetooth-developers.

sign pen business document

Ubuntu Code of Conduct ondertekend

  • Linux

Ik gebruik al sinds 2005 Ubuntu, maar vandaag heb ik eindelijk ook de moeite genomen om de Ubuntu Code of Conduct te ondertekenen. Waarom? Omdat ik wel al eens wat bijdragen lever aan de mailinglijsten en dat kan daar wel eens een krabbenmand zijn. *kuch* (understatement) Ik probeer naar eer en geweten te handelen in al de Linux- en andere Free Software communities waarbinnen ik actief ben, en door de CoC te ondertekenen, leg ik dat commitment vast.

Het heeft wel wat voeten in de aarde gehad want je moet dan een document ondertekenen met pgp en dat is, om het beleefd te zeggen, niet echt een uitblinker qua gebruiksgemak. Ik vermoed dat ik pgp totaal verkeerd gebruik, maar iedere keer dat ik iets van pgp-keys nodig heb, verwijder ik al mijn vorige keys en maak ik er totaal nieuwe aan. Soit. Het hele proces bestaat uit 3 delen:

OpenPGP key aanmaken

gpg --gen-key
gpg --list-keys
gpg --keyserver keyserver.ubuntu.com --send-keys 82BA02FC
gpg --fingerprint

Dan de fingerprint copy/pasten in Launchpad. Even later krijg je een encrypted mail van Launchpad. Kopieer de inhoud van de mail naar een tekstfile en doe:
gpg -d launchpad.txt
Op het einde van te tekst staat een link om de OpenPGP key te bevestigen.

CoC ondertekenen

wget https://launchpad.net/codeofconduct/2.0/+download
gpg --clearsign UbuntuCodeofConduct-2.0.txt

en dan de inhoud van UbuntuCodeofConduct-2.0.txt.asc copy/pasten op https://launchpad.net/codeofconduct/2.0/+sign

Opkuis

De OpenPGP key heb ik nu niet meer nodig, dus alles mag weg:
rm -rf ~/.gnupg UbuntuCodeofConduct*

Het resultaat is te bewonderen op https://launchpad.net/~amedee/+codesofconduct

Ubuntu

Onlangs, toen we met een aantal mensen van pandora.pub een terrasje deden op de Grote Markt in Sint-Niklaas, stopte JanC een kartonnetje met 2 cd’s in mijn handen, met de mededeling dat ik dit eens moest uitproberen.

Ubuntu_5.04_CDs

Euh, ja, ok dan. Ubuntu, heet het, en het is een Linux distributie waar we volgens JanC nog veel van gaan horen. Ik ben eens benieuwd of het gemakkelijker in gebruik is dan de Gentoo die ik nu gebruik. Ik zal al lang blij zijn als ik niet meer alles van scratch moet compilen want dat is booooring… 😀

In het kartonnetje zitten 2 CD’s: een live-cd, om uit te proberen zonder iets aan het systeem te wijzigen, en een installatie-cd. Wie zelf interesse heeft, kan (gratis!) cd’s laten opsturen via ShipIt. Bestel ineens een grote hoeveelheid en deel ze uit aan vrienden en collega’s.