Squid3 无法通过 apt 安装

Squid3 无法通过 apt 安装

我正在尝试squid3通过 更新我的 Debian Wheezy 盒子apt-get。当我运行升级时,它是唯一未安装的软件包。

# apt-get upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up squid3 (3.1.20-2.2+deb7u2) ...
chown: invalid group: `proxy:proxy\r'
dpkg: error processing squid3 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 squid3
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经验证,是的,proxy既作为 中的用户存在/etc/passwd,又作为 中的组存在/etc/group。一位朋友认为这是\r最后的,并认为我在 Windows 中编辑了其中一个文件(这是错误的)。我确实备份了这两个文件,并使用命令fromdos更改了它,但它仍然给我同样的错误。

如果我运行dpkg --configure squid3,它只会生成相同的输出。我已经备份了我的 Squid 配置,卸载了它(使用选项purge),并尝试重新安装它,但这也不起作用。用户proxy和组拥有缓存文件夹以及其自身的日志文件夹(/var/log/squid3),所以我认为它不在那里。

我还可以在哪里查看,以及针对此错误我该怎么办?是的,它报告它仍在运行,但我想在此系统上保留 Debian 存储库中的最新版本。

答案1

查看 postinst 脚本 ( /var/lib/dpkg/info/squid3.postinst),这部分很突出:

cache_dir=`grepconf2 cache_dir /var/spool/squid3`
usr=`grepconf cache_effective_user proxy`
grp=`grepconf cache_effective_group proxy`

if [ "$(stat -c %U $cache_dir)" != "$usr" ] ||
   [ "$(stat -c %G $cache_dir)" != "$grp" ] ; then
        chown $usr:$grp $cache_dir -R
fi

看起来你的squid3配置()可能在某个地方/etc/squid3/squid.conf有一个。\r

相关内容