You are not logged in.

#1 2021-11-05 22:17:52

turbochamp
Member
Registered: 2021-11-05
Posts: 23

[SOLVED]Can't get zsh to write a config "can't write to ~/.config/zsh"

Hello, I followed the wiki and I cannot figure this out. zsh is installed and set as my default shell and it does work. However I cannot get the zsh-newuser-install to run and write a config file. Only thing I can think of is I know LightDM can mess with paths so I uninstalled LightDM but is something lingering? Also made sure terminal size was big enough.

Steps:
- install zsh and zsh-completions
- zsh
- autoload -Uz zsh-newuser-install (nothing happens)
- zsh-newuser-install -f (error below)
- copy code from ~/.bashrc to ~/.zshrc and ~/.bash_profile to ~/.zprofile
- set default shell to zsh
- reboot


$ zsh-newuser-install -f
zsh-newuser-install: can't write to ~/.config/zsh[

$ echo $SHELL
/usr/bin/zsh

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin

$ echo $FPATH
/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/functions/Calendar:/usr/share/zsh/functions/Chpwd:/usr/share/zsh/functions/Completion:/usr/share/zsh/functions/Completion/Base:/usr/share/zsh/functions/Completion/Linux:/usr/share/zsh/functions/Completion/Unix:/usr/share/zsh/functions/Completion/X:/usr/share/zsh/functions/Completion/Zsh:/usr/share/zsh/functions/Exceptions:/usr/share/zsh/functions/Math:/usr/share/zsh/functions/MIME:/usr/share/zsh/functions/Misc:/usr/share/zsh/functions/Newuser:/usr/share/zsh/functions/Prompts:/usr/share/zsh/functions/TCP:/usr/share/zsh/functions/VCS_Info:/usr/share/zsh/functions/VCS_Info/Backends:/usr/share/zsh/functions/Zftp:/usr/share/zsh/functions/Zle

My ~/.bashrc contains:

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

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

And ~/.bash_profile:

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

Lastly /etc/profile

# /etc/profile

# Set our umask
umask 022

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
    for profile in /etc/profile.d/*.sh; do
        test -r "$profile" && . "$profile"
    done
    unset profile
fi

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
    . /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

Whatr am I doing wrong?

Last edited by turbochamp (2021-11-05 23:18:03)

Offline

#2 2021-11-05 23:00:47

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED]Can't get zsh to write a config "can't write to ~/.config/zsh"

turbochamp wrote:

Whatr am I doing wrong?

Using quote tags instead of code tags tongue Actually you posted a number of files that don't seem very relevant, especially if you haven't changed the default versions (I can't be bothered to diff them all, though; you could highlight changes, if any).

$ zsh-newuser-install -f
zsh-newuser-install: can't write to ~/.config/zsh[

This is surprising. The [ at the end could be a typo, but last time I checked, zsh didn't bother with anything like XDG_CONFIG_HOME. Did you set ZDOTDIR? (That would be a relevant thing to mention.)

Edit: that seems to be it. (I did a quick test.) Either unset ZDOTDIR or make sure the directory exists before running zsh-newuser-install.

Last edited by Raynman (2021-11-05 23:02:26)

Offline

#3 2021-11-05 23:17:32

turbochamp
Member
Registered: 2021-11-05
Posts: 23

Re: [SOLVED]Can't get zsh to write a config "can't write to ~/.config/zsh"

Raynman wrote:
turbochamp wrote:

Whatr am I doing wrong?

Using quote tags instead of code tags tongue Actually you posted a number of files that don't seem very relevant, especially if you haven't changed the default versions (I can't be bothered to diff them all, though; you could highlight changes, if any).

$ zsh-newuser-install -f
zsh-newuser-install: can't write to ~/.config/zsh[

This is surprising. The [ at the end could be a typo, but last time I checked, zsh didn't bother with anything like XDG_CONFIG_HOME. Did you set ZDOTDIR? (That would be a relevant thing to mention.)

Edit: that seems to be it. (I did a quick test.) Either unset ZDOTDIR or make sure the directory exists before running zsh-newuser-install.

Thank you! That worked, man I was banging my head for this. And yes the ] was a typo. I'll use code tags from now on smile

Offline

Board footer

Powered by FluxBB