Server Fault is a question and answer site for system and network administrators. 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

I've ran a general audit of the system and found that a few packages were aging, such as OpenSSH and related so I went to apt-get update then upgrade.

Unfortunately it seems to get the packages correctly (downloading), however cannot finish the upgrade process. Here is an exact copy of my recent command line to show this error, note that packages were already downloaded from previous test of this so it needs to retrieve zero bytes (note I am root:)

root@foobar:~# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  apt apt-utils at bind9-host binutils bsdutils curl dhcp3-client dhcp3-common
  dnsutils dpkg-dev ifupdown initscripts krb5-multidev language-pack-en
  language-pack-en-base libapache2-mod-php5 libapr1 libapr1-dev
  libavahi-client3 libavahi-common-data libavahi-common3 libbind9-60 libblkid1
  libc-bin libc-dev-bin libc6 libc6-dev libcurl3 libcurl3-gnutls libdbus-1-3
  libdns64 libgssapi-krb5-2 libgssrpc4 libisc60 libisccc60 libisccfg60
  libk5crypto3 libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkrb5-3
  libkrb5-dev libkrb5support0 liblcms1 libldap-2.4-2 libldap2-dev liblwres60
  libmysqlclient-dev libmysqlclient16 libnss3-1d libpam-runtime libpam0g
  libpango1.0-0 libpango1.0-common libplymouth2 libpq-dev libpq5 libssl-dev
  libssl0.9.8 libtiff4 libudev0 libuuid1 libxml2 libxml2-dev linux-libc-dev
  login logrotate mount mysql-client mysql-client-5.1 mysql-client-core-5.1
  mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 nginx ntp
  ntpdate openjdk-6-jre-headless openjdk-6-jre-lib openssh-client
  openssh-server openssl opera passwd perl perl-base perl-modules php-pear
  php5 php5-cli php5-common php5-dev php5-gd php5-mysql plymouth postfix rsync
  rsyslog sudo sysv-rc sysvinit-utils tzdata tzdata-java udev update-inetd
  upstart util-linux uuid-dev vsftpd xkb-data
112 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B/124MB of archives.
After this operation, 3,506kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Extracting templates from packages: 100%
Preconfiguring packages ...
/tmp/ifupdown.config.188089: 13: dpkg: Permission denied
/tmp/openssh-server.config.188701: 49: dpkg: Permission denied
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)

I am completely unsure of what I have done wrong, this version is 10.04.2 LTS of Ubuntu and it is of course the server edition no of which I am using on my VPS, will it force me to do some dist-upgrade or something first? is it just some simple permission problem?

One thing I have done recently before this, I had set the sticky bit in /tmp as recommended by an auditing guide so I could not allow other users to modify other users' files in that folder (it is just a folder), I am wondering if that is it, or I need to run this in a different manner..


As requested per below comment,

ls -la output:

root@foobar:~# ls -la /tmp
total 20
drwxr-xr-t  5 mainuser mainuser 4096 2011-07-06 03:17 .
drwxr-xr-x 23 root   root   4096 2011-07-05 04:39 ..
drwxr-xr-x  2 root   root   4096 2011-06-17 03:30 hsperfdata_root
drwxrwxrwt  2 root   root   4096 2011-06-15 03:47 .ICE-unix
-rw-------  1 root   root      0 2011-07-05 04:13 lsat1.lsat
drwxrwxrwt  2 root   root   4096 2011-06-15 03:47 .X11-unix

Update: now is this after suggestion to fix permissions:

total 20
drwxrwxrwt  5 root root 4096 2011-07-06 03:50 .
drwxr-xr-x 23 root root 4096 2011-07-05 04:39 ..
drwxr-xr-x  2 root root 4096 2011-06-17 03:30 hsperfdata_root
drwxrwxrwt  2 root root 4096 2011-06-15 03:47 .ICE-unix
-rw-------  1 root root    0 2011-07-05 04:13 lsat1.lsat
drwxrwxrwt  2 root root 4096 2011-06-15 03:47 .X11-unix

And problem still persists.

share|improve this question
what is the output of ls -l /tmp and df -h ? – jamespo Jul 6 '11 at 10:33
@jamespo, I will update my question with both results in less than a moment. – Alexander Jul 6 '11 at 10:35
@jamespo, strange.. mainuser is one of my sub users with less permissions meant to be logged in to normally to sudo.. I wonder what my sticky bit did to make it owned by him.. Should I chown /tmp to root? – Alexander Jul 6 '11 at 10:38
up vote 1 down vote accepted

The problem is most likely not with the files located in /tmp; those are scripts that apt-get creates, which are then causing some errors (13 and 49 are line numbers). Specifically, the scripts are unable to execute the dpkg command.

Find dpkg on your system, make sure it's in your $PATH (or at least, somewhere apt-get can find it), and make sure it's executable (chmod +x).

share|improve this answer

I was getting the same kinds of problems. I had read that /var could be mounted noexec, which apparently it cannot, as upon removing the noexec from the fstab and rebooting apt-get started working again.

share|improve this answer

Who's this mainuser who owns /tmp? Isn't /tmp normally world-writeable, mine is set as:

drwxrwxrwt  17 root root 4.0K 2011-07-06 11:43 tmp

You should be able to amended your permissons with:

chown root:root /tmp
chmod g+w,o+w /tmp

This will change the owner and group to root, and then allow write permission for members of the group, and also others.

share|improve this answer
How strange, the permissions are proper now however the dpkg issues still exist. I am unsure why it is throwing permission errors at ifupdown like script, I wonder what on earth the apt-get is doing. – Alexander Jul 6 '11 at 10:52
Just double-check the output of "mount", and ensure all the filesystems are mounted "rw". If the system has remounted a filesystem read-only it can through-up issues in peculiar places. – Coops Jul 6 '11 at 10:57
ALSO: what happens when you try making the file in question? i.e. try running "touch /tmp/openssh-server.config.188701". (Remember to remove it afterwards in case it breaks things further!). – Coops Jul 6 '11 at 10:58
it has rw attributes on the mount, and touching it works fine (including rw permissions for owner upon ls -la so it should be writable by the script), I am really wondering what is wrong here.. – Alexander Jul 6 '11 at 11:01
Umh. Strange. I'll have a think. – Coops Jul 6 '11 at 11:07

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.