I put together an ubuntu 12.04 server a couple of weeks ago and everything seemed fine until this morning.

Suddenly, I'm having trouble installing new packages - at first I thought there was something wrong with tinyproxy and so I tried installing squid instead. However, I get similar results:

Starting tinyproxy: tinyproxy: Could not open config file "/etc/tinyproxy.conf".\
/var/lib/dpkg/info/squid3.postinst: 1: /var/lib/dpkg/info/squid3.postinst: cannot open /etc/squid3/squid.conf: No such file

It seems that apt-get is not creating the configuration files needed for these programs.

I haven't modified any configuration or user groups since the last successful update/install of packages.

/etc is present, and is populated with a nice healthy tree of configuration files. It is owned and grouped to root, and has the properties drwxr-xr-x - all the files and folders inside seem to be fine to, as far as I can tell. I've even been able to edit/save a couple as sudo.

Full output from installing tinyproxy:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/61.6 kB of archives.
After this operation, 201 kB of additional disk space will be used.
Selecting previously unselected package tinyproxy.
(Reading database ... 58916 files and directories currently installed.)
Unpacking tinyproxy (from .../tinyproxy_1.8.3-1_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up tinyproxy (1.8.3-1) ...
Starting tinyproxy: tinyproxy: Could not open config file "/etc/tinyproxy.conf".
invoke-rc.d: initscript tinyproxy, action "start" failed.
dpkg: error processing tinyproxy (--configure):
 subprocess installed post-installation script returned error exit status 70
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

A suggestion from a friend was to check the downloaded package in /var/cache/apt/archives. There is an entry for /etc/tinyproxy.conf

Running sudo touch /etc/tinyproxy.conf generates an empty file owned by and writeable to root.

Result of strace after installation:

18467 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
18467 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
18467 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\30\2\0\0\0\0\0"..., 832) = 832
18467 open("/etc/tinyproxy.conf", O_RDONLY) = -1 ENOENT (No such file or directory)

I was able to work around the problem by copying a config from another server and setting it up for the new one - but this is not exactly ideal.

  • Please run ls /etc/* in Terminal. – hexafraction Sep 23 '12 at 23:53
  • have run it - it seems to be pretty well populated with configuration (have added details into the question) – HorusKol Sep 24 '12 at 0:19
  • why remove the 12.04 tag? – HorusKol Sep 24 '12 at 0:21
  • You can add it back, it was Jorge Castro who removed it. – hexafraction Sep 24 '12 at 0:22
  • I know - I was just wondering why: no point adding it back if it just gets taken away again. – HorusKol Sep 24 '12 at 0:43

I have a few suggestions on things you should check.

  • is /etc/ located on a different partition as '/' (rootfs)? Please provide output of mount.
  • can you create directories and/or files under /etc/ as root? Have you verified it?

Each installed package has a few meta-data files stored under /var/lib/dpkg/info/PKGNAME.*. For instance, the installation of the adduser package creates the following files:


What's of interest here are the files ending in preinst|postinst|prerm|postrm. They are executed pre/post installation or removal. Look at what's inside of them and try to run them manually - you could add some echo statements to them to see where and how they fail, etc. They are usually just Bash scripts.

what about permissions of all files in the directory ? are those files ok (there can be HW err also) ? have you tried to access those files by touch or other basic command to verify their status? fastest will be :

ls -la /etc/

check permissions, inodes and links, if there are only links you can have those files corrupted elsewhere.. but the lamest question at the end.. have you tried to run this as sudo ?

  • yeah, I always run apt-get as sudo (muscle memory :) ) - and all the files in /etc appear to be correctly permissioned and I've been able to edit/save them. – HorusKol Sep 24 '12 at 2:05

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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