Reinstall over SSH?

I had a power outtage on my rPi 4 and it seems to have slightly corrupted my install of diet-pi, I have bash problems in the etc/bash.bashrc file, it’s missing data, and some apps are no longer working.

As my bash file is messed up, i no longer have the diet-pi aliases.

Is there a way to reinstall dietpi over SSH? I don’t want to remove the SSD and reflash if I can help it, most of my apps are still working and I don’t want to lose the data and because of the situation the install is currently in, I don’t know how to recover the backups.

Did you tried the full path to our backup script instead of using the alias?

/boot/dietpi/dietpi-backup

Well the good news is, that works.

The bad news is I don’t have a previous backup…

Lesson learnt there.

Are there any other options from here?

I can access the other dietpi-tools now such as dietpi-software, so I seem to have quite a bit of access too.

One problem I’ve having is Radarr isn’t launching because of a problem with libhostfxr.so, seems to be missing the dotnet files in the path.

theoretically you could try to reinstall Radarr

I did reinstall Radarr, and this pulled in the correct dependencies and started the service successfully, so that’s ok, but I’m still left with a dodgy bash in dietpi, and the welcome screen TUI doesn’t display when I log in via SSH.

can I get a copy of /etc/bash.bashrc from somewhere?

I guess you are looking for the /etc/bashrc.d/dietpi.bash

It’s available on GitHub https://github.com/MichaIng/DietPi/blob/master/rootfs/etc/bashrc.d/dietpi.bash

No, I found that too, and I do have that file and it looks ok, the one I have a problem with is in the directory above that, here is the output, you can see at the end of the file the corrupted line…

dietpi:~$ cat /etc/bash.bashrc 
# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
#if ! shopt -oq posix; then
#  if [ -f /usr/share/bash-completion/bash_completion ]; then
#    . /usr/share/bash-completion/bash_completion
#  elif [ -f /etc/bash_completion ]; then
#    . /etc/bash_completion
#  fi
#fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
	function command_not_found_handle {
	        # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
		   /usr/lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr/share/command-not-found/command-not-found ]; then
		   /usr/share/command-not-found/command-not-found -- "$1"
                   return $?
		else
		   printf "%s: command not found\n" "$1" >&2
		   return 127
		fi
	}
fi
r i i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -b "d�b ]h&& n %xdooe; }~set2

going to link the related GitHub question https://github.com/MichaIng/DietPi/issues/5455