在全新的 Debian 服务器上运行此命令安全吗?
aptitude -y full-upgrade
Run Code Online (Sandbox Code Playgroud)
该命令来自http://www.linode.com/stackscripts/view/?StackScriptID=1
相关说明,aptitude update与apt-get update有何不同?
刚刚在云中购买了一个全新的虚拟服务器 Ubuntu 14.04。
我使用 apt-get update 更新了我的软件包。
尝试安装 node js 时出现问题。我遵循了本指南:https : //github.com/joyent/node/wiki/installing-node.js-via-package-manager
当我跑步时,sudo apt-get install -y nodejs我得到了这个:
user@server sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may …Run Code Online (Sandbox Code Playgroud) 我在 2 个 Debian 服务器上设置了 master-master 复制,它们复制了所有内容,包括 mysql 数据库本身(以便新用户等也复制)。这通常非常有效,除了大多数(如果不是全部)对 mysql 的 apt 升级都涉及对 mysql 数据库架构的一些更改,这会导致复制错误停止复制。最终,我总是需要通过跳过每一边的错误语句来手动修复。这总是很耗时,而且我担心我可能会在手动操作时出错(跳过太多语句、错误输入 CHANGE MASTER 详细信息等)。
我可以做些什么来确保将来对 MySQL 的 apt-get 更新能够顺利处理而不会导致复制问题?肯定有一个完善的最佳实践吗?
我有一台在 Debian Wheezy 上运行的服务器。
它的 apt 源文件具有以下配置:
deb http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
# wheezy-updates, previously known as 'volatile'
deb http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
Run Code Online (Sandbox Code Playgroud)
当我尝试更新时,我收到官方 Debian 存储库的 GPG 错误:
root@osgb:~# apt-get clean
root@osgb:~# apt-get update
Get:1 http://security.debian.org wheezy/updates Release.gpg
Get:2 http://ftp.uk.debian.org wheezy Release.gpg
Get:3 http://ftp.uk.debian.org wheezy-updates Release.gpg
Get:4 http://security.debian.org wheezy/updates Release
Ign http://security.debian.org wheezy/updates Release …Run Code Online (Sandbox Code Playgroud) 因此,为了防止在安装 dpkg 后出现控制台 UI(newt、snack、dialog)提示,您必须执行以下操作:
debconf-set-selections <<< 'mysql-server mysql-server/root_password password password'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password verify_password'
apt-get -y install mysql-server
Run Code Online (Sandbox Code Playgroud)
谢谢。
笔记
看起来设置这个变量是采用默认值的解决方案:
DEBIAN_FRONTEND=noninteractive
Run Code Online (Sandbox Code Playgroud) 我正在为一些自定义 Raspberry Pi 代码托管一个私有 Debian 存储库。我最初在 Raspbian Jessie(版本 8)上构建了该软件,生成了一个 GPG 密钥,我用它来签署存储库,并sudo apt-key add ...在所有设备上运行,以确保他们能够验证我的存储库。这工作正常,直到最近我添加了一些运行 Raspbian Stretch(版本 9)的新设备。即使我向它们添加了完全相同的 GPG 密钥,以下是我运行时看到的输出sudo apt-get update:
W: GPG error: http://url.of.private.repo stable Release: The following signatures were invalid: 95F9B44CE35F40B759D59C2A77E4184C595493B1
W: The repository 'http://url.of.private.repo stable Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)
但是,这只发生在较新的盒子上。在仍在运行 Jessie 的 Pis 上,我可以运行sudo apt-get …
问题:
我需要一种方法来在我的 Debian 系统上安装某些软件包的特定固定版本。snapshot.debian.org似乎提供了一种方法来执行此操作,但是即使在向我的 apt-sources 添加快照后,我也无法apt-get install在该快照存档中使用某些特定版本的软件包。
问题:
从 Debian 快照存档安装特定软件包版本的官方或“正确”方式是什么?
背景和我尝试过的:
让我们使用 Debian8 Jessie 和 3.16.x 内核二进制文件作为我们的示例。在撰写本文时,Jessie 发布的内核是 3.16.43-2+deb8u5。说我要安装 3.16.43-2+deb8u4。
我首先在 debian 快照档案中搜索我想要的版本 ( http://snapshot.debian.org/binary/linux-image-3.16.0-4-amd64/ ),然后单击我想要的内核的确切版本我正在寻找,这让我进入http://snapshot.debian.org/package/linux/3.16.43-2%2Bdeb8u4/#linux-image-3.16.0-4-amd64_3.16.43-2:2b: deb8u4
从那里,我可以看到该软件包是“在 2017-09-20 22:12:21 上看到的 debian-security”和“在 2017-10-08 16:31:52 上看到的 debian”。我决定使用前者并选择 debian-security snapshot 20170920T221221Z。
按照snapshot.debian.org首页上的说明,我将以下内容添加到我的 /etc/apt/sources.list 中:
deb http://snapshot.debian.org/archive/debian-security/20170920T221221Z/ jessie/updates main
deb src http://snapshot.debian.org/archive/debian-security/20170920T221221Z/ jessie/updates main
Run Code Online (Sandbox Code Playgroud)
然后我运行apt-get -o Acquire::Check-Valid-Until=false update并看到更新(似乎)成功完成。
我认为这将允许我现在安装所需版本的内核,但 apt 只知道两个安装候选,3.16.43-2+deb8u2 和 3.16.43-2+deb8u5。没有 +deb8u4 的迹象:
# apt-cache madison linux-image-3.16.0-4-amd64
linux-image-3.16.0-4-amd64 | 3.16.43-2+deb8u5 …Run Code Online (Sandbox Code Playgroud) apt我在官方 Ubuntu 映像 ( ) 上遇到各种不一致的错误ami-83e769fb。我使用 Packer 构建 AMI,大约 40% 的情况下会失败。重新运行脚本成功。
我的脚本运行:
sudo apt-get clean all
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
在安装任何软件包之前。
有时我会收到此错误:
amazon-ebs: W: GPG error: http://archive.ubuntu.com/ubuntu artful InRelease: Splitting up /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_artful_InRelease into data and signature failed
amazon-ebs: E: The repository 'http://archive.ubuntu.com/ubuntu artful InRelease' is not signed.
Run Code Online (Sandbox Code Playgroud)
有时apt-get update会击中http://us-west-2.ec2.archive.ubuntu.com/ubuntu……有时却不会。
其他时候软件包丢失(如apache2或python3)。
我不明白为什么这种行为不一致。
如何让apt-get update官方 Ubuntu AMI 持续工作?
所以我在 Ubuntu 18.04.2 中遇到了 Tomcat 9 的问题。Tomcat 8 运行良好,它将 Java 堆栈跟踪记录到 /var/log/catalina.out 中。不幸的是,Tomcat 9 仅通过 apt 使用默认的 Ubuntu 配置记录 GET 和 POST 请求。
我查了一下,似乎有几个线程如何修复,最近的是这个:tomcat 9 中的 catalina.out 在哪里?- 但问题是我的 catalina.sh 看起来与此答案中显示的文件非常不同。
我的 catalina.sh 中相似(但有很大不同)的部分如下。出于某种原因,在 apt 安装中,它看起来不是想要启动 catalina,而是试图找到它的 PID?:
if [ -z "$CATALINA_OUT" ] ; then
CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
fi
[...]
elif [ "$1" = "start" ] ; then
if [ ! -z "$CATALINA_PID" ]; then
if [ -f "$CATALINA_PID" ]; then
if [ -s "$CATALINA_PID" ]; then
echo "Existing PID …Run Code Online (Sandbox Code Playgroud) 在 GCP 中启动一些小型虚拟机,并认为我会给 Ubuntu 20.04 LTS 最小的尝试。执行“apt update; apt upgrade”后,我可以安装像 Apache 这样的软件包,但使用 PIP 的运气为零:
root@ubuntu-rr58:/home/me# apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
Run Code Online (Sandbox Code Playgroud)
我已经验证了 Universe、Multiverse 和 Restricted 存储库可用:
root@ubuntu-rr58:~# grep ^deb /etc/apt/sources.list
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu focal-security …Run Code Online (Sandbox Code Playgroud) apt ×10
debian ×5
dpkg ×2
gpg ×2
ubuntu ×2
amazon-ami ×1
dialog ×1
linux ×1
mysql ×1
node.js ×1
packer ×1
pip ×1
python ×1
raspbian ×1
repository ×1
tomcat ×1
tomcat9 ×1
ubuntu-14.04 ×1
ubuntu-18.04 ×1
ubuntu-20.04 ×1