Can't dietpi-* anything (software/config/backup...) after apt-upgrade

Hi everyone,

So after having a sudo apt upgrade done and a reboot, i now can’t see the normal login page when i SSH my pi zero V1:

jules@jules-TravelMate-4230:~$ ssh dietpi@192.168.1.30
dietpi@192.168.1.30's password: 

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.
dietpi@DietPi:~$ 

When I try to do sudo dietpi-config or anything else the command is not found.

How can i get it back ?

can you try to login as user root?

Can you check boot folder

ls -la /boot
ls -la /boot/dietpi

Hi Joulinar, thank you

here are the returns :

root@DietPi:~# ls -la /boot
total 49927
drwxr-xr-x  5 root root    4608 Jan  1  1970  .
drwxr-xr-x 18 root root    4096 Oct 23 14:17  ..
-rwxr-xr-x  1 root root   18693 Nov  9 13:34  COPYING.linux
-rwxr-xr-x  1 root root    1594 Nov  9 15:39  LICENCE.broadcom
drwxr-xr-x  2 root root     512 Nov  2 19:59 'System Volume Information'
-rwxr-xr-x  1 root root   28418 Nov  9 13:25  bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root   27790 Nov  9 13:26  bcm2708-rpi-b-rev1.dtb
-rwxr-xr-x  1 root root   28111 Nov  9 13:26  bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root   28032 Nov  9 13:27  bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root   29267 Nov  9 13:27  bcm2708-rpi-zero-w.dtb
-rwxr-xr-x  1 root root   27856 Nov  9 13:28  bcm2708-rpi-zero.dtb
-rwxr-xr-x  1 root root   29305 Nov  9 13:28  bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root   29304 Nov  9 13:28  bcm2709-rpi-cm2.dtb
-rwxr-xr-x  1 root root   30170 Nov  9 13:29  bcm2710-rpi-2-b.dtb
-rwxr-xr-x  1 root root   32533 Nov  9 13:29  bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root   31922 Nov  9 13:30  bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root   30157 Nov  9 13:30  bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root   31230 Nov  9 13:31  bcm2710-rpi-zero-2-w.dtb
-rwxr-xr-x  1 root root   31230 Nov  9 13:31  bcm2710-rpi-zero-2.dtb
-rwxr-xr-x  1 root root   52325 Nov  9 13:32  bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root root   52457 Nov  9 13:32  bcm2711-rpi-400.dtb
-rwxr-xr-x  1 root root   52910 Nov  9 13:33  bcm2711-rpi-cm4.dtb
-rwxr-xr-x  1 root root   50224 Nov  9 13:33  bcm2711-rpi-cm4s.dtb
-rwxr-xr-x  1 root root   52476 Nov  9 15:35  bootcode.bin
-rwxr-xr-x  1 root root     106 Nov  3 12:14  cmdline.txt
-rwxr-xr-x  1 root root    2993 Oct 23 14:19  config.txt
drwxr-xr-x  4 root root    3072 Nov  4 23:27  dietpi
-rwxr-xr-x  1 root root   18092 Oct 23 00:50  dietpi-LICENSE.txt
-rwxr-xr-x  1 root root   15251 Oct 23 00:50  dietpi-README.md
-rwxr-xr-x  1 root root   16015 Nov  3 13:13  dietpi.txt
-rwxr-xr-x  1 root root    7265 Nov  9 15:33  fixup.dat
-rwxr-xr-x  1 root root    5400 Nov  9 15:37  fixup4.dat
-rwxr-xr-x  1 root root    3170 Nov  9 15:38  fixup4cd.dat
-rwxr-xr-x  1 root root    8382 Nov  9 15:38  fixup4db.dat
-rwxr-xr-x  1 root root    8386 Nov  9 15:39  fixup4x.dat
-rwxr-xr-x  1 root root    3170 Nov  9 15:34  fixup_cd.dat
-rwxr-xr-x  1 root root   10229 Nov  9 15:34  fixup_db.dat
-rwxr-xr-x  1 root root   10227 Nov  9 15:34  fixup_x.dat
-rwxr-xr-x  1 root root 6272904 Nov  9 13:24  kernel.img
-rwxr-xr-x  1 root root 6635232 Nov  9 13:24  kernel7.img
-rwxr-xr-x  1 root root 7045464 Nov  9 13:24  kernel7l.img
-rwxr-xr-x  1 root root 8197595 Nov  9 13:25  kernel8.img
drwxr-xr-x  2 root root   24064 Nov  9 15:31  overlays
-rwxr-xr-x  1 root root 2974880 Nov  9 15:31  start.elf
-rwxr-xr-x  1 root root 2250656 Nov  9 15:35  start4.elf
-rwxr-xr-x  1 root root  805084 Nov  9 15:36  start4cd.elf
-rwxr-xr-x  1 root root 3746856 Nov  9 15:36  start4db.elf
-rwxr-xr-x  1 root root 2998120 Nov  9 15:37  start4x.elf
-rwxr-xr-x  1 root root  805084 Nov  9 15:32  start_cd.elf
-rwxr-xr-x  1 root root 4818728 Nov  9 15:32  start_db.elf
-rwxr-xr-x  1 root root 3721800 Nov  9 15:33  start_x.elf

