update-grub not found while installing Proxmox on debian 12

Vittorio

Well-Known Member
Jul 24, 2019
90
5
48
60
Hi all

I'm trying to install Proxmox on Debian 12 using this guide and all went fine until the update-grub command

I get bash: update-grub: command not found

I've runned all commands in su root

What can I check or what should I do?

I'm using this method because the Zotac mini pc CI320 is very old.
I've already tried to install Proxmox directly, but with no success.

Thanks
 
Hi,
make sure grub-pc is installed by running apt install grub-pc. Then rerun the command.
 
  • Like
Reactions: Vittorio
Hi,
make sure grub-pc is installed by running apt install grub-pc. Then rerun the command.
Thanks @Chris

grub-pc was not installed since the install command installed it.

rerunning the update-grub command gives same result, command not found

I'm worried to reboot because, following the guide, I have already removed debian kernel, after installing Proxmox one.

Any suggestion?
 
Last edited:
What do you get for dpkg -S update-grub? Maybe install apt install grub2-common and rerun the update-grub
 
  • Like
Reactions: Vittorio
What do you get for dpkg -S update-grub? Maybe install apt install grub2-common and rerun the update-grub
This is the result

Code:
root@debian:/home/vittorio# dpkg -S update-grub
grub2-common: /etc/kernel/postinst.d/zz-update-grub
grub2-common: /usr/share/man/man8/update-grub2.8.gz
grub-pc: /usr/lib/grub-legacy/update-grub
grub2-common: /etc/kernel/postrm.d/zz-update-grub
grub2-common: /usr/sbin/update-grub2
grub2-common: /usr/share/man/man8/update-grub.8.gz
grub2-common: /usr/sbin/update-grub
 
This is the result

Code:
root@debian:/home/vittorio# dpkg -S update-grub
grub2-common: /etc/kernel/postinst.d/zz-update-grub
grub2-common: /usr/share/man/man8/update-grub2.8.gz
grub-pc: /usr/lib/grub-legacy/update-grub
grub2-common: /etc/kernel/postrm.d/zz-update-grub
grub2-common: /usr/sbin/update-grub2
grub2-common: /usr/share/man/man8/update-grub.8.gz
grub2-common: /usr/sbin/update-grub
Yes, so you should have the binary under /usr/sbin/update-grub now. Maybe your PATH does not include /usr/sbin? What does echo $PATH and which update-grub return?
 
  • Like
Reactions: Vittorio
Yes, so you should have the binary under /usr/sbin/update-grub now. Maybe your PATH does not include /usr/sbin? What does echo $PATH and which update-grub return?

It does not seems that /usr/sbin is in the $PATH



Code:
root@debian:/home/vittorio# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games


root@debian:/home/vittorio# which update-grub
root@debian:/home/vittorio#

And the which command returns nothing

Should I add this ?

PATH="${PATH:+${PATH}:}/usr/sbin"
 
Last edited:
It does not seems that /usr/sbin is in the $PATH



Code:
root@debian:/home/vittorio# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games


root@debian:/home/vittorio# which update-grub
root@debian:/home/vittorio#

And the which command returns nothing
Yeah, so your environment variable does not include that path. You can run a PATH=$PATH:/usr/sbin to temporarily fix this, seems your /etc/profile does not reflect this?
 
  • Like
Reactions: Vittorio
Yeah, so your environment variable does not include that path. You can run a PATH=$PATH:/usr/sbin to temporarily fix this, seems your /etc/profile does not reflect this?
Thanks!!!

Now it works.

Should I do something else?

This is my /etc/profile

Code:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi


Now to finish the installation I should run the command apt remove os-prober and then reboot
 
So it seems that your id was not 0 (root) when the profile was invoked...

Nevertheless, you should be fine now
Thanks again

I have logged in with a standard user, but I've runned all commands under su root