sh: getcwd() failed: No such file or directory

Bug #442096 reported by dentaku65
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Invalid
Undecided
Unassigned
bash (Ubuntu)
Invalid
Undecided
JmAbuDabi
libdvdread (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: apt

I did apt-get update and apt-get dist-upgrade
I got this output:

The following packages will be upgraded:
  libdvdread4
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 64.2kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com karmic/universe libdvdread4 4.1.3-5ubuntu2 [64.2kB]
Fetched 64.2kB in 0s (90.6kB/s)
sh: getcwd() failed: No such file or directory
sh: getcwd() failed: No such file or directory
sh: getcwd() failed: No such file or directory
(Reading database ... 217316 files and directories currently installed.)
Preparing to replace libdvdread4 4.1.3-5ubuntu1 (using .../libdvdread4_4.1.3-5ubuntu2_i386.deb) ...
Unpacking replacement libdvdread4 ...
Setting up libdvdread4 (4.1.3-5ubuntu2) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Date:
04 October 09
Karmic beta

ProblemType: Bug
Architecture: i386
CheckboxSubmission: 154f4fceb50fd0badadd6245967b13ab
CheckboxSystem: 331fbefb4b1f6727f4a8261fee7507c9
Date: Sun Oct 4 12:16:19 2009
DistroRelease: Ubuntu 9.10
Package: apt 0.7.23.1ubuntu1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
SourcePackage: apt
Uname: Linux 2.6.31-11-generic i686

Revision history for this message
dentaku65 (dentaku65) wrote :
Revision history for this message
Sebastian Geiger (lanoxx) wrote :

I got this behaviour too today, and also when running apport-bug or ubuntu-bug.

affects: apt (Ubuntu) → apport (Ubuntu)
affects: apport (Ubuntu) → apt (Ubuntu)
affects: apt (Ubuntu) → libdvdread (Ubuntu)
Changed in apport (Ubuntu):
status: New → Invalid
Revision history for this message
Felix Yan (felixonmars) wrote :

Same problem after updating here today.
when running bash, i got a message a little different:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Revision history for this message
Felix Yan (felixonmars) wrote :

And when using auto-complition, I got these messages after pressing TAB:

symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

summary: - output error using apt-get today - sh: getcwd() failed: No such file or
- directory
+ sh: getcwd() failed: No such file or directory
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

This error occurs if you run a command in a directory which no longer exists. To reproduce it, do the following:
Make an empty dir called bugreprod in your home directory and cd into it.
Now, open Nautilus and delete the directory.
Run 'sudo apt-get update' or any other command in the shell which is in the non-existant directory, and you will get this error.

I think this is a problem with your system, and not with bash or apport.

Changed in bash (Ubuntu):
status: New → Invalid
Changed in libdvdread (Ubuntu):
status: New → Invalid
Revision history for this message
pioruns (pioruns) wrote :

Still true, as today, on Xubuntu 11.10 i386.
I uninstalled postfix, and current directory on terminal was still /etc/postfix/. Every command with apt-get was spamming output with
sh: getcwd() failed: No such file or directory
I changed current directory to ~ and problem gone.

Revision history for this message
Jānis Kangarooo (kangarooo) wrote :

But why anyway installing something on sustem should be checking in folder im now in terminal? It shouldnt

Revision history for this message
Renato Alexandre do Passo Magnelli (renatomagnelli) wrote :

Same as pioruns: "cd .." solved the problem.

Revision history for this message
JmAbuDabi (dambldor91) wrote :

Command: cd ~

Resolve this problem

Changed in bash (Ubuntu):
assignee: nobody → JmAbuDabi (dambldor91)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.