and

root@DietPi:~# ls -la /boot/dietpi
total 1178
drwxr-xr-x 4 root root   3072 Nov  4 23:27 .
drwxr-xr-x 5 root root   4608 Jan  1  1970 ..
-rwxr-xr-x 1 root root   1081 Nov  4 19:41 .dietpi-backup_inc_exc
-rwxr-xr-x 1 root root     53 Nov  5 20:03 .dietpi-backup_settings
-rwxr-xr-x 1 root root    577 Nov  3 12:18 .dietpi-services_include_exclude
-rwxr-xr-x 1 root root    355 Nov 10 08:02 .hw_model
-rwxr-xr-x 1 root root      2 Nov  3 13:01 .install_stage
-rwxr-xr-x 1 root root    321 Nov  5 17:15 .installed
-rwxr-xr-x 1 root root     15 Oct 23 14:17 .prep_info
-rwxr-xr-x 1 root root    113 Oct 23 14:17 .version
-rwxr-xr-x 1 root root  11511 Oct 23 00:50 dietpi-autostart
-rwxr-xr-x 1 root root  24254 Oct 23 00:50 dietpi-backup
-rwxr-xr-x 1 root root   8121 Oct 23 00:50 dietpi-bugreport
-rwxr-xr-x 1 root root  14521 Oct 23 00:50 dietpi-cleaner
-rwxr-xr-x 1 root root  43617 Oct 23 00:50 dietpi-cloudshell
-rwxr-xr-x 1 root root 140799 Oct 23 00:50 dietpi-config
-rwxr-xr-x 1 root root   5262 Oct 23 00:50 dietpi-cpuinfo
-rwxr-xr-x 1 root root   9386 Oct 23 00:50 dietpi-cron
-rwxr-xr-x 1 root root  16699 Oct 23 00:50 dietpi-ddns
-rwxr-xr-x 1 root root  74408 Oct 23 00:50 dietpi-drive_manager
-rwxr-xr-x 1 root root   7219 Oct 23 00:50 dietpi-explorer
-rwxr-xr-x 1 root root   3960 Oct 23 00:50 dietpi-launcher
-rwxr-xr-x 1 root root   4991 Oct 23 00:50 dietpi-led_control
-rwxr-xr-x 1 root root  21334 Oct 23 00:50 dietpi-letsencrypt
-rwxr-xr-x 1 root root   9003 Oct 23 00:50 dietpi-login
-rwxr-xr-x 1 root root   6789 Oct 23 00:50 dietpi-morsecode
-rwxr-xr-x 1 root root  35343 Oct 23 00:50 dietpi-services
-rwxr-xr-x 1 root root 674330 Oct 23 00:50 dietpi-software
-rwxr-xr-x 1 root root   7345 Oct 23 00:50 dietpi-survey
-rwxr-xr-x 1 root root  17082 Oct 23 00:50 dietpi-sync
-rwxr-xr-x 1 root root  22531 Oct 23 00:50 dietpi-update
-rwxr-xr-x 1 root root  21069 Oct 23 00:50 dietpi-vpn
drwxr-xr-x 2 root root   2048 Oct 23 00:50 func
drwxr-xr-x 2 root root    512 Oct 23 00:50 misc
-rwxr-xr-x 1 root root   2426 Oct 23 00:50 postboot
-rwxr-xr-x 1 root root   1393 Oct 23 00:50 preboot

