我刚刚从我的服务器(Ubuntu 11.04)完全卸载了 nginx 1.0.6 使用
apt-get remove nginx
rm -rf /etc/nginx/
rm -rf /usr/sbin/nginx
rm /usr/share/man/man1/nginx.1.gz
apt-get remove nginx*
Run Code Online (Sandbox Code Playgroud)
现在我想再次安装它,但是在启动 nginx 时,我收到如下错误:
重启 nginx: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
然后我放置了我自己的conf文件,然后我收到一个新错误:
重新启动 nginx: nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12
现在好像apt-get install nginx没有完全安装好,我清空了apt-get缓存,好像没有用。如何使用 apt-get 获得 nginx的完整安装?
我看到很多关于这个的问题,但我的似乎有点不同。
这是我收到的:
/etc/cron.weekly/apt-xapian-index:
FATAL -> Failed to fork.
run-parts: /etc/cron.weekly/apt-xapian-index exited with return code 100
Run Code Online (Sandbox Code Playgroud)
和
/etc/cron.daily/apt:
FATAL -> Failed to fork.
Run Code Online (Sandbox Code Playgroud)
和
/etc/cron.daily/apt:
DB Update failed, database locked
Run Code Online (Sandbox Code Playgroud)
我总是有至少 600 MB 的可用 RAM。如果我尝试手动运行sudo /etc/cron.daily/apt什么也不会发生..shell 挂起。
可能是什么问题呢?
编辑: Ubuntu 服务器 14.04
我在 Debian Wheezy 上有一台旧的测试机器,我现在无法真正更新。
Debian Wheezy 存储库已于 2 月归档。所以我想提前,并更新我/etc/apt/sources.list的
deb http://ftp.fr.debian.org/debian wheezy main
deb http://security.debian.org/ wheezy/updates main
deb http://ftp.fr.debian.org/debian wheezy-updates main
Run Code Online (Sandbox Code Playgroud)
到
deb http://archive.debian.org/debian wheezy main
deb http://security.debian.org/ wheezy/updates main
deb http://archive.debian.org/debian wheezy-updates main
Run Code Online (Sandbox Code Playgroud)
但是,在运行时apt-get update,我收到此错误:
# apt-get update
<snip>
Err http://archive.debian.org wheezy-updates/main i386 Packages
404 Not Found [IP : 193.62.202.28 80]
Run Code Online (Sandbox Code Playgroud)
其他存储库正在更新,没有问题。
我错过了什么吗?
我正在尝试在我的 Ubuntu 18.04 上安装 WordPress + LEMP。我对安装 Apache 没有兴趣。为什么 PHP 安装程序假定我这样做?
我在运行时遇到以下错误apt update,导致我无法更新 Ubuntu 服务器。
~$ sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu impish-security InRelease
Err:2 http://security.ubuntu.com/ubuntu impish-security Release
404 Not Found [IP: 91.189.91.39 80]
Hit:3 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu impish InRelease
Ign:4 http://nova.clouds.archive.ubuntu.com/ubuntu impish InRelease
Ign:5 http://nova.clouds.archive.ubuntu.com/ubuntu impish-updates InRelease
Ign:6 http://nova.clouds.archive.ubuntu.com/ubuntu impish-backports InRelease
Err:7 http://nova.clouds.archive.ubuntu.com/ubuntu impish Release
404 Not Found [IP: 185.125.190.41 80]
Err:8 http://nova.clouds.archive.ubuntu.com/ubuntu impish-updates Release
404 Not Found [IP: 185.125.190.41 80]
Err:9 http://nova.clouds.archive.ubuntu.com/ubuntu impish-backports Release
404 Not Found [IP: 185.125.190.41 80]
Get:12 https://download.docker.com/linux/ubuntu impish InRelease [48.9 kB]
Get:10 https://packagecloud.io/netdata/netdata-edge/ubuntu impish InRelease …Run Code Online (Sandbox Code Playgroud) 使用 yum 很简单:yum list *xxx*但这不适用于apt-get.
我怎样才能进行这样的搜索?
另外,我如何查看哪个包提供了特定的命令?
Debian 中的一些(大多数?)软件包有标签。例如:
=# apt-cache show squirrelmail | perl -lne 'print if /^Tag:/.../^\S/'
Tag: implemented-in::php, interface::web, mail::imap, mail::smtp,
mail::user-agent, network::server, protocol::http, protocol::imap,
protocol::smtp, role::program, scope::application, use::browsing,
use::editing, use::searching, use::transmission, use::viewing,
web::TODO, web::application, works-with::mail
Section: web
Run Code Online (Sandbox Code Playgroud)
但是,我找不到列出所有带有给定标签的包的方法。是否可以?
我有两个包,每个包都创建 /usr/bin/ffprobe。其中一个是来自 Deb Multimedia 存储库的 ffmpeg,而另一个是从源代码构建的 ffmbc 0.7-rc5。手动安装是关键业务,我们过去只在需要的地方从源代码安装它。我只能假设它会破坏 ffmpeg 文件,而且从来没有任何不良影响。
从理论上讲,我们的 ffmbc 包覆盖 ffmpeg 包中的文件应该是可以接受的。缺点是 ffmpeg 的更新会覆盖 ffmbc 二进制文件。有没有简单的方法来调和这个?
apt-get install在非交互式 SSH 会话中运行时,该会话永远不会关闭。例子:
ssh user@target "sudo apt-get -y install my_package"
Run Code Online (Sandbox Code Playgroud)
在my_package没有得到正确安装,但SSH会话刚悬开放。
是否有任何标志可以通过 SSH 开始apt-get工作?
远程安装用于在集成服务器上自动部署包。一旦我们将一些代码更改推送到存储库,作业就会拉入代码、构建包并在集成中部署它以检查一切是否正常(就部署而言)。
apt-get update干净利落地关闭。请注意,这apt-get update不是交互式的,而是apt-get install。这可能表明交互性是一个问题。ssh user@target "sudo apt-get install my_package && echo Hello"永远不会到达的命令echo。debconf 抱怨它找不到一个好的前端(Display、Readline),它回退到 Teletype(虽然 Readline 可用)。-tSSH传递强制 TTY 没有帮助。都没有DEBIAN_FRONTEND=noninteractive。推荐升级路径,TL;DR:
备份数据,然后
apt update
apt upgrade
apt dist-upgrade
reboot
Run Code Online (Sandbox Code Playgroud)
还要禁用所有非主流包(如果有)。
然后为新发行版准备 APT:
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*
Run Code Online (Sandbox Code Playgroud)
第一个命令显示错误:
apt update
...
Err:6 http://security.debian.org/debian-security bullseye/updates Release
404 Not Found
Reading package lists... Done
E: The repository 'http://security.debian.org/debian-security bullseye/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)