Discussion:
Cygwin broken after update (PATH problem?)
Com MN PG P E B Consultant 3
2006-10-19 08:12:53 UTC
Permalink
I had used Cygwin happily for many month. Now I wanted to update it and
it does not work
anymore. For example, when I click on the Cygwin Icon to start a bash
shell, it first
displays the error messages

: No such file or directory
: No such file or directory
: command not found
: command not found

and then doesn't find any programs (i.e. I can't do a ls, cat, or
whatsoever):

bash-3.1$ ls
bash: ls: command not found

The programs *are* right there in C:\cygwin\bin, but an echo $PATH
revealed that this directory
is not in the PATH:

bash-3.1$ echo $PATH
/c/Program Files/CatPC/Bin:/c/Program
Files/CatPC/Windows/System32:/c/WINNT/syst
em32:/c/WINNT:/c/WINNT/System32/Wbem:/c/Program Files/Employee
Services/:/c/Prog
ram Files/IDM computer/UltraEdit10.10c:/c/Program
Files/IXOS/bin:/c/SWS4/NTBIN
bash-3.1$

I guess the PATH is supposed to be set in /etc/profile, but when I check
C:\cygwin\etc, there is
no profile. Interestingly, csh.cshrc and csh.login *are* there.

Here is how I had performed the cygwin update:

First I reloaded setup.exe from the Cygwin website, to get the most
recent version of setup.
Then I executed setup. When setup asked me where to put the cygwin
directory etc., I always
kept the default values.

After I had observed that my bash doesn't work anymore, I repeated the
setup, to give it
a chance to cleanup any inconsistencies, but it didn't change anything.

Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-***@siemens.com
Dave Korn
2006-10-19 09:36:10 UTC
Permalink
Post by Com MN PG P E B Consultant 3
Post by Com MN PG P E B Consultant 3
No such file or directory
No such file or directory
command not found
command not found
Your /etc/profile has DOS-style CRLF line endings.

You will, I'm sure, not have updated your version of bash without reading
the relevant release announcement, so I am sure you will see at once what the
problem is and one of the recommended solutions will work just fine for you.
Post by Com MN PG P E B Consultant 3
After I had observed that my bash doesn't work anymore, I repeated the
setup, to give it
a chance to cleanup any inconsistencies, but it didn't change anything.
It won't overwrite a locally-modified /etc/profile, that's deliberate.


cheers,
DaveK
--
Can't think of a witty .sigline today....
Com MN PG P E B Consultant 3
2006-10-23 06:48:30 UTC
Permalink
-----Original Message-----
Sent: Thursday, October 19, 2006 11:36 AM
Subject: RE: Cygwin broken after update (PATH problem?)
Post by Com MN PG P E B Consultant 3
No such file or directory
No such file or directory
command not found
command not found
Your /etc/profile has DOS-style CRLF line endings.
Well, the problem is that there *is* no /etc/profile at all.

Here is the content of my etc:

Volume in drive C is System
Volume Serial Number is 84E7-BD21

Directory of C:\cygwin\etc

17.10.2006 12:22 <DIR> .
17.10.2006 12:22 <DIR> ..
22.08.2003 18:12 2.557 a2ps-site.cfg
22.08.2003 18:12 15.071 a2ps.cfg
17.10.2006 12:18 <DIR> alternatives
03.03.2006 06:08 215.739 bash_completion
17.10.2006 12:18 <DIR> bash_completion.d
08.02.2003 12:36 1.356 csh.cshrc
09.10.2003 16:49 404 csh.login
17.10.2006 12:18 <DIR> defaults
26.11.2005 08:07 4.839 enscript.cfg
17.10.2006 12:18 <DIR> fonts
21.10.2005 10:05 770 group
21.10.2005 08:07 479 hosts.lnk
21.10.2005 10:36 139.967 lynx.cfg
22.05.2005 09:17 1.898 mime.types
22.05.2005 09:17 87.414 Muttrc
21.10.2005 08:07 495 networks.lnk
21.10.2005 08:07 1.691 passwd
19.10.2006 09:33 <DIR> postinstall
17.10.2006 12:24 <DIR> preremove
17.10.2006 12:24 <DIR> profile.d
21.10.2005 08:07 495 protocols.lnk
21.10.2005 08:07 495 services.lnk
19.10.2006 09:33 <DIR> setup
17.10.2006 12:18 <DIR> skel
17.10.2006 12:22 <DIR> ssmtp
21.04.2005 22:37 13.717 termcap
16.11.2005 20:56 4.224 wgetrc
17.10.2006 12:19 <DIR> X11
17 File(s) 491.611 bytes
13 Dir(s) 9.771.290.624 bytes free
You will, I'm sure, not have updated your version of bash
without reading
the relevant release announcement,
What type of announcement? I went to http://cygwin.com/ (on this
page, there is definitely no "release announcement" to see), then
clicked on "install or update", which executed setup, then I got
a list of possible packages (in which I added a few), and let it
run.