ok files should be there, did you tried to execute dietpi script using root user?

Which script ?

I mean yes i did sudo dietpi-config or sudo dietpi-software and the command is not found.

Do I have to execute another one to make it auto start again at boot ?

Even in root:

root@DietPi:~# dietpi-config
-bash: dietpi-config: command not found

but following is working as root user

/boot/dietpi/dietpi-config

Probably user environment has not been loaded correctly :thinking: Let’s check it

ls -la /etc/bashrc.d

btw: root user don’t need sudo command :wink:

/boot/dietpi/dietpi-config

Yes it works !

I know I always login using the dietpi account

can you check following folder

ls -la /etc/bashrc.d

Something may be wrong :

root@DietPi:~# ls -la /etc/bashrc.d
ls: cannot access '/etc/bashrc.d': No such file or directory

definitely. This folder contains import config file to setup our alias. Did you create a backup before?

Yes ! I can access it via /boot/dietpi/dietpi-backup ! Thanks !!! Should I restore the backup or I can extract this specific file ?

I wonder why the file got wipe during the upgrade process… Is it more safe to only perform dieti-upgrade ?

nope

yes, but we could do it as well from source :slight_smile:

mkdir /etc/bashrc.d
curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/master/rootfs/etc/bashrc.d/dietpi.bash -o /etc/bashrc.d/dietpi.bash

logoff/login again now

good question, this should not happen and I have not seen something like this in the past

usually it should not make a difference

1 Like

It did the trick !

jules@jules-TravelMate-4230:~$ ssh dietpi@192.168.1.30
dietpi@192.168.1.30's password: 

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.
 ─────────────────────────────────────────────────────
 DietPi v8.10.2 : 13:19 - Fri 11/11/22
 ─────────────────────────────────────────────────────
 - Device model : RPi Zero (armv6l)
 - CPU temp : 37 Β°C / 98 Β°F : Cool runnings
 - LAN IP : 192.168.1.30 (wlan0)
 - MOTD : Check out the DietPi v8.10 release notes:
          https://dietpi.com/docs/releases/v8_10/
 ─────────────────────────────────────────────────────

 DietPi Team     : https://github.com/MichaIng/DietPi#the-dietpi-project-team
 Image by        : DietPi Core Team (pre-image: from scratch)
 Patreon Legends : Camry2731, Chris Gelatt
 Website         : https://dietpi.com/ | https://twitter.com/DietPi_
 Contribute      : https://dietpi.com/contribute.html
 Web Hosting by  : https://myvirtualserver.com

 dietpi-launcher : All the DietPi programs in one place
 dietpi-config   : Feature rich configuration tool for your device
 dietpi-software : Select optimised software for installation
 htop            : Resource monitor
 cpu             : Shows CPU information and stats

dietpi@DietPi:~$ 

Many thanks Joulinar !!!

I hope it was the only file gone. Not that there are other issues. Keep it in mind if there are more coming up :wink:

1 Like

I saved this post in my tabs and will try to transpose this solution if I encounter something similar yes !!

Many thanks for your reactivity again ! :pray: