urpmi not working in gnome terminal (Mandriva) Topic is solved

Need help with your Linux distro? All questions are good - not all answers are -but we try

Moderator: jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

urpmi not working in gnome terminal (Mandriva)

Postby viking60 » 06 May 2010, 11:25

I have been playing arround a bit with the .bashrc file in Mandriva and Arch. After todays uodate in cooker the gui was gone (bug that could be fixed by an update).
But bash cannot find the urpmi command in the Gnome-terminal (yes the other commands are working) - so I have to do a CTRL+ALT+ F1 to enter urpmi commands.

This is clearly guru stuff - so I thought I'll give it a go here? My .bashrc looks like this.

Code: Select all

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Which is the standard I belive?

So far I have tried to boot into an older kernel, same sh....
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: urpmi not working in gnome terminal

Postby dedanna1029 » 06 May 2010, 14:15

I have the same.

Code: Select all

$ cat .bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
   . /etc/bashrc
fi

*shrug*

What happens if you

Code: Select all

rpm -qa | grep urpmi

?
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: urpmi not working in gnome terminal

Postby viking60 » 06 May 2010, 16:12

It is all there:

thomas@thomas-pc ~]$ rpm -qa | grep urpmi
urpmi-6.35-1mdv2010.1
urpmi-parallel-ssh-6.35-1mdv2010.1
gurpmi-6.35-1mdv2010.1

It all works in a non gui sesion (CTRL+ALT+F1) The command is not recognized in the gnome terminal.
Hmm.. since we have the same .bashrc I am beginning to think cooker bug...

And in fact it was the modifications of .bashrc that was the reason, It seems like cooker now needs a path in the /root/.bashrc

Code: Select all

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
ENV=$HOME/.bashrc
USERNAME="root"
export USERNAME ENV PATH

This comes before the standard code that you have.
(Mine is still heavily modified - because Über-Berserks always must have the coolest command line prompts) +1
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: urpmi not working in gnome terminal

Postby dedanna1029 » 06 May 2010, 19:29

LOL. I used to do the same, but after a while got to where I didn't care any more.

I suspected a cooker bug from the get-go; have been eyeing the issues people are having after the latest update, and they are plenty. :\ Go file one. The most they can do is say no (and more times than not, they do).
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: urpmi not working in gnome terminal

Postby viking60 » 06 May 2010, 21:45

dedanna1029 wrote:LOL. I used to do the same, but after a while got to where I didn't care any more.

You are just jealous that I have a smiley in my command line prompt :!: ;) And if I write a wrong code it turns red and sour - it's neat

In root the CL changes color every time I hit enter. This is useful when you query a lot of stuff and wonder where the list starts.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: urpmi not working in gnome terminal SOLVED

Postby dedanna1029 » 07 May 2010, 00:26

Eh, jealous, no. Don't have time to futz with the computer for stuff much any more. :\

So, you've marked this solved. What solved it?
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: urpmi not working in gnome terminal SOLVED  Topic is solved

Postby viking60 » 07 May 2010, 09:36

Obviously I did not wrap it up correctly :oops: ; this is what toke care of it:

I have the traditional .bashrc file in my home directory: /home/viking/.bashrc
I modified it and thereby I also needed (and created) a different .bashrc file for the root user in: /root/.bashrc

Now the traditional content of .bashrc that you and I checked out was:

Code: Select all

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
   . /etc/bashrc
fi


It works perfectly fine with one exception; in Cooker the urpmi command is lost - it is simply not found by bash in the terminal.
This only affects the root user (well urpmi does not work as a normal user anyway). So I got a friend i the Mandriva community to post the content of his .bashrc and discovered that cooker (2010.1) has an altered standard for the file.
http://forum.mandriva.com/viewtopic.php?t=127892
I need to put the path above into the file for the root user.

So the perfect working system no has two .bashrc files; one in my home directory that looks like this:

Code: Select all

   # .bashrc

# User specific aliases and functions

# Source global definitions
#if [ -f /etc/bashrc ]; then
#   . /etc/bashrc
#fi
# Check for an interactive session
#[ -z "$PS1" ] && return

#alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
bash_prompt_cmd() {
RTN=$?



smiley() {
    if [ $1 == 0 ] ; then
echo ":)"
    else
echo ":("
       fi
    }
smileyc() {
    if [ $1 == 0 ] ; then
echo $GREEN
else
echo $RED
       fi
    }
 if [ $(tput colors) -gt 0 ] ; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RST=$(tput op)
fi
smiley=$(smiley $RTN)
smileyc=$(smileyc $RTN)
        local CY="\[\e[1;31m\]" # Each is 12 chars long
        local BL="\[\e[1;34m\]"
        local WH="\[\e[1;37m\]"
        local BR="\[\e[0;33m\]"
        local RE="\[\e[1;31m\]"
        local PROMPT="${CY}$"
        [ $UID -eq "0" ] && PROMPT="${RE}#"

        # Add the first part of the prompt: username,host, and time
        local PROMPT_PWD=""
        local PS1_T1="$BL.:[ $CY`whoami`@`hostname` $BL: $CY\t $BL:$CY "
        local ps_len=$(( ${#PS1_T1} - 12 * 6 + 6 + 4 )) #Len adjust for colors, time and var
        local PS1_T2=" $BL]:.\n\[\$smileyc\]\$smiley\[$RST\] "
        local startpos=""

        PROMPT_PWD="${PWD/#$HOME/~}"
        local overflow_prefix="..."
        local pwdlen=${#PROMPT_PWD}
        local maxpwdlen=$(( COLUMNS - ps_len ))
        # Sometimes COLUMNS isn't initiliased, if it isn't, fall back on 80
        [ $maxpwdlen -lt 0 ] && maxpwdlen=$(( 80 - ps_len ))

        if [ $pwdlen -gt $maxpwdlen ] ; then
                startpos=$(( $pwdlen - maxpwdlen + ${#overflow_prefix} ))
                PROMPT_PWD="${overflow_prefix}${PROMPT_PWD:$startpos:$maxpwdlen}"
        fi     
        export PS1="${PS1_T1}${PROMPT_PWD}${PS1_T2}"
}
PROMPT_COMMAND=bash_prompt_cmd

This is not the important code and could have been the code you have really.

And one in the root directory /root/.bashrc:

Code: Select all

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
ENV=$HOME/.bashrc
USERNAME="root"
export USERNAME ENV PATH
colors=("\[\e[0;30m\]" "\[\e[0;31m\]" "\[\e[0;32m\]" "\[\e[0;33m\]" "\[\e[0;34m\]"
"\[\e[0;35m\]" "\[\e[0;36m\]" "\[\e[0;37m\]" "\[\e[1;30m\]" "\[\e[1;31m\]"
"\[\e[1;32m\]" "\[\e[1;33m\]" "\[\e[1;34m\]" "\[\e[1;35m\]" "\[\e[1;36m\]" "\[\e[1;37m\]")

PROMPT_COMMAND='let R=$RANDOM%16+0;color=${colors[$R]};PS1="${color}\u@\h:\w\$\[\e[0m\] "'

The four first lines of this code make urpmi work again - the rest makes the command line prompt change color every time I hit enter. This is useful when you query a lot of stuff and wonder where the list starts.

I hope this makes sense :?:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Help”