% Debian

# Réparer une Debian mal installée et sans réseau

## Rescue mode

Configurer le réseau manuellement

Quand il propose de rentrer dans un shell, aller sur Go Back et sélectionner `Réinstaller les composants de base`

## Rustdesk

### Installation


```bash
sudo apt install -y wget xvfb libgtk-3-0 libnotify4 libglib2.0-0 libnss3 libxss1 libasound2 libxdo3 curl gstreamer1.0-pipewire


```


Récupérer l'adresse du .deb ici (voir la dernière version):

https://github.com/rustdesk/rustdesk/releases/tag/1.3.7

```bash
wget https://github.com/rustdesk/rustdesk/releases/download/1.3.7/rustdesk-1.3.7-x86_64.deb
```

```bash
sudo dpkg -i rustdesk-1.3.7-x86_64-ubuntu.deb
```


# Mises à jour

## Automatisation des mises à jour

Référence: [UnattendedUpgrades - Debian Wiki](https://wiki.debian.org/UnattendedUpgrades)

### Installation

```bash
sudo apt update && sudo apt-get install unattended-upgrades apt-listchanges

echo 'Unattended-Upgrade::Mail "root";' | sudo tee /etc/apt/apt.conf.d/52unattended-upgrades-local


cat | sudo tee /etc/apt/apt.conf.d/20auto-upgrades <<EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
EOF
```

### Vérification

```bash
sudo unattended-upgrade -d
sudo systemctl status unattended-upgrades
```


### Redémarrage automatique après les mises à jour automatiques

```bash
sudo apt install apt-config-auto-update
```

# Problème trusted.gpg

## Symptôme


Sur un `apt update`:


```
W: http://security.debian.org/debian-security/dists/bookworm-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
```

## Solution

```bash
apt-key --keyring /etc/apt/trusted.gpg list 2>/dev/null | grep -A 1 "pub " |grep -v "pub " | grep -v '\-\-' | awk -v OFS="" '{$1=$1}1' | xargs -i sudo bash -c 'apt-key --keyring /etc/apt/trusted.gpg export {} | gpg --dearmor -o /etc/apt/trusted.gpg.d/{}.gpg ;'
```

# Suppression pour système léger (Debian lightweight)


Paquets inutiles:

```
bluez bluez-firmware build-essential cpp cpp-14 cpp-14-aarch64-linux-gnu cpp-aarch64-linux-gnu g++ g++-14 g++-14-aarch64-linux-gnu g++-aarch64-linux-gnu gcc gcc-14 gcc-14-aarch64-linux-gnu gcc-aarch64-linux-gnu wpasupplicant
```

```bash
sudo apt remove bluez bluez-firmware build-essential cpp cpp-14 cpp-14-aarch64-linux-gnu cpp-aarch64-linux-gnu g++ g++-14 g++-14-aarch64-linux-gnu g++-aarch64-linux-gnu gcc gcc-14 gcc-14-aarch64-linux-gnu gcc-aarch64-linux-gnu wpasupplicant
sudo apt autoremove

```

MTV632D/A