我想在带有 Ubuntu 16.04 映像的docker环境中安装certbot:
例如:
docker run -it ubuntu:16.04 /bin/bash
Run Code Online (Sandbox Code Playgroud)
当我在容器内时,安装 certbot 的最直接方法不起作用,因为它需要用户干预:
apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y -u ppa:certbot/certbot && \
apt-get install -y certbot
Run Code Online (Sandbox Code Playgroud)
问题是tzdata,这个交互式对话框停止了:
Extracting templates from packages: 100%
Preconfiguring packages ...
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they …Run Code Online (Sandbox Code Playgroud) sudo apt-get update 有时会卡住:
...
99% [Waiting for headers]
Run Code Online (Sandbox Code Playgroud)
这似乎是一个常见问题,可能有多种原因。例如,在一台机器上,这是因为我使用了错误的代理服务器配置。
有没有办法系统地分析问题?它查看了man apt-get但找不到任何提供更多信息来隔离问题的选项。除了apt-get我可以用来获得更多见解之外,还有其他工具吗?
让我们假设您刚刚通过 SSH 登录到运行 Ubuntu 的服务器。
是否有一个简单的命令来确定是否启用了无人值守升级并自动安装安全关键更新?
libasan(gcc 和 clang 的地址清理器)有许多类似的命名包:
$ apt-cache search libasan | grep -v dbg | grep -v cross
libasan2 - AddressSanitizer -- a fast memory error detector
libasan3 - AddressSanitizer -- a fast memory error detector
libasan4 - AddressSanitizer -- a fast memory error detector
libasan0 - AddressSanitizer -- a fast memory error detector
Run Code Online (Sandbox Code Playgroud)
(输出来自 Ubuntu 17.10。Ubuntu 18.04 也有libasan5。)
我有一个(以前有效的)OpenResty logrotate 设置,它是我从之前的 Ubuntu 18.04 安装中获取的。然而 logrotate.service 现在失败并出现此错误......
\nerror: error renaming /usr/local/openresty/nginx/logs/access.log.60.zst\nto /usr/local/openresty/nginx/logs/access.log.61.zst: Read-only file system\nRun Code Online (Sandbox Code Playgroud)\n...我很难理解为什么。新机器正在运行 Ubuntu 20.04,但我不明白为什么这会在这种情况下产生影响。
\n首先,这是配置:
\n$ cat /etc/logrotate.d/custom-openresty\n\n/usr/local/openresty/nginx/logs/access.log\n/usr/local/openresty/nginx/logs/error.log\n{\n daily\n rotate 60\n maxsize 1G\n missingok\n notifempty\n compress\n compresscmd /usr/bin/zstd\n uncompresscmd /usr/bin/unzstd\n compressoptions -9 --long -T1\n compressext .zst\n delaycompress\n sharedscripts\n postrotate\n test ! -f /usr/local/openresty/nginx/logs/nginx.pid || kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`\n endscript\n}\nRun Code Online (Sandbox Code Playgroud)\n/etc/logrotate.conf没有改变,看起来像这样:
\n# see "man logrotate" for details\n# rotate log files weekly\nweekly\n\n# use the adm group by default, since this …Run Code Online (Sandbox Code Playgroud) apt ×2
20.04 ×1
automation ×1
clang ×1
docker ×1
gcc ×1
letsencrypt ×1
logrotate ×1
systemd ×1