首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >tinyproxy通过apt-get无法创建配置文件进行安装。

tinyproxy通过apt-get无法创建配置文件进行安装。
EN

Ask Ubuntu用户
提问于 2012-09-23 23:51:55
回答 2查看 2.2K关注 0票数 3

几周前,我组装了一个ubuntu12.04服务器,直到今天早上,一切看起来都很好。

突然间,我在安装新的软件包时遇到了麻烦--一开始我认为tinyproxy有问题,所以我尝试安装squid。然而,我也得到了类似的结果:

代码语言:javascript
复制
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

似乎apt-get并没有为这些程序创建所需的配置文件。

自从上次成功更新/安装软件包以来,我从未修改过任何配置或用户组。

/etc是存在的,并由一个健康的配置文件树填充。据我所知,它拥有并分组为root,并具有属性drwxr-xr-x --据我所知,所有文件和文件夹似乎都很好。我甚至可以编辑/保存一对夫妇为sudo。

安装tinyproxy的全部输出:

代码语言:javascript
复制
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)

一个朋友的建议是在/var/cache/apt/archives中检查下载的包。有一个用于/etc/tinyproxy.conf的条目

运行sudo touch /etc/tinyproxy.conf将生成一个由root拥有并可写的空文件。

安装后的暂停结果:

代码语言:javascript
复制
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)

我能够通过从另一台服务器复制配置并为新服务器设置配置来解决这个问题,但这并不理想。

EN

回答 2

Ask Ubuntu用户

发布于 2012-12-13 00:30:56

我对一些你应该检查的事情有一些建议。

  • /etc/是否位于不同的分区上,如'/‘(rootfs)?请提供mount的输出。
  • 你能在/etc/下创建目录和/或文件吗?你核实过了吗?

每个已安装的包都有几个元数据文件存储在/var/lib/dpkg/info/PKGNAME下。例如,安装adduser包会创建以下文件:

代码语言:javascript
复制
adduser.conffiles
adduser.config
adduser.list
adduser.md5sums
adduser.postinst
adduser.postrm
adduser.templates

令人感兴趣的是以preinst_postinst_prerm_prerm_postrm结尾的文件。它们是在安装或拆除前/后执行的。查看它们的内部,并尝试手动运行它们--您可以向它们添加一些echo语句,以查看它们在哪里以及如何失败,等等。它们通常只是Bash脚本。

票数 1
EN

Ask Ubuntu用户

发布于 2012-09-24 01:00:22

目录中所有文件的权限如何?这些文件可以吗(也可以是HW err )?您是否尝试通过触摸或其他基本命令访问这些文件以验证它们的状态?最快的将是:

代码语言:javascript
复制
ls -la /etc/

检查权限、索引和链接,如果只有链接,则可以在其他地方破坏这些文件。但最后最愚蠢的问题..。你试过把这个当做sudo来运行吗?

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/192275

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档