YaST not Working/sudo zypper does

Hey all

So, I installed OpenSuse12.1 there a few days ago, and I have a really strange problem. Basically I am using a proxy to connect to the internet (proxy.proxy.proxy:8080), and when I set this up so that my internet works etc. However, I have been unable to get my Software repositories to work through YaST. The error is


Cannot access installation media 
http://dl.google.com/linux/chrome/rpm/stable/x86_64
 (Medium 1).
Check whether the server is accessible.

Now, when I try to ping the server (dl.google.com) it works fine, though I am unable to ping the actual address (but I believe this to be due to the fact that you can only ping the server, not the particular files on the server, please correct me if I am wrong there).

Now, in terminal, if I log onto superuser (using su) then I get the same error

zypper refresh

** (process:7775): WARNING **: The connection is closed

** (process:7775): WARNING **: The connection is closed

** (process:7775): WARNING **: The connection is closed

** (process:7775): WARNING **: The connection is closed

** (process:7775): WARNING **: The connection is closed
Download (curl) error for 'http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml':
Error code: Connection failed
Error message: couldn't connect to host

Abort, retry, ignore? [a/r/i/?] (a): 

However, when I try to use sudo, it works fine.

sudo zypper refresh
root's password:
Repository 'google-chrome' is up to date.
Repository 'nvidia' is up to date.
Repository 'packman' is up to date.
Repository 'openSUSE-12.1-Non-Oss' is up to date.
Repository 'openSUSE-12.1-Oss' is up to date.

I would like to get it working with YaST, so that the install/remove package installer will work. Has anyone ever ran across this kind of problem before?

On 2012-03-13 15:06, Dyemo wrote:

> repositories to work through YaST. The error is

You get more data in the logs.

> Now, when I try to ping the server (dl.google.com) it works fine,

No, you can not ping a server when there is a proxy, the result is not
indicative. You have to browse to it, and even that may mean nothing.

> Now, in terminal, if I log onto superuser (using su) then I get the
> same error

Try “su -”.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Actually, there is a show details button which I just noticed which gives

Download (curl) error for 'http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml':
Error code: Connection failed
Error message: couldn't connect to host

Can you tell me what logs I should look up? I am pretty sure that this is something wrong with my proxy, but not sure what. Or why it works with sudo, but not when I log in as a superuser.

Now, when I try to ping the server (dl.google.com) it works fine,

No, you can not ping a server when there is a proxy, the result is not
indicative. You have to browse to it, and even that may mean nothing.

You can, and I have. What do you mean by the results may not be indicitive? Also, I can browse there just fine as well (well, I can’t browse to the google one, but I can browse to Index of /debug/update/12.1 fine, and they all have the same error.

Now, in terminal, if I log onto superuser (using su) then I get the
same error

Try “su -”.

su -

this works. Why doesn’t “su” work, and how can I set up YaST so it will work?

Thanks.

EDIT: I have been reading about the difference between su and “su -” and it seems to be that “su -” resets all your enviroment variables. Does this mean that it is a n enviroment variable that is causing the repos not to be contactable?

EDIT: I have been reading about the difference between su and “su -” and it seems to be that “su -” resets all your enviroment variables. Does this mean that it is a n enviroment variable that is causing the repos not to be contactable?

Using su instead of *su - *is security issue and may e.g. lead to you executing the wrong program somewhere (because of the wrong PATH variable. I guess not many peole are willing to find this exact case out for you. This more then 30 year old security rule says: do use su -. This is not a law (because this is Linux and you are free to do what you want), but sound advice.

On 2012-03-13 17:26, Dyemo wrote:

> Can you tell me what logs I should look up? I am pretty sure that
> this is something wrong with my proxy, but not sure what.

All logs reside under /var/log/. There is a “zypper.log” there, and also a
zypp directory with things. Plus, a “/var/log/YaST2/” directory with more
things.

Which exact file will be of interest has to be found. Notice the date of
all files (ls -ltr something), look inside the recent ones (less something).

> Or why it
> works with sudo, but not when I log in as a superuser.

Because you were not the full superuser (su -). :slight_smile:

>>> Now, when I try to ping the server (dl.google.com) it works fine,
>>
>> No, you can not ping a server when there is a proxy, the result is not
>> indicative. You have to browse to it, and even that may mean nothing.
>>
>
> You can, and I have. What do you mean by the results may not be
> indicitive?

A web proxy intercepts transmissions on port 80 TCP. A ping is done on
ICMP. Different protocols travels different routes, the “ping” does not
travel via the proxy, so… how can you compare both?

> this works. Why doesn’t “su” work, and how can I set up YaST so it
> will work?

Well, in a terminal type “su -”, password, then “yast2 &” and it should
work. I hope :slight_smile:

> Thanks.

Welcome. :slight_smile:

> EDIT: I have been reading about the difference between su and “su -”
> and it seems to be that “su -” resets all your enviroment variables.
> Does this mean that it is a n enviroment variable that is causing the
> repos not to be contactable?

It could well be. With “su” you keep the environment of the user you were
at before. With “su -” you get the environment of the target user (root in
this case).


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)