Logo

dev-resources.site

for different kinds of informations.

bash: No such file or directory

Published at
3/30/2024
Categories
linux
kde
ubuntu
Author
wajahataliabid
Categories
3 categories in total
linux
open
kde
open
ubuntu
open
Author
14 person written this
wajahataliabid
open
bash: No such file or directory

I am using KDE Neon as my daily driver on my laptop. Recently due to KDE Neon update 6.0, there have been many bugs, but one as annoying as the one I faced the other day.

After system update, my bash stopped working completely. Granted I use zsh as my shell, bash is required by many programs on Linux. But everytime, I opened any such program, say pyenv, it just wouldn't work and give following error

/usr/bin/env: ‘bash’: No such file or directory linux
Enter fullscreen mode Exit fullscreen mode

I looked into /usr/bin and couldn't find bash there. I couldn't install bash using dpkg or apt. This was pretty perplexing for me. Here is how I resolved the error with bash.

First of all, I edited the file /var/lib/dpkg/info/bash.prerm and changed first line to #! /bin/sh from #! /bin/bash

#! /bin/sh
set -e  

case "$1" in  
   upgrade)  
       update-alternatives --remove builtins.7.gz \  
           /usr/share/man/man7/bash-builtins.7.gz  
       ;;  

   remove|deconfigure)  
       ;;  

   failed-upgrade)  
       ;;  
   *)  
       echo "prerm called with unknown argument \`$1'" >&2  
       exit 1  
       ;;  
esac
Enter fullscreen mode Exit fullscreen mode

Next I looked into /var/cache/apt/archives/ and found the file bash_5.1-6ubuntu1.1_amd64.deb. If you cannot find this file, you can download from here
Next I ran the command

sudo dpkg --force-remove-reinstreq -i /var/cache/apt/archives/bash_5.1-6ubuntu1.1_amd64.deb
Enter fullscreen mode Exit fullscreen mode

This helped me restore the bash and helped me run programs again.

kde Article's
30 articles in total
Favicon
(Quick-note) Troubleshooting Dual Monitor Issues on KDE on Ubuntu/ Linux Mint
Favicon
bash: No such file or directory
Favicon
How To Unhide Titlebars on Maximised Windows in KDE Plasma 6
Favicon
DinaWall 0.2
Favicon
How to enable auto dark mode (night theme) in KDE Plasma
Favicon
Using KConfig with Rust
Favicon
Bitflags in Rust
Favicon
Season of KDE 2022
Favicon
Creating Rust/QML Project using Templates
Favicon
My sleek and modern Linux development machine in 2021
Favicon
Activate USB Wi-Fi Receiver from Terminal
Favicon
KDE Development with Podman
Favicon
My KDE Workfloaw
Favicon
How to recover KDE if it doesn't load after updating FreeBSD from 12.x to 13.0-RELEASE
Favicon
Fuck FreeBSD
Favicon
The state of Linux as a daily use OS in 2021
Favicon
SPOTIFY SYSTEM TRAY [KDE]
Favicon
Fedora - KDE development journey (Qt5X11Extras)
Favicon
Fedora - KDE development journey (Qt5UiPlugin)
Favicon
Fedora - KDE development journey (Qt5Qml / qmake)
Favicon
KDE vs GNOME
Favicon
Setting up Arch Linux with KDE Plasma in Windows Subsystem for Linux 2
Favicon
âš™ My Arch Linux setup
Favicon
Writing a KDE Plasmoid to display JioFi Stats
Favicon
KDE Plasma & ssh keys
Favicon
Trying out KDE
Favicon
My (k)Ubuntu (OSX look alike) desktop setup
Favicon
KDE Neon on 2017 MacBook Air
Favicon
Script your Yakuake with default tabs
Favicon
How to execute Firefox with support for KDE filepicker

Featured ones: