0

I've been struggling with systemd and python issues (I wasn't able to update my computer). I have resolved theses issues but at the end, I couldn't run reboot command line. I've tried to recreate symlink but the /sbin/reboot folder seems to be empty...

I think it could be a big problem.

Can I restart my computer safely while the reboot command is unknown? How can I fix this issue?

****@*****:~$ reboot
bash: /sbin/reboot: No such file or directory
****@*****:~$ 
****@*****:~$ which reboot
****@*****:~$ 
****@*****:~$ sudo ln -f -s -- ../bin/systemctl /sbin/reboot
****@*****:~$ sudo ln -f -s -- ../bin/systemctl /sbin/shutdown
****@*****:~$ reboot
bash: /sbin/reboot: No such file or directory
****@*****:~$ which reboot
****@*****:~$ 

The commands that @nobody asks (sorry for delay) :

****@****:~$ cat /etc/initramfs-tools/initramfs.conf
#
# initramfs.conf
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
#
# Note that configuration options from this file can be overridden
# by config files in the /etc/initramfs-tools/conf.d directory.

MODULES: [ most | netboot | dep | list ]

most - Add most filesystem and all harddrive drivers.

dep - Try and guess which modules to load.

netboot - Add the base modules, network modules, but skip block devices.

list - Only include modules from the 'additional modules' list

MODULES=most

BUSYBOX: [ y | n | auto ]

Use busybox shell and utilities. If set to n, klibc utilities will be used.

If set to auto (or unset), busybox will be used if installed and klibc will

be used otherwise.

BUSYBOX=auto

COMPCACHE_SIZE: [ "x K" | "x M" | "x G" | "x %" ]

Amount of RAM to use for RAM-based compressed swap space.

An empty value - compcache isn't used, or added to the initramfs at all.

An integer and K (e.g. 65536 K) - use a number of kilobytes.

An integer and M (e.g. 256 M) - use a number of megabytes.

An integer and G (e.g. 1 G) - use a number of gigabytes.

An integer and % (e.g. 50 %) - use a percentage of the amount of RAM.

You can optionally install the compcache package to configure this setting

via debconf and have userspace scripts to load and unload compcache.

COMPCACHE_SIZE=""

COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz ]

COMPRESS=lz4

NFS Section of the config.

DEVICE: ...

Specify a specific network interface, like eth0

Overridden by optional ip= or BOOTIF= bootarg

DEVICE=

NFSROOT: [ auto | HOST:MOUNT ]

NFSROOT=auto

RUNSIZE: ...

The size of the /run tmpfs mount point, like 256M or 10%

Overridden by optional initramfs.runsize= bootarg

RUNSIZE=10%

**@**:~$

RUNSIZE=10%

**@**:~$ dpkg -l | grep lz4 ii liblz4-1:amd64 1.9.2-2 amd64 Fast LZ compression algorithm library - runtime ii lz4 1.9.2-2 amd64 Fast LZ compression algorithm library - tool

**@**:~$

Thomas Ward
  • 74,764
Yves
  • 1
  • Does sudo shutdown -r now do nothing? What sort of things have you been doing to your installation lately? –  Dec 24 '20 at 16:14
  • /sbin/reboot folder seems to be empty - /sbin/reboot shouldn't be a folder but an executable – Arkadiusz Drabczyk Dec 24 '20 at 16:19
  • Does /bin/systemctl reboot work? – steeldriver Dec 24 '20 at 16:33
  • sudo apt install --reinstall systemd-sysv shows this any errors? – nobody Dec 24 '20 at 17:11
  • I fear if you manage to reboot, you system will not come up again. The error you show comes usually from mixing 32bit and 64bit binaries. – Marco Dec 26 '20 at 06:38
  • You re right Marco since the PC standby I had black screen Since I couldnt boot again (sbin/init error) – Yves Dec 26 '20 at 14:06
  • So I ve followed https://askubuntu.com/questions/834053/how-recover-from-a-bad-update-and-no-sbin-init (1rst answer) but got
    Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
    update-initramfs: Generating /boot/initrd.img-5.4.0-56-generic
    W: Couldn't identify type of root file system for fsck hook
    Errors were encountered while processing:
     python3
     python3-gi
     networkd-dispatcher
     python3-dbus
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    at the end of apt-get install init

    – Yves Dec 26 '20 at 14:11
  • But boot successfully !!!! But still with the init ramfs decoding failed – Yves Dec 26 '20 at 14:16
  • cat /etc/initramfs-tools/initramfs.conf and dpkg -l | grep lz4 please. – nobody Dec 26 '20 at 15:00
  • reboot is in /usr/sbin, at least on my system. It's a symlink to bin systemctl. Is /usr/sbin in your PATH? Please add output of echo $PATH to your question. – mook765 Feb 05 '21 at 22:06
  • @Yves might want to have put this into your post as an edit. And indicate you got the information from the commands asked for in comments. – Thomas Ward Feb 12 '21 at 16:06
  • @ThomasWard right good idea thanks – Yves Feb 12 '21 at 17:49
  • @mook765 I fixed the reboot path, my issue is now to update my Ubuntu. I succeed to update but not to upgrade. I have the following error : Errors encountered during execution: python3 python3-gi networkd-dispatcher python3-dbus E: Sub-process /usr/bin/dpkg returned an error code (1) – Yves Mar 06 '21 at 12:52

0 Answers0