Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:
 tinyproxy
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:
 tinyproxy
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.

share|improve this question
    
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
show 3 more comments

2 Answers 2

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:

adduser.conffiles
adduser.config
adduser.list
adduser.md5sums
adduser.postinst
adduser.postrm
adduser.templates

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.

share|improve this answer
add comment

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 ?

share|improve this answer
    
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
add comment

Your Answer

 
discard

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.