You are not logged in.

#1 2024-03-28 18:52:52

poliocertes
Member
From: Poland
Registered: 2010-02-19
Posts: 29

[Solved] /root/.bashrc issue

Since a couple of years I'm using Archlinux. Last installation after 6 years is gone with old laptop. Did already a new one and got an issue. Trying to configure .bashrc and for user account, everything is ok. Root account did via wiki with coping both files from /etc/skel to /root and when I'm trying to edit /root/.bashrc and safe after that make no changes. Can anyone explain what I did wrong? Don't know why that work for user, but not for a root...

/root/.bashrc file

#
# /root/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

#Display ISO version and distribution information in short
alias version="sed -n 1p /etc/os-release && sed -n 11p /etc/os-release && sed -n 12p /etc/os-releas>

#Pacman Shortcuts
alias sync="sudo pacman -Syyy"
alias install="sudo pacman -S"
alias update="sudo pacman -Syyu"
alias search="sudo pacman -Ss"
alias search-local="sudo pacman -Qs"
alias pkg-info="sudo pacman -Qi"
alias local-install="sudo pacman -U"
alias clr-cache="sudo pacman -Scc"
alias unlock="sudo rm /var/lib/pacman/db.lck"
alias remove="sudo pacman -R"
alias autoremove="sudo pacman -Rns"

echo SNAFU

root@jacek-hp /home/jacek # echo SNAFU
SNAFU

/root/.bashrc permission

root@jacek-hp ~ # ls -l /root/.bashrc
-rwxrwxrwx 1 root root 702 03-29 05:31 /root/.bashrc

Last edited by poliocertes (2024-03-29 16:20:32)

Offline

#2 2024-03-28 21:50:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [Solved] /root/.bashrc issue

Post the bashrc, add something obvious like "echo SNAFU" to the top and (as root) run "bash", does that print "SNAFU"?
If yes, please elaborate on the problem (unless it's maybe obvious from the bashrc) - what changes to you expect, what do you get and what's the context (how do you login as root, is bash the roots default shell etc)
Also what are the permissions on /root/.bashrc?

Offline

#3 2024-03-29 13:59:31

poliocertes
Member
From: Poland
Registered: 2010-02-19
Posts: 29

Re: [Solved] /root/.bashrc issue

All I want is to have as root my own prompt. Formerly I did it in /root/.bashrc same as for user only with another font color. Now make no difference.

Last edited by poliocertes (2024-03-29 14:44:41)

Offline

#4 2024-03-29 14:45:54

poliocertes
Member
From: Poland
Registered: 2010-02-19
Posts: 29

Re: [Solved] /root/.bashrc issue

I did it! Default shell for root account was zsh. After chsh -s /bin/bash root everything is ok. TOPIC can be closed.

Last edited by poliocertes (2024-03-29 15:00:10)

Offline

#5 2024-03-29 15:21:10

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] /root/.bashrc issue

You should remove this alias:

poliocertes wrote:
alias sync="sudo pacman -Syyy"

https://wiki.archlinux.org/title/system … nsupported

And passing -y twice for upgrades just hits the servers unnecessarily.


Jin, Jîyan, Azadî

Offline

#6 2024-03-29 15:32:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,009

Re: [Solved] /root/.bashrc issue

Mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Fwwi

-rwxrwxrwx 1 root root 702 03-29 05:31 /root/.bashrc

bad - make it "600", not 777

Offline

Board footer

Powered by FluxBB