Isn't this the way an update is supposed to be done?
It won't overwrite a locally-modified /etc/profile, that's
deliberate.
And it is a good thing to do. So it seems that setup did not overwrite,
but delete it, which is really kind of strange.

Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-***@siemens.com
Dave Korn
2006-10-23 08:27:56 UTC
Permalink
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
Your /etc/profile has DOS-style CRLF line endings.
Well, the problem is that there *is* no /etc/profile at all.
Well, that tells us two things:

1) Setup must have failed part-way through. Normally re-running it, with
"Install from local package directory", and clicking through all the default
options, and letting it run to completion should fix any problems, but I see
you tried that already. Hmm.

2) One or more of your /other/ bash startup scripts has CRLF line-endings.
TMI!
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
You will, I'm sure, not have updated your version of bash without reading
the relevant release announcement,
What type of announcement?
The release announcements, that are posted to the cygwin-announce list as
well as to the main cygwin list, every time that a cygwin package is updated.
Weren't you curious about what updates you were going to get and in what way
they would be different from what you already had installed? This one:

http://cygwin.com/ml/cygwin-announce/2006-09/msg00006.html

seems to explain at least part of your problem: self-overwriting error
messages are a sign of CRLF line-ends.
Post by Com MN PG P E B Consultant 3
I went to http://cygwin.com/ (on this
page, there is definitely no "release announcement" to see),
Not all the documentation at the cygwin.com website is on the front page.
It wouldn't all fit. You're expected to have browsed the docs, faq and
mailing-list summaries of your own accord. (The fact that you're here
suggests you /did/ read the mailing-list summary page...)
Post by Com MN PG P E B Consultant 3
then
clicked on "install or update", which executed setup, then I got
a list of possible packages (in which I added a few), and let it
run.
Isn't this the way an update is supposed to be done?
Yes, it is; it seems something has gone wrong.
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
It won't overwrite a locally-modified /etc/profile, that's
deliberate.
And it is a good thing to do. So it seems that setup did not overwrite,
but delete it, which is really kind of strange.
Yep, it's absolutely not meant to do that. Which means that something went
badly wrong, but it's a bit hard to guess what.

If setup.exe doesn't repair the system for you, you can get a fresh copy of
/etc/profile out of /etc/defaults/etc. Hmm, you probably want bash.basrc from
there as well, that seems to be missing from your /etc listing. Try copying
those two files across, then see what you get, and don't forget to try d2u'ing
your ~/.bashrc and ~/.bash_profile.

cheers,
DaveK
--
Can't think of a witty .sigline today....
Com MN PG P E B Consultant 3
2006-10-23 12:39:27 UTC
Permalink
Post by Dave Korn
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
Your /etc/profile has DOS-style CRLF line endings.
Well, the problem is that there *is* no /etc/profile at all.
1) Setup must have failed part-way through. Normally
re-running it, with
"Install from local package directory", and clicking through
all the default
options, and letting it run to completion should fix any
problems, but I see
you tried that already. Hmm.
No, I run setup again from the *website*. But I think this must
be even more safer than just doing it locally.
Post by Dave Korn
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
You will, I'm sure, not have updated your version of
bash without reading
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
the relevant release announcement,
What type of announcement?
The release announcements, that are posted to the
cygwin-announce list as
well as to the main cygwin list, every time that a cygwin
package is updated.
Weren't you curious about what updates you were going to get
and in what way
they would be different from what you already had installed?
Honestly, no, not at all. Yes, this makes me an ignorant, but the
main reason I went to redo the setup, was that I wanted to install
a new package, and when doing this I thought it might be a good
idea to update everything, to get the most recent bug fixes
and so on. So I wasn't that interested in new features.
Post by Dave Korn
http://cygwin.com/ml/cygwin-announce/2006-09/msg00006.html
seems to explain at least part of your problem: self-overwriting error
messages are a sign of CRLF line-ends.
I see. Indeed I did modify the profile, and although I normally take
care about
the line endings (the editor is set to keep line endings style), it
might be
that I also had used on one occasion a different editor which did not
observe
this policy. Not very likely, but I don't want to rule out this
possibility.

