You are not logged in.

#1 2012-11-05 15:49:22

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Replacing bash with dash or zsh as default shell

Now that initscripts are no longer default init system for Arch, it should be possible (if initscripts removed from system) to remove bash and replace it with other shell, right? On my system I have this:

:: autoconf: requires bash
:: automake: requires bash
:: ca-certificates: requires bash
:: cpupower: requires bash
:: dcron: requires bash
:: enca: requires bash
:: fftw: requires bash
:: filesystem: requires bash
:: gpm: requires bash
:: gsl: requires bash
:: gzip: requires bash
:: iptables: requires bash
:: libksba: requires bash
:: m4: requires bash
:: man-db: requires bash
:: mkinitcpio: requires bash
:: p7zip-light: requires bash
:: pacman: requires bash
:: pkgstats: requires bash
:: pm-utils: requires bash
:: shadow: requires bash
:: smartmontools: requires bash
:: systemd: requires bash
:: unzip: requires bash

(Note: I've removed packets requiring sh.)

Here's a complete list of packets depending on bash (110):

abcde
abs
acpid
antiword
arch-backup
archboot
arch-install-scripts
arch-wiki-lite
audio-convert
aurphan
autoconf
autojump
automake
bashburn
bash-completion
bashdb
bashrun
bwidget
ca-certificates
cl
cpupower
cronie
dcron
dhclient
dkms
drbd
dvdrtools
ecl
enca
fftw
filesystem
foomatic-db-engine
fssos-nsvs
geos
gimp-gap
gpm
groovy
gsl
gzip
hdparm (optional)
ifplugd
incron
initscripts
inputattach
iptables
jython
kim4
laptop-mode-tools
libksba
lksctp-tools
lrzip
lvm2
lvm2 (testing)
lxc
m4
man-db
mathomatic (optional)
mfs-chunkserver
mfs-client
minicom
mkinitcpio
multipath-tools
nanoblogger
noip
ode
oidentd
opencv-samples
openlierox (optional)
openslp
ozerocdoff
p7zip
pacman
pacmatic
pax-utils
pkgstats
pkgtools
pmount
pm-utils
polipo
ponysay
preload
quilt
ratpoison
rblcheck
redis
rkhunter
rpcbind
rpmextract
sane
sdcc
shadow
smartmontools
source-highlight
speedtouch
systemd
tablelist
taglib-rcc
ted
tor
translate-toolkit
txt2man
unzip
uptimed
vde2
vnstat
wdm
wings3d
wireshark-cli
xbase
xdm-archlinux

Do these packages (except initscripts) really need bash? Debian uses dash as its default shell, I think Arch at least need to offer a possibility for using shells other than bash as default.

Any thoughts?

Offline

#2 2012-11-05 16:07:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Replacing bash with dash or zsh as default shell

It would be easier to just use e.g. dash as your default shell and keep bash installed. I have no problems with such setup.

Last edited by karol (2012-11-05 16:08:03)

Offline

#3 2012-11-05 17:32:11

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

I want to remove bash, that's the issue here. smile I already have zsh installed, btw.

Offline

#4 2012-11-05 17:34:41

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: Replacing bash with dash or zsh as default shell

I have just today installed zsh as my default shell and it is wonderfull. It makes you think why bash is the standard. And i was really surprised how many packages depends on bash.


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#5 2012-11-05 17:39:18

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Replacing bash with dash or zsh as default shell

Demon wrote:

I want to remove bash, that's the issue here.

Why? I'm honestly curious -- what's wrong with bash? I prefer zsh as my user shell, but why would I want it as the default for everything else?

Last edited by 2ManyDogs (2012-11-05 17:41:59)

Offline

#6 2012-11-05 17:45:59

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

Why not? I'm just exploring the possibilities.

Offline

#7 2012-11-05 17:50:58

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Replacing bash with dash or zsh as default shell

Well then why don't you symlink /bin/bash to /bin/zsh and see what happens? :-) AFAIK zsh will run bash scripts...

Last edited by 2ManyDogs (2012-11-05 17:52:47)

Offline

#8 2012-11-05 18:13:44

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

Thanks for suggestion. I've manually added 'bash' to %PROVIDES% array in zsh package and removed bash. Then I did 'ln -s /bin/zsh sh'. System "survived" restarting. I've noticed that mkinitcpio really needs bash. I'm not sure about other packages.

Offline

#9 2012-11-05 18:31:22

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: Replacing bash with dash or zsh as default shell

mkinitcpio is a bash script right?, why not look in the intalled packages and add a  #/usr/bin/env bash and intall bash, remove the sh simlink and relink sh to zsh???

or try to use dracut (AUR) probably can (or not I not test it) without bash


Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::

Offline

#10 2012-11-05 19:29:15

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Replacing bash with dash or zsh as default shell

if you remove bash you will sooner or later get into trouble.
zsh can run bash scripts yes, but its not 100% compatible. and since most/all arch system scripts have bash syntax you might get into serious trouble at one point.

so you are really better off having bash installed and dont EVER symlink zsh to bash...
change your default shell to zsh and leave bash as is...


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#11 2012-11-05 19:32:26

fschiff
Member
Registered: 2011-10-06
Posts: 71

Re: Replacing bash with dash or zsh as default shell

bash is the descendent of sh, the Bourne shell, which is required and used for installation or written in, for a lot of programs.  You shouldn't be removing bash, just because you want a different shell script for your login user.

Offline

#12 2012-11-05 21:35:37

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

Well I've just researched a bit more, it seems that there are a lot of scripts in /usr/bin which start with "#/bin/bash". Packages relying on bash like pacman, shadow, mkinitcpio, udev, systemd, are crucial parts of the system therefore bash can't be removed at all. Got it, thanks.

But then packages not needing bash (autoconf, automake, gzip, unzip) should list only sh as dependency, not bash. Right?

Offline

#13 2012-11-05 21:56:37

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Replacing bash with dash or zsh as default shell

Demon wrote:

Why not? I'm just exploring the possibilities.

zsh is not completely backwards-compatible with bash (not that bash is "backwards" in any real way).  There's always a chance that, without the bash interpreter installed, some utilities written in bash won't work properly.  Also, sh in Arch is distributed in the bash package, so uninstalling it will pull those packages with it.

Demon wrote:

But then packages not needing bash (autoconf, automake, gzip, unzip) should list only sh as dependency, not bash. Right?

Some of them already do:

Arch Linux :: GLaDOS  » pacman -Rp bash
error: failed to prepare transaction (could not satisfy dependencies)
:: autoconf: requires bash
:: automake: requires bash
:: bison: requires sh
:: ca-certificates: requires bash
:: cairo: requires sh
:: cpupower: requires bash
:: cronie: requires bash
:: db: requires sh
:: dhcpcd: requires sh
:: dictd: requires sh
:: diffutils: requires sh
:: dmenu: requires sh
:: e2fsprogs: requires sh
:: fakeroot: requires sh
:: filesystem: requires bash
:: findutils: requires sh
:: flex: requires sh
:: freetype2: requires sh
:: gawk: requires sh
:: gdbm: requires sh
:: gettext: requires sh
:: gmp: requires sh
:: gpm: requires bash
:: grep: requires sh
:: gzip: requires bash
:: icu: requires sh
:: iptables: requires bash
:: keyutils: requires sh
:: laptop-mode-tools: requires bash
:: libgpg-error: requires sh
:: libksba: requires bash
:: libpng: requires sh
:: libtool: requires sh
:: libusb-compat: requires sh
:: m4: requires bash
:: make: requires sh
:: man-db: requires bash
:: mkinitcpio: requires bash
:: nss: requires sh
:: pacman: requires bash
:: perl: requires sh
:: sane: requires bash
:: sed: requires sh
:: shadow: requires bash
:: systemd: requires bash
:: taglib: requires sh
:: tar: requires sh
:: unzip: requires bash
:: which: requires sh
:: xorg-mkfontdir: requires sh
:: xz: requires sh

Offline

#14 2012-11-05 22:16:30

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

ANOKNUSA wrote:

Some of them already do:

No no, I meant, for example these packages:

automake
autoconf
gzip
unzip
m4
p7zip

do not require bash explicitely, yet they have listed bash as dependency. IMHO this should be reported to their respective maintainers.

Offline

#15 2012-11-06 00:17:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Replacing bash with dash or zsh as default shell

Actually, check out /bin/sh.  It is just a symlink to bash.  If you run something with sh, it is just bash set up to run like sh.

Offline

#16 2012-11-14 16:11:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Replacing bash with dash or zsh as default shell

https://bugs.archlinux.org/task/20557 got implemented - coming in pacman 4.1.

Offline

#17 2012-11-14 23:50:23

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Replacing bash with dash or zsh as default shell

Demon wrote:
ANOKNUSA wrote:

Some of them already do:

No no, I meant, for example these packages:

automake
autoconf
gzip
unzip
m4
p7zip

do not require bash explicitely, yet they have listed bash as dependency. IMHO this should be reported to their respective maintainers.


They require bash to run their post install scripts.

Offline

#18 2012-11-15 06:14:12

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: Replacing bash with dash or zsh as default shell

Allan wrote:

They require bash to run their post install scripts.

Thanks for clarification.

Offline

#19 2020-11-04 13:50:30

altaway
Member
Registered: 2020-06-04
Posts: 15

Re: Replacing bash with dash or zsh as default shell

Sorry for the necrobump, but if you change the symlink from bash to zsh, xinit/xorg may hang for you. Even the tty shortcuts (Ctrl + Alt + Fx) don't work. The only ways to get out of this are a reboot or an external-chroot/ssh followed by a SIGKILL to Xorg. Just putting this as a warning.

Offline

#20 2020-11-04 14:20:19

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,354

Re: Replacing bash with dash or zsh as default shell

That is highly unlikely to be inherently true. But yes it is discouraged to do this because of reasons similar to this.

In any case, this is an 8 year old thread there's no reason to drag it up from the grave.

Closing.

Offline

Board footer

Powered by FluxBB