Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My operating system is Ubuntu precise. I tried to implement sudo apt-get install texlive-fonts-extra, then I got error:

Setting up linux-image-3.2.0-27-generic (3.2.0-27.43) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)

when I type one enter after another, it appears on the shell:

Could not chdir to /:No such file or directory at /var/lib/dpkg/info/linux-image-3.2.0-27-generic.postinst line 235`.

dpkg: error processing linux-image-3.2.0-27-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up linux-image-3.2.0-29-generic (3.2.0-29.46) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)

Then I took a look at line 235, it is like this:

chdir ($cwd) or die "Could not chdir to $params{'New Dir'}:$!";

cwd is defined in the lines above this line as:

chomp($cwd = `pwd`);

I cannot find a clue why the error occurs.

I tried all the stuff provided in the Ubuntu forum, like:

sudo dpkg --configure -a

sudo apt-get -f install

sudo dpkg --configure initramfs-tools

They just don't work. (either end up in the same error as illustrated above or e.g.package initramfs-tools is already installed and configured)

I really appreciate it if anyone can give me a hint on this.

Thank you in advance!

share|improve this question

Are you using an encrypted home directory? You could try to cd to some other directory (i.e. /) before executing sudo apt-get ...

My wild guess here is, that some package script tries to explicitly cd into the directory from which you executed the program and is not allowed to. This can be the case when the directory is on a fuse volume (i.e. an encrypted home dir) since fuse processes can deny access even to root.

It could also be unrelated to fuse and encryption when some environment variable ($CWD) is not preserved correctly over the sudo call... or similiar.

Anyway, try cd / before executing apt-get and let's see what happens.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.