apt-key deprecation in Raspberry Pi OS Bookworm (12)

First find the key in the old location

apt-key list | grep -A4 "trusted.gpg$"
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

/etc/apt/trusted.gpg

pub rsa2048 2012-06-17 [SC]
CF8A 1AF5 02A2 AA2D 763B AE7E 82B1 2992 7FA3 303E
uid [ unknown] Raspberry Pi Archive Signing Key

What you need from this is the last 8 characters of the long hexadecimal number, without the spaces. In this case, 7FA3303E. Then you export the key to a temporary file.

apt-key export 7FA3303E | sudo gpg --dearmor -o /tmp/raspi.gpg
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

This should have created a file /tmp/raspi.gpg with the key in.

file /tmp/raspi.gpg
/tmp/raspi.gpg: PGP/GPG key public ring (v4) created Sun Jun 17 15:49:51 2012 RSA (Encrypt or Sign) 2048 bits MPI=0xabc2a41a70625f9f…

Now delete the old key.

apt-key del 7FA3303E
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

And finally put the new key in place.

Code: Select all

mv /tmp/raspi.gpg /etc/apt/trusted.gpg.d/raspberrypi-bookworm-stable.gpg

The reason for doing the steps in this order is that otherwise the new key gets deleted as well as the old one.

from https://forums.raspberrypi.com/viewtopic.php?t=358016

Rotate DSI Display

For Raspberry Pi OS Bookworm :

Add the video information to the end of cmdline.txt :
(located at /boot/firmware/cmdline.txt or on the /boot partition of the SD Card.)


video=DSI-1:800x480@60,rotate=<rotation-value>

Replace the <rotation-value> placeholder with one of the following values, which correspond to the degree of rotation relative to the default on your display: 0 (default), 90, 180 (reversed), 270

(https://www.raspberrypi.com/documentation/accessories/display.html)

For Raspberry Pi OS Buster / Bullseye :

Add one of the following values in config.txt
(located at /boot/firmware/cmdline.txt or on the /boot partition of the SD Card.)

lcd_rotate=0 # default (normal landscape)
lcd_rotate=1 # 90 degrees (portrait, upside down)
lcd_rotate=2 # 180 degrees (landscape)
lcd_rotate=3 # 270 degrees (portrait, upside down)

Change Static IP Address

Enterprise Linux 9 / Raspberry Pi OS 12 :

sudo nmtui

Or

su

# list devices (ens192 used as example below)
nmcli device

# set [manual] for static setting or [auto] for DHCP
nmcli connection modify ens192 ipv4.method manual
nmcli connection modify ens192 ipv4.addresses xx.xx.xx.xx/24 
nmcli connection modify ens192 ipv4.gateway xx.xx.xx.1

# for multiple DNS, specify with space separated
nmcli connection modify ens192 ipv4.dns "xx.xx.xx.1 xx.xx.xx.2"

# restart the interface to reload settings
nmcli connection down ens192; nmcli connection up ens192

# confirm the applied settings
nmcli device show ens192

# confirm state
ip address show

Debian 12 :

su

ip a

nano /etc/network/interfaces

# restart the interface to reload settings
systemctl restart networking

# confirm state
systemctl status networking

Raspbian 10 / Raspberry Pi OS 11 :

sudo nano /etc/dhcpcd.conf

Configure WPA Enterprise Wi-Fi connection on Raspbian Buster (10)

Add the following to /etc/wpa_supplicant/wpa_supplicant.conf :

eapol_version=2

network={
ssid="SSID_HERE"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
auth_alg=OPEN
eap=PEAP
identity="USERNAME_HERE"
password=hash:#####################
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}

and change /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant :
seach for this string in wpa_supplicant_start() function :

nl80211,wext

and replace the drivers’ order with

wext,nl80211

Check if the wlan0 interface gets an IP address :

ip a

Play sound with PHP on a Raspberry Pi

Configure the sound output interface :

sudo raspi-config
Option 1 System Options
Option S2 Audio

Install the necessary software : Apache HTTPd, PHP 7 and the PHP Apache module :

sudo apt install apache2 php libapache2-mod-php

Allow Apache to access audio devices by adding its user to the audio group :

sudo usermod -a -G audio www-data

in the PHP script, execute the aplay command :

<?php exec('aplay '.DIR.'/sound.wav'); ?>