我想知道默认情况下是否有任何东西可以清除.cache
文件夹。据我了解.cache
,类似于/tmp
,至少我看到它被这样使用。这意味着缓存或临时文件中的任何内容都可能在某个时间点被重新访问,甚至被清理掉,无论它是否丢失都无关紧要。
几个月前,我通过一个组织帐户使用了 Microsoft Teams (Linux)。现在我想将它与其他帐户一起使用。我目前处于注销状态,因为我无权访问 org 帐户。每次打开,它都会带我到组织页面,并要求我登录。没有Use Another account
或Sign In with another account
选项。当您最初打开时,当它发送请求以将我们带到组织页面时,有一个取消选项,但这不起作用。它使应用程序无响应。
apt-remove
现在我尝试使用, from software center
, .多次卸载purge
。每次我安装时,它都会获取数据/缓存,并尝试将我带到同一个组织页面。我怎样才能完全重置,删除它用于使用我的新帐户安装的数据。
使用sudo systemd-resolve --statistics
让我查看当前的 dns 缓存统计信息,例如:
Cache
Current Cache Size: 68
Cache Hits: 412
Cache Misses: 461
我想查看 dns 缓存的所有条目(这里是 68 个),可以吗?
我正在尝试清除正在运行的笔记本电脑上的缓存:
Operating System: Ubuntu 20.04 LTS
Kernel: Linux 5.4.0-40-generic
但是,当我输入这些命令时,这是输出:
$ sudo sync; echo 1 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied
$ sudo sync; echo 2 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied
$ sudo sync; echo 3 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied
但是,当检查我的权限时,我得到了这个:
$ sudo -l
Matching Defaults entries for [MY USERNAME] on [COMPUTER NAME]:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User [MY USERNAME] may run the following commands on [COMPUTER NAME]:
(ALL : ALL) ALL
看来我可以运行所有命令。为什么会发生这种情况,有解决办法吗?
我也在root中复制了这个问题。
我systemd-resolved
进入调试模式,试图解决来自这台机器的大量 DNS 查询(tcfe01
)。似乎systemd-resolved
保留了多个缓存副本,一个用于全局范围(*/*
),另一个用于特定网络设备(eno1/*
)。从日志看来,似乎只有全局范围 ( */*
) 被缓存,而不是 ( eno1/*
)。对于第一个查询,我们看到Cache miss
两个范围,但对于后续查询,我们得到Positive cache hit
全局范围,但又Cache miss
是设备范围,我们最终每次都访问 DNS 服务器。
这违背了拥有缓存的全部目的,不仅损害了本地计算机 ( tcfe01
) 的性能,而且还不必要地破坏了 DNS 服务器。对这种行为的任何洞察都会非常有帮助。
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Got DNS stub UDP query packet for id 14184
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Looking up RR for google.com IN A.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Switching to DNS server 192.168.10.25 for interface eno1.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Switching to system DNS server 192.168.10.25.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Cache miss for google.com IN A
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Transaction 48281 for <google.com IN A> scope dns on */*.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Using feature level UDP+EDNS0 for transaction 48281.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Using DNS server 192.168.10.25 for transaction 48281.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Sending query packet with id 48281.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Cache miss for google.com IN A
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Transaction 1213 for <google.com IN A> scope dns on eno1/*.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Using feature level UDP+EDNS0 for transaction 1213.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Using DNS server 192.168.10.25 for transaction 1213.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Sending query packet with id 1213.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Processing query...
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Processing incoming packet on transaction 48281. (rcode=SUCCESS)
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Verified we get a response at feature level UDP+EDNS0 from DNS server 192.168.10.25.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Added positive unauthenticated cache entry for google.com IN A 299s on */INET/192.168.10.25
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Transaction 48281 for <google.com IN A> on scope dns on */* now complete with <success> from network (unsigned).
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Freeing transaction 1213.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Sending response packet with id 14184 on interface 1/AF_INET.
Apr 23 16:45:34 tcfe01 systemd-resolved[26041]: Freeing transaction 48281.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Got DNS stub UDP query packet for id 50679
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Looking up RR for google.com IN A.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Positive cache hit for google.com IN A
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Transaction 51371 for <google.com IN A> on scope dns on */* now complete with <success> from cache (unsigned).
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Cache miss for google.com IN A
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Transaction 16504 for <google.com IN A> scope dns on eno1/*.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Using feature level UDP+EDNS0 for transaction 16504.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Using DNS server 192.168.10.25 for transaction 16504.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Sending query packet with id 16504.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Freeing transaction 51371.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Freeing transaction 16504.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Sending response packet with id 50679 on interface 1/AF_INET.
Apr 23 16:45:45 tcfe01 systemd-resolved[26041]: Processing query...
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Got DNS stub UDP query packet for id 50950
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Looking up RR for google.com IN A.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Positive cache hit for google.com IN A
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Transaction 27482 for <google.com IN A> on scope dns on */* now complete with <success> from cache (unsigned).
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Cache miss for google.com IN A
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Transaction 24663 for <google.com IN A> scope dns on eno1/*.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Using feature level UDP+EDNS0 for transaction 24663.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Using DNS server 192.168.10.25 for transaction 24663.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Sending query packet with id 24663.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Freeing transaction 27482.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Freeing transaction 24663.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Sending response packet with id 50950 on interface 1/AF_INET.
Apr 23 16:45:48 tcfe01 systemd-resolved[26041]: Processing query...
今天我使用的是我的(旧)康柏笔记本电脑,Lubuntu 经常安装在分区上。突然,它停止响应任何输入,所以我(错误地?)决定重新启动系统。
在引导过程结束时显示 Lubuntu 徽标后,屏幕变黑,线条
Stopping System V runlevel compatibility
显示和以下两条消息
Asking for cache data failed
和
Assuming drive cache: write through
反复出现。我的笔记本电脑卡在那里,操作系统没有启动。
今天下午我一直在互联网上寻找一些建议,尤其是在 askubuntu.com 上,但很遗憾似乎没有人遇到完全相同类型的错误。我仍在努力。如果您有任何想法,请回复此帖子。
非常感谢
我最近将服务器的 RAM 升级到了 16 GB。服务器本身不需要太多 RAM,但 Ubuntu 似乎为缓存保留了相当多的空间。
这样做free - m
会导致:
total used free shared buff/cache available
Mem: 15498 1811 7478 31 6208 13326
Swap: 3401 0 3401
它连续运行 2 个月时使用不到 2 GB,但如果我理解正确,它会保留 6 GB。我还计划在它上面运行一个 Minecraft 服务器,它需要 8 GB RAM,而只有 7 GB “免费”。
因此,问题是:我可以限制为缓存保留的数量,以便我可以免费使用吗?