包中缺少文件?

包中缺少文件?

我曾经squid安装过。我想清理一下,以便获得默认配置。

我做到了:

apt remove squid --auto-remove 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libecap3 libnetfilter-conntrack3 libpython3-dev libpython3.5-dev python3-dev python3-wheel python3.5-dev squid squid-common squid-langpack
0 upgraded, 0 newly installed, 10 to remove and 288 not upgraded.
After this operation, 65.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 161441 files and directories currently installed.)
Removing squid (3.5.12-1ubuntu7.10) ...
Removing libecap3:amd64 (1.0.1-3ubuntu3) ...
Removing libnetfilter-conntrack3:amd64 (1.0.5-1) ...
Removing python3-dev (3.5.1-3) ...
Removing libpython3-dev:amd64 (3.5.1-3) ...
Removing python3.5-dev (3.5.2-2ubuntu0~16.04.8) ...
Removing libpython3.5-dev:amd64 (3.5.2-2ubuntu0~16.04.8) ...
Removing python3-wheel (0.29.0-1) ...
Removing squid-common (3.5.12-1ubuntu7.10) ...
Removing squid-langpack (20150704-1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

但后来我注意到它/etc/squid/squid.conf仍然存在,于是我手动删除了它并尝试重新安装

sudo apt install squid
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libecap3 libnetfilter-conntrack3 squid-common squid-langpack
Suggested packages:
  squidclient squid-cgi squid-purge smbclient winbindd
The following NEW packages will be installed:
  libecap3 libnetfilter-conntrack3 squid squid-common squid-langpack
0 upgraded, 5 newly installed, 0 to remove and 288 not upgraded.
Need to get 2,499 kB/2,698 kB of archives.
After this operation, 11.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 squid-common all 3.5.12-1ubuntu7.15 [176 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 squid amd64 3.5.12-1ubuntu7.15 [2,323 kB]
Fetched 2,499 kB in 0s (3,684 kB/s)
Selecting previously unselected package libecap3:amd64.
(Reading database ... 158955 files and directories currently installed.)
Preparing to unpack .../libecap3_1.0.1-3ubuntu3_amd64.deb ...
Unpacking libecap3:amd64 (1.0.1-3ubuntu3) ...
Selecting previously unselected package libnetfilter-conntrack3:amd64.
Preparing to unpack .../libnetfilter-conntrack3_1.0.5-1_amd64.deb ...
Unpacking libnetfilter-conntrack3:amd64 (1.0.5-1) ...
Selecting previously unselected package squid-langpack.
Preparing to unpack .../squid-langpack_20150704-1_all.deb ...
Unpacking squid-langpack (20150704-1) ...
Selecting previously unselected package squid-common.
Preparing to unpack .../squid-common_3.5.12-1ubuntu7.15_all.deb ...
Unpacking squid-common (3.5.12-1ubuntu7.15) ...
Selecting previously unselected package squid.
Preparing to unpack .../squid_3.5.12-1ubuntu7.15_amd64.deb ...
Unpacking squid (3.5.12-1ubuntu7.15) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.9) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libecap3:amd64 (1.0.1-3ubuntu3) ...
Setting up libnetfilter-conntrack3:amd64 (1.0.5-1) ...
Setting up squid-langpack (20150704-1) ...
Setting up squid-common (3.5.12-1ubuntu7.15) ...
Setting up squid (3.5.12-1ubuntu7.15) ...
Installing new version of config file /etc/resolvconf/update-libc.d/squid ...
insserv: warning: current start runlevel(s) (empty) of script `squid' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `squid' overrides LSB defaults (0 1 6).
insserv: can not symlink(../init.d/aegis, ../rc2.d/S03aegis): File exists
insserv: can not symlink(../init.d/aegis, ../rc3.d/S03aegis): File exists
insserv: can not symlink(../init.d/aegis, ../rc4.d/S03aegis): File exists
insserv: can not symlink(../init.d/aegis, ../rc5.d/S03aegis): File exists
Skipping profile in /etc/apparmor.d/disable: usr.sbin.squid
Processing triggers for libc-bin (2.23-0ubuntu10) ...

但后来我注意到,在上面输出的最后,有一些文件存在,我不确定它是否安装正确。因此,我再次尝试强制安装:

# apt-get --reinstall install squid
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 288 not upgraded.
Need to get 2,323 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 squid amd64 3.5.12-1ubuntu7.15 [2,323 kB]
Fetched 2,323 kB in 0s (5,468 kB/s)
(Reading database ... 161235 files and directories currently installed.)
Preparing to unpack .../squid_3.5.12-1ubuntu7.15_amd64.deb ...
Unpacking squid (3.5.12-1ubuntu7.15) over (3.5.12-1ubuntu7.15) ...
Processing triggers for systemd (229-4ubuntu21.9) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up squid (3.5.12-1ubuntu7.15) ...
insserv: warning: current start runlevel(s) (empty) of script `squid' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `squid' overrides LSB defaults (0 1 6).
Skipping profile in /etc/apparmor.d/disable: usr.sbin.squid

但好像什么都没有安装。

然后,我检查以确保包中确实包含该文件:

# apt-file list squid | grep conf
biosquid-dev: /usr/include/biosquid/squidconf.h
biosquid-dev: /usr/share/doc/biosquid-dev/examples/Testsuite/sqdconfig_main.c
lightsquid: /etc/apache2/conf-available/lightsquid.conf
squid: /etc/resolvconf/update-libc.d/squid
squid: /etc/squid/squid.conf
squid-cgi: /etc/squid/cachemgr.conf
squid-common: /usr/share/doc/squid-common/squid.conf.documented.gz
squid-common: /usr/share/squid/mime.conf
squid-deb-proxy: /etc/init/squid-deb-proxy.conf
squid-deb-proxy: /etc/resolvconf/update-libc.d/squid-deb-proxy
squid-deb-proxy: /etc/squid-deb-proxy/squid-deb-proxy.conf
squid-deb-proxy-client: /etc/apt/apt.conf.d/30autoproxy
squidguard: /etc/squidguard/squidGuard.conf.default
squidguard: /usr/share/doc/squidguard/examples/sample.conf
squidguard: /usr/share/doc/squidguard/examples/time-config.txt
squidguard-doc: /usr/share/doc/squidguard-doc/doc/configuration.txt.gz
squidguard-doc: /usr/share/doc/squidguard-doc/doc/configure.txt.gz
squidguard-doc: /usr/share/doc/squidguard-doc/html/configure.html
squidtaild: /etc/squidtaild/squidtaild.conf

它在包裹里,但不在我的盒子里:

# ll /etc/squid/squid.conf
ls: cannot access '/etc/squid/squid.conf': No such file or directory

知道如何修复这个问题吗?

谢谢!

答案1

目录上当前设置的权限是什么文件 /etc//etc/squid/

您可能需要先进行清除,然后对与 squid 相关的任何内容进行全系统搜索。这是我自己坏习惯的糟糕例子,但我非常喜欢,所以locate,如果您想使用一个糟糕的例子,请执行以下操作:

# install locate
sudo apt update
sudo apt install mlocate
# update the locate database
sudo updatedb
# find squids
locate squid

然后,您可以删除它显示的文件。我有一个经常使用的经过精心修改的 Ubuntu 版本(经过修改,我安装了大量随机垃圾以进行测试——安装了许多应用程序),它只有三个对 squid 的引用,而且它们都是来自 Anaconda 的与 python 相关的东西,所以 YMMV 但我认为这会帮助您清除污泥。

相关内容