But this would not explain why the /etc/profile got *erased*.

However, the announcement says that one should not have bash running
while
doing the setup. I think I did have a cygwin window open, running zsh on
top of bash.
Post by Dave Korn
Post by Com MN PG P E B Consultant 3
I went to http://cygwin.com/ (on this
page, there is definitely no "release announcement" to see),
Not all the documentation at the cygwin.com website is on
the front page.
It wouldn't all fit. You're expected to have browsed the
docs, faq and
mailing-list summaries of your own accord. (The fact that you're here
suggests you /did/ read the mailing-list summary page...)
Yes, I misunderstood you here. I thought you wanted to suggest that
the announcements of the most recent release were supposed to be
always published on the front page (or at least represented via a
direct link, as it is the case on some other software homepages).
Post by Dave Korn
Post by Com MN PG P E B Consultant 3
So it seems that setup did
not overwrite,
Post by Com MN PG P E B Consultant 3
but delete it, which is really kind of strange.
Yep, it's absolutely not meant to do that. Which means
that something went
badly wrong, but it's a bit hard to guess what.
If setup.exe doesn't repair the system for you, you can get
a fresh copy of
/etc/profile out of /etc/defaults/etc.
Thank you, I will try it.

Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-***@siemens.com
Igor Peshansky
2006-10-28 18:10:26 UTC
Permalink
Post by Dave Korn
Post by Com MN PG P E B Consultant 3
Post by Dave Korn
It won't overwrite a locally-modified /etc/profile, that's
deliberate.
And it is a good thing to do. So it seems that setup did not
overwrite, but delete it, which is really kind of strange.
Yep, it's absolutely not meant to do that. Which means that something
went badly wrong, but it's a bit hard to guess what.
Actually, it's meant to do exactly that. The way the /etc files are
upgraded is this: the postinstall script adds the local versions of the
files if they aren't there already and keeps the copy of the original.
Upon uninstall, the preremove script compares the local version with the
original, and if they are the same, removes the local version. Then,
after installing the new version of the package (hence, the new original),
the original is again copied to the local version if it's not present.

What seems to have happened is that the preremove script ran fine (and
removed the local copy), but the postinstall didn't run (so the new local
copy did not get created).
Post by Dave Korn
If setup.exe doesn't repair the system for you, you can get a fresh
copy of /etc/profile out of /etc/defaults/etc. Hmm, you probably want
bash.basrc from there as well, that seems to be missing from your /etc
listing. Try copying those two files across, then see what you get, and
don't forget to try d2u'ing your ~/.bashrc and ~/.bash_profile.
One thing to try would be temporarily adding a text mount for /etc and
seeing if it helps. If it does, then one of the postinstall scripts may
accidentally have CRLF line endings (which would be a packaging bug).
The mount can be removed after the install.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu | ***@watson.ibm.com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Com MN PG P E B Consultant 3
2006-10-30 08:09:56 UTC
Permalink
Post by Igor Peshansky
One thing to try would be temporarily adding a text mount for /etc and
seeing if it helps.
Sorry, what exactly does it mean "to add a *text* mount"?

Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-***@siemens.com
Igor Peshansky
2006-10-30 12:54:25 UTC
Permalink
Post by Com MN PG P E B Consultant 3
Post by Igor Peshansky
One thing to try would be temporarily adding a text mount for /etc and
seeing if it helps.
Sorry, what exactly does it mean "to add a *text* mount"?
Well, the non-abbreviated phrase would be "a text-mode mount". As to how
to add one, read "man mount".
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu | ***@watson.ibm.com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Eric Blake
2006-10-30 12:57:22 UTC
Permalink
Post by Com MN PG P E B Consultant 3
Post by Igor Peshansky
One thing to try would be temporarily adding a text mount for /etc and
seeing if it helps.
Sorry, what exactly does it mean "to add a *text* mount"?
man mount, or http://cygwin.com/cygwin-ug-net/using-utils.html#mount

A text mount (created with mount -t instead of mount -b) treats all files
in that directory hierarchy as text files, and silently strips \r from
those files in programs that open them in default, as opposed to binary, mode.

- --
Life is short - so eat dessert first!

Eric Blake ***@byu.net

Loading...