abarbarian Posted January 16, 2021 Share Posted January 16, 2021 (edited) I thought I had fixed the problem shown in the title by adding , Quote export EDITOR=nano to my .bashrc as the problem went away. However it has resurfaced and I have tried several different ways to solve the problem but have met with no success. I have added, Quote VISUAL=nano export EDITOR=nano to my .bashrc but it has not helped. I have tried using the full path as in, Quote export EDITOR=/usr/bin/nano After making changes to .bashrc I have tried " source ~/.bashrc " and rebooting to no avail. I have tried several different ways of making changes to the sudoers file but none of them have worked. I do not understand why my initial attempt made a temporary fix but has not worked since. Yes I have read the Arch wiki and probably hundreds of guides and tips on the net but am stumped. I need help. Edited January 16, 2021 by abarbarian Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 16, 2021 Share Posted January 16, 2021 Are you using bash or zsh? Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 16, 2021 Author Share Posted January 16, 2021 25 minutes ago, securitybreach said: Are you using bash or zsh? I am bashing my head against the wall constantly I just found the solution. It seems I had a gremlin line in my .bashrc. I have a pretty complicated, Quote export PS1="\[$(tput sgr0)\]\[\033[38;5;75m\]\t\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;75m\]\d\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;2m\]\W\[$(tput sgr0)\]\n\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]" and it seems for some strange reason that this had been added to the start of it, Quote exexport=/usr/binexport=nano export PS1="\[$(tput sgr0)\]\[\033[38;5;75m\]\t\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;75m\]\d\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;2m\]\W\[$(tput sgr0)\]\n\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]"export=/usr/binexport=nano and that was enough to throw everything out of wack. I now have, Quote export VISUAL="$EDITOR" export EDITOR="nano" in .bashrc and everything is working well. I have stopped bashing my head against the wall. At least for now anyway. 1 Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 16, 2021 Share Posted January 16, 2021 Drunken edits? 2 Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted January 16, 2021 Share Posted January 16, 2021 If you use SU (not sudo), you need to also edit your root .bashrc so that you'll have the same editor/settings as root. 1 1 Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 16, 2021 Share Posted January 16, 2021 Or ~/.zshrc 1 Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 16, 2021 Author Share Posted January 16, 2021 5 hours ago, V.T. Eric Layton said: If you use SU (not sudo), you need to also edit your root .bashrc so that you'll have the same editor/settings as root. I can not find a root .bashrc. I did find a /etc/bash.bashrc and made the changes there though. Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 16, 2021 Share Posted January 16, 2021 1 hour ago, abarbarian said: I can not find a root .bashrc. I did find a /etc/bash.bashrc and made the changes there though. That is the global setting as long as there isn't one in the home folders of the users. 2 Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted January 16, 2021 Share Posted January 16, 2021 open terminal su to root root:# cd root:# ls -al -rw-r--r-- 1 root root 762 Dec 3 2016 .bashrc Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 17, 2021 Author Share Posted January 17, 2021 21 hours ago, V.T. Eric Layton said: open terminal su to root root:# cd root:# ls -al -rw-r--r-- 1 root root 762 Dec 3 2016 .bashrc Quote Put brain in gear befor pressing enter18:28:01-->Sun Jan 17-->~ -->su Password: [root@longship bloodaxe]# cd [root@longship ~]# ls-al bash: ls-al: command not found Hmm don't not seem to work here 21 hours ago, securitybreach said: That is the global setting as long as there isn't one in the home folders of the users. So those settings should apply to root aswell then shouldn't they ?? Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 17, 2021 Share Posted January 17, 2021 59 minutes ago, abarbarian said: Hmm don't not seem to work here So those settings should apply to root aswell then shouldn't they ?? It's ls -la He was missing a space between command and switch Quote Link to comment Share on other sites More sharing options...
crp Posted January 18, 2021 Share Posted January 18, 2021 i have a similar problem with the java path setting not being seen when running a script from cron but works just swell when run from command line. same non-root user. Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 18, 2021 Author Share Posted January 18, 2021 15 hours ago, securitybreach said: It's ls -la He was missing a space between command and switch Yeah well even correcting my mistake and entering the correct commands does not magically make a root .bashrc appear. Does a bog standard fresh install of Arch even have a root .bashrc ? Quote Put brain in gear befor pressing enter10:53:14-->Mon Jan 18-->~ -->su Password: [root@longship bloodaxe]# cd [root@longship ~]# ls -al total 24 drwxr-x--- 5 root root 4096 Jan 14 23:59 . drwxr-xr-x 17 root root 4096 Jan 11 22:37 .. -rw------- 1 root root 3360 Jan 17 19:43 .bash_history drwx------ 3 root root 4096 Jan 15 16:36 .cache drwx------ 3 root root 4096 Jan 11 22:37 .gnupg drwx------ 2 root root 4096 Jan 14 00:06 .icewm Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 It will not be there by default, same as the one in your user directory. The global setting is /etc/bashrc and the user settings are in home: /home/username/.bashrc /root/.bashrc Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted January 18, 2021 Share Posted January 18, 2021 15 minutes ago, securitybreach said: It will not be there by default That's interesting. I've always seen that .bashrc in the /root directory of any distribution I ran on my systems. Does Arch rely more on sudo, as does Ubuntu? I can't remember. Been a while since I had an Arch installation. @abarbarian, if you have to, you can just create a .bashrc in the /root directory to suit your needs. Here's a generic: export PS1='\u@abarbarian\w\:$ ' umask 022 # root prompt = red TERM_USER_HOST_COLOR='0;31m' TERM_PATH_COLOR='0;31m' TERM_PROMPT_COLOR='0;31m' TERM_USER_HOST='<add host (computer name) here>' TERM_PATH='\w' TERM_PROMPT='\$' export PS1=\ '\[\e['${TERM_USER_HOST_COLOR}'\]'${TERM_USER_HOST}'\[\e[m\]'\ '\[\e['${TERM_PATH_COLOR}'\]'${TERM_PATH}'\[\e[m\]'\ '\[\e['${TERM_PROMPT_COLOR}'\]:#\[\e[m\] ' # You may uncomment the following lines if you want `ls' to be colorized: # export LS_OPTIONS='--color=auto' # eval "`dircolors`" # alias ls='ls $LS_OPTIONS' # alias ll='ls $LS_OPTIONS -l' # alias l='ls $LS_OPTIONS -lA' # # Some more alias to avoid making mistakes: # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' The above .bashrc requires you to add in your host (computer name) information. This is a customized .bashrc that I use that turns your terminal font color to RED when you are root. This is my actual .bashrc (root) on my system. You can see the format required to add your host name to the above. export PS1='\u@ericsbane07\w\:$ ' umask 022 # root prompt = red TERM_USER_HOST_COLOR='0;31m' TERM_PATH_COLOR='0;31m' TERM_PROMPT_COLOR='0;31m' TERM_USER_HOST='\u@ericsbane07' TERM_PATH='\w' TERM_PROMPT='\$' export PS1=\ '\[\e['${TERM_USER_HOST_COLOR}'\]'${TERM_USER_HOST}'\[\e[m\]'\ '\[\e['${TERM_PATH_COLOR}'\]'${TERM_PATH}'\[\e[m\]'\ '\[\e['${TERM_PROMPT_COLOR}'\]:#\[\e[m\] ' # You may uncomment the following lines if you want `ls' to be colorized: # export LS_OPTIONS='--color=auto' # eval "`dircolors`" # alias ls='ls $LS_OPTIONS' # alias ll='ls $LS_OPTIONS -l' # alias l='ls $LS_OPTIONS -lA' # # Some more alias to avoid making mistakes: # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' When using this .bashrc on my system is causes the prompt to look like this: vtel57@ericsbane07~:$ su Password: ********* root@ericsbane07/home/vtel57:# Anyway, here's some more info on .bashrc -> https://www.journaldev.com/41479/bashrc-file-in-linux Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 Arch doesn't rely on anything. Nothing is installed and setup on an arch installation unless you install it yourself. Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 A full installation from the Arch ISO gives you a TTY login, that is it. Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 18, 2021 Author Share Posted January 18, 2021 Thanks @V.T. Eric Layton Eric I dabbled with changing my prompt a good while ago and ended up using " tput " and managed to have a different root prompt. This is how it looks on this fresh install. It looked a lot better on the old set up but I am having difficulty altering the xterm at the moment. Yet another gremlin that is haunting me 1 Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 18, 2021 Author Share Posted January 18, 2021 3 hours ago, securitybreach said: It will not be there by default, same as the one in your user directory. The global setting is /etc/bashrc and the user settings are in home: /home/username/.bashrc /root/.bashrc There is no, /etc/.bashrc there is however , /etc/bash.bashrc https://wiki.archlinux.org/index.php/bash#Customize_per-command Quote Personal aliases are preferably stored in ~/.bashrc, and system-wide aliases (which affect all users) belong in /etc/bash.bashrc https://wiki.archlinux.org/index.php/Bash/Prompt_customization Quote Start off by copying the skeleton files /etc/skel/.bash_profile and /etc/skel/.bashrc to /root, then edit /root/.bashrc as desired. This information is pretty hard to track down or at least it seems so to me. Below are three examples of my /root/~, Basic install with icewm installed, ]# ls -al total 24 drwxr-x--- 5 root root 4096 Jan 14 23:59 . drwxr-xr-x 17 root root 4096 Jan 11 22:37 .. -rw------- 1 root root 3393 Jan 18 14:42 .bash_history drwx------ 3 root root 4096 Jan 15 16:36 .cache drwx------ 3 root root 4096 Jan 11 22:37 .gnupg drwx------ 2 root root 4096 Jan 14 00:06 .icewm Basic install after creating .bashrc, ]# ls -al total 28 drwxr-x--- 5 root root 4096 Jan 18 14:49 . drwxr-xr-x 17 root root 4096 Jan 11 22:37 .. -rw------- 1 root root 3393 Jan 18 14:42 .bash_history -rw-r--r-- 1 root root 296 Jan 18 14:49 .bashrc drwx------ 3 root root 4096 Jan 15 16:36 .cache drwx------ 3 root root 4096 Jan 11 22:37 .gnupg drwx------ 2 root root 4096 Jan 14 00:06 .icewm This is from my old Arch install, ]# ls -la total 80 drwxr-x--- 12 root root 4096 Dec 14 16:03 . drwxr-xr-x 17 root root 4096 Oct 19 12:54 .. drwxr-x--- 2 root root 4096 Aug 5 2019 .android -rw------- 1 root root 8381 Dec 14 16:03 .bash_history -rw-r--r-- 1 root root 295 May 15 2020 .bashrc drwx------ 6 root root 4096 Dec 13 19:42 .cache drwxr-xr-x 19 root root 4096 Jun 2 2020 .ccache drwx------ 12 root root 4096 Nov 12 00:25 .config drwx------ 3 root root 4096 Jun 24 2018 .dbus -rw------- 1 root root 489 Feb 8 2020 dead.letter drwx------ 3 root root 4096 Jun 3 2017 .gnupg drwxr-xr-x 4 root root 4096 Sep 13 2017 GNUstep drwxr-xr-x 2 root root 4096 Jun 20 2017 .inxi drwxr-xr-x 3 root root 4096 Apr 13 2018 .local drwxr-xr-x 6 root root 4096 May 24 2020 .luckyBackup -rw-r--r-- 1 root root 2728 Mar 16 2018 .nvidia-settings-rc -rw------- 1 root root 0 Nov 9 17:37 .Xauthority -rwxr-xr-x 1 root root 236 Jun 4 2017 .xinitrc -rw-r--r-- 1 root root 1 Jun 4 2017 .xinitrc.old.Jun04.10:25:30 Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 The path is now /etc/bash.bashrc It was previously /etc/bashrc Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 Bash is considered an interactive shell when its standard input, output and error are connected to a terminal (for example, when run in a terminal emulator), and it is not started with the -c option or non-option arguments (for example, bash script). All interactive shells source /etc/bash.bashrc and ~/.bashrc, while interactive login shells also source /etc/profile and ~/.bash_profile. https://wiki.archlinux.org/index.php/Bash Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 18, 2021 Author Share Posted January 18, 2021 15 minutes ago, securitybreach said: The path is now /etc/bash.bashrc It was previously /etc/bashrc You managed to catch up, well done 1 Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 18, 2021 Share Posted January 18, 2021 Well I do not use bash at all and my zsh is configured already. Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted January 18, 2021 Share Posted January 18, 2021 Wow! That Arch stuff in cornfoosin'! Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 19, 2021 Author Share Posted January 19, 2021 16 hours ago, securitybreach said: Well I do not use bash at all and my zsh is configured already. You get a pass on this one then but don't let it happen again. 14 hours ago, V.T. Eric Layton said: Wow! That Arch stuff in cornfoosin'! As it is set up slightly different to other distros finding the relevant information can be a tad confusing. Also the Arch Wiki seems to have been altered a lot lately and is not as good as it was a couple of years ago or way back when I first started to use it. An if you make typos or paste stuff inadvertently in files or are generally confused by tech speak and rambling all inclusive guides then Arch can be very confusing. Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 19, 2021 Share Posted January 19, 2021 Well, remember that arch uses upstream sources so those changes arent arch specific anyway. Quote Link to comment Share on other sites More sharing options...
Hedon James Posted January 19, 2021 Share Posted January 19, 2021 4 hours ago, abarbarian said: You get a pass on this one then but don't let it happen again. As it is set up slightly different to other distros finding the relevant information can be a tad confusing. Also the Arch Wiki seems to have been altered a lot lately and is not as good as it was a couple of years ago or way back when I first started to use it. An if you make typos or paste stuff inadvertently in files or are generally confused by tech speak and rambling all inclusive guides then Arch can be very confusing. I learned the hard way to make a backup copy of the file before I modify it, for easy restoration in those cases. OldFile > OldFileBAK. Who am I kidding....I'm STILL learning to do that....I MEAN TO do that everytime, but sometimes get so excited in the progress that I skip that step. But it sure is handy when I remember. 2 Quote Link to comment Share on other sites More sharing options...
abarbarian Posted January 22, 2021 Author Share Posted January 22, 2021 On 1/18/2021 at 4:34 PM, abarbarian said: Thanks @V.T. Eric Layton Eric I dabbled with changing my prompt a good while ago and ended up using " tput " and managed to have a different root prompt. This is how it looks on this fresh install. It looked a lot better on the old set up but I am having difficulty altering the xterm at the moment. Yet another gremlin that is haunting me Sorted my xterm gremlin and me terminal looks a tad better. Can anyone suggest a better font for me terminal ? Quote Link to comment Share on other sites More sharing options...
securitybreach Posted January 22, 2021 Share Posted January 22, 2021 I prefer Source Code Pro Quote Link to comment Share on other sites More sharing options...
sunrat Posted January 22, 2021 Share Posted January 22, 2021 I use Hack 11pt - https://sourcefoundry.org/hack/ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.