LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   kpackage wont uninstall (https://www.linuxquestions.org/questions/slackware-14/kpackage-wont-uninstall-360547/)

dave`2005 09-05-2005 07:01 PM

kpackage wont uninstall
 
Hi all, I tried to uninstall a package using kpackage, it asked me for the root pass as normal but once i entered it, it gives me root@computername:/home/user>.

I was watching someone using bash and they changed some stuff in .bash_profile, i couldnt find the file in my home dir but added stuff to .bashrc instead. Here is my .bashrc:

Code:

PS1="\u@\h:\w> "
export PS1

eval `dircolors -b`
alias ls='ls --color=auto'
alias rm='rm -i'
alias 0ff='shutdown -h now'

# Make sure our customised gtkrc file is loaded.
export GTK2_RC_FILES=$HOME/.gtkrc-2.0

# User Specific environment and startup programs
PATH=$PATH:/usr/sbin:/sbin
export PATH
unset USERNAME

Is this what has messed up kpackage?

While on the .bashrc subject, the 0ff alias works if i su to root from my normal user but not if i just log in as root. Can anyone tell me where i am going wrong on these 2 problems?

Any help very appreciated.

gbonvehi 09-06-2005 12:04 PM

I would recommend you to use pkgtool instead of kpackage, just to be on the safe side.

Regarding bash,
That file only applies to the user that owns it, ~ means home directory. So ~/.bashrc applies to the user that has it.
It works when you su to root because values are passed from the user to root.

If you need some global options for bash, use /etc/bashrc or put them in /etc/profile.

dave`2005 09-06-2005 02:37 PM

Thanks for the help :) Gonna try /etc/bashrc or /etc/profile. One thing tho, i put the same .bashrc (one with the 0ff alias) into the /root dir shouldnt that make it work for the root user?

gbonvehi 09-06-2005 04:56 PM

It should work, how are you logging as root? Are you using su? If you do, add a - at the end, like su -
That will load login files like bashrc.

dave`2005 09-06-2005 05:36 PM

Im logging in as root by typing root then the root pass, not using su. When i do that shouldnt the .bashrc in the root folder be working? when logging in like that i cant use the alias "0ff" which is definately in the .bashrc in /root.

gbonvehi 09-06-2005 05:39 PM

Create a file called ~/.bash_profile and put this:
Code:

if [ -f ~/.bashrc ]; then
        source ~/.bashrc
fi

That should make bash always read .bashrc

.bashrc is called depending on how you run bash. You can find more info reading bash's man page.

dave`2005 09-06-2005 07:22 PM

Sorry to be a pain but now when i log in as root i get "-bash: .~/.bashrc: No such file or directory". Ive tried it being called .bashrc, /.bashrc, ~/.bashrc and .~/.bashrc but get the same thing. I think ~/ means the home directory but tried all the strange names anyway. Had a look at the man for bash but couldnt see anything relevant. (:newbie: )

Are the .bashrc and .bashprofile in the wrong place (/root/) ?. Does my .bashrc have something wrong with it?

Code:

# .bashrc

# prompt
PS1="\u@\h:\w>"
export PS1

#aliases & color
eval `dircolors -b`
alias ls='ls --color=auto'
alias rm='rm -i'
alias 0ff='shutdown -h now'

# Make sure our customised gtkrc file is loaded.
export GTK2_RC_FILES=$HOME/.gtkrc-2.0

# User Specific environment and startup programs
PATH=$PATH:/usr/sbin:/sbin
export PATH
unset USERNAME


dave`2005 09-06-2005 08:34 PM

Nevermind, i put them in /etc/profile.

Thanks gbonvehi for the help and patience :D


All times are GMT -5. The time now is 06:18 PM.