Broken dietpi-login

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=10
G_DIETPI_VERSION_SUB=2
G_DIETPI_VERSION_RC=3
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

trixie 0

  • Kernel version | uname --all

Linux stephpi 6.12.75+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.75-1+rpt1 (2026-03-11) armv7l GNU/Linux

  • Architecture | dpkg --print-architecture

armhf

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

RPi 2 Model B (armv7l)

Steps to reproduce

when connecting to my raspi from ssh, got this message :

*The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/\*/copyright.*
*Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
/boot/dietpi/dietpi-login: line 1: syntax error near unexpected token `)' /boot/dietpi/dietpi-login: line 1: 
`�����ɓ޲��\] !4L���0@��n���}��\]�D�)���n���,E������o
�(�R��Y��C���d��R3����s|�s�R���tW3����<Y����@��I��7�8I�䥀
\~kA{��\~�W41�fu�r�@Z�+1e�QK��A�)ݔH�Q��x�
��ْe(��4J�52�+߁��O������3���)���KE�=q����J`J�U���ީ�Yh"�
�6c�({P���ڱ��]z��6ɞ��l8�;qn��6h�ө�|N\���7���ʓ�>�V\��.H��� 
��R�̧�d��ޒ/�����(�x/��w,��:���$zP���z|�Ln�B�(V>�J��;h�.��5��]�D?������ɤ8��6��Aԯ;{<[�?
����*X^bC0<mϘ�˃��b�JY�Q�۳̖�<<5��2g����{������ەs�ػ끜�-���a�d�>_ ��T}
����:-)�&UM���N��t��ϻ�ZJ�Z��>M��Q�ᜭ����Q�Δ���x�����
r;���9Ҥ�,ĺE�,%;yu�H0g����"���>�q���������O
����s���d��y�>P��`�t�@�\*t�|h�9’"�k��v��͔��ѩ{�ߵq��v�2���\]&����s�P�N��x?���\_’*

I can still execute commands, but can not sudo anymore. And all the /boot/dietpi folder seems corrupted (launching dietpi-backup display a similar error)

Don’t know what to try ?

I suppose it happened after a sudo apt-upgrade or after a reboot.

It looks as though the SD card is corrupted. You could try logging in as root and downloading the latest DietPi update again. If that works, it will redownload the DietPi scripts.

G_DEV_BRANCH master

But I’m afraid the damage to your SD card will be more extensive and won’t be limited to just the DietPi scripts.

Thanks for your answer.

It seems a lot of files are corrupted, so G_DEV_BRANCH master doesn’t work.

G_DEV_BRANCH master
[ OK ] G_CONFIG_INJECT | Added setting DEV_GITBRANCH=master to end of file /boot/dietpi.txt
/boot/dietpi/dietpi-update: line 1: $‘\246%Ŵ\355}\307\305t\255?\363\232EAlr\234\265\024\027\225\217m\244t\300\230\352\300C~\2500-\332\177’: command not found
/boot/dietpi/dietpi-update: command substitution: line 1: syntax error near unexpected token )' /boot/dietpi/dietpi-update: command substitution: line 1: 55d��^z7yi7G�+���v�àlH��8��H/Nj�����y1��e��@��˄&��<�+I���f��h�}��㋬��.i�cv��e�͘��g3�ĜV�cں0K/>m� ���z��><��eF�ͧ�|���,�bx)���?���)�_���q�r�ؒ4���‘��tO���q�1P’
/boot/dietpi/dietpi-update: line 1: $'\264\2363\0319\340\217N#\322\326\323\027\3217\321s\035\241\254\017
D8\241*v\366\215\266ـ\350=\351\336\362K\241\222\276\262\260m\307R\345\274\376\305J\336’: command not found
/boot/dietpi/dietpi-update: line 4: syntax error near unexpected token )' /boot/dietpi/dietpi-update: line 4: 1�n��K�k�m�K�A�bU���<C(8�G�rXyujX�t�:^�h���'�

I’ll probably need to do a clean install.

It’s pretty strange as I can reboot and the softwares running on the raspi seem OK (Plex server / PiHole / nicotine+ headless).

It’s possible that only the boot partition is affected. You could also download the script archive manually, remove the SD card from the RPI, and then manually copy the files from the archive to the boot partition.

The archive contains a subfolder named dietpi, copy its contents to the corresponding folder on the SD card. This can be done on any Windows computer.

Thank you,

I’ve done a clean install and everything is now fine.

I’ll probably backup the whole sd card after updates so that I will be able to go back if something went wrong again

Stéphane