AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-674

Tim's questions

Martin Hope
Tim
Asked: 2023-12-01 19:22:49 +0800 CST

为什么一个用户不可能将特洛伊木马注入到可能被其他用户使用的包中?

  • 5

https://nixos.org/manual/nix/stable/introduction.html说

多用户支持

Nix 具有多用户支持。这意味着非特权用户可以安全地安装软件。每个用户都可以有不同的配置文件,即 Nix 存储中出现在用户路径中的一组包。如果用户安装了其他用户之前已经安装过的软件包,则不会再次构建或下载该软件包。同时,一个用户不可能将特洛伊木马注入到另一个用户可能使用的包中。

为什么一个用户不可能将特洛伊木马注入到可能被其他用户使用的包中?

前面的句子是说某个包可能是两个应用程序共享的依赖项吗?

package-management
  • 1 个回答
  • 39 Views
Martin Hope
Tim
Asked: 2022-03-25 15:40:32 +0800 CST

目录颜色不起作用

  • -1

在此处输入图像描述

在此处输入图像描述

我通过在路径名末尾按 TAB 键来使用 bash 的自动完成功能。我也在使用ls(alias ls='ls --color=auto'in ~/.bashrc)。我无法识别颜色中的文件名。(只有我一个人吗?如果我是色盲,请告诉我。)

我曾经通过遵循https://unix.stackexchange.com/a/94508/来解决 Ubuntu 中的问题,编辑 ~/.dircolor 并运行:

$ eval "$(/usr/bin/env dircolors ~/.dircolor)"

但这并没有在上面的屏幕截图中显示任何区别。我能做些什么来解决上述问题?(我在 NixOS 中,但可能没关系。)

以下命令的输出是否正常:

$ dircolors ~/.dircolor
LS_COLORS='';
export LS_COLORS

?

谢谢。

~/.dircolor,我从 Ubuntu 复制的:

# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM Eterm
TERM ansi
TERM color-xterm
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM console
TERM cygwin
TERM dtterm
TERM eterm-color
TERM gnome
TERM gnome-256color
TERM jfbterm
TERM konsole
TERM kterm
TERM linux
TERM linux-c
TERM mach-color
TERM mlterm
TERM putty
TERM rxvt
TERM rxvt-256color
TERM rxvt-cygwin
TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM rxvt-unicode-256color
TERM rxvt-unicode256
TERM screen
TERM screen-256color
TERM screen-256color-bce
TERM screen-bce
TERM screen-w
TERM screen.Eterm
TERM screen.rxvt
TERM screen.linux
TERM st
TERM st-256color
TERM terminator
TERM vt100
TERM xterm
TERM xterm-16color
TERM xterm-256color
TERM xterm-88color
TERM xterm-color
TERM xterm-debian
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # regular file: use no color at all
RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
 # numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
# OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
OTHER_WRITABLE 34;43 # dir that is other-writable (o+w) and not sticky # my edit. the original uses 42 green bkg, which hides 34 blue text, I choose 43 yellow for contrasting with blue text
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
# Or if you want to colorize scripts even if they do not have the
# executable bit actually set.
#.sh 01;32
#.csh 01;32
 # archives or compressed (bright red)
.tar 01;31
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.lzma 01;31
.tlz 01;31
.txz 01;31
.zip 01;31
.z 01;31
.Z 01;31
.dz 01;31
.gz 01;31
.lz 01;31
.xz 01;31
.bz2 01;31
.bz 01;31
.tbz 01;31
.tbz2 01;31
.tz 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
.war 01;31
.ear 01;31
.sar 01;31
.rar 01;31
.ace 01;31
.zoo 01;31
.cpio 01;31
.7z 01;31
.rz 01;31
# image formats
.jpg 01;35
.jpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.svg 01;35
.svgz 01;35
.mng 01;35
.pcx 01;35
.mov 01;35
.mpg 01;35
.mpeg 01;35
.m2v 01;35
.mkv 01;35
.webm 01;35
.ogm 01;35
.mp4 01;35
.m4v 01;35
.mp4v 01;35
.vob 01;35
.qt 01;35
.nuv 01;35
.wmv 01;35
.asf 01;35
.rm 01;35
.rmvb 01;35
.flc 01;35
.avi 01;35
.fli 01;35
.flv 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
.yuv 01;35
.cgm 01;35
.emf 01;35
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axv 01;35
.anx 01;35
.ogv 01;35
.ogx 01;35
# audio formats
.aac 00;36
.au 00;36
.flac 00;36
.mid 00;36
.midi 00;36
.mka 00;36
.mp3 00;36
.mpc 00;36
.ogg 00;36
.ra 00;36
.wav 00;36
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axa 00;36
.oga 00;36
.spx 00;36
.xspf 00;36
bash ls
  • 1 个回答
  • 301 Views
Martin Hope
Tim
Asked: 2019-12-14 13:04:42 +0800 CST

为什么通过`sudo rsync`传输文件到另一台计算机需要目标计算机的root密码?[复制]

  • -3
这个问题在这里已经有了答案:
如何在本地使用 rsync(使用无密码 ssh)和 sudo? (1 个回答)
2年前关闭。

我正在尝试将目录传输到另一台计算机

$ rsync -a --delete --stats -h wget 'olive:/tmp'

Number of files: 5 (reg: 4, dir: 1)
Number of created files: 5 (reg: 4, dir: 1)
Number of deleted files: 0
Number of regular files transferred: 4
Total file size: 12.94K bytes
Total transferred file size: 12.94K bytes
Literal data: 12.94K bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 13.31K
Total bytes received: 103

sent 13.31K bytes  received 103 bytes  5.36K bytes/sec
total size is 12.94K  speedup is 0.96

如果源目录包含一些需要本地 root 权限的文件,我添加sudo. 这是对的吗?

但是为什么它一直要求我输入另一台计算机的 root 密码?我提供了目的地根的密码,但它一直在要求它。

$ sudo rsync -a --delete --stats -h wget 'olive:/tmp'
root@olive's password: 
Permission denied, please try again.
root@olive's password: 

如果我想复制需要本地root权限的源文件怎么办?

我尝试了建议的副本,但没有用

$ sudo rsync -e 'ssh -i /home/t/.ssh/id_rsa' -a --delete --stats -h wget 'olive:/tmp'
root@olive's password: 
Permission denied, please try again.
root@olive's password: 

谢谢。

sudo rsync
  • 2 个回答
  • 397 Views
Martin Hope
Tim
Asked: 2019-12-13 14:35:11 +0800 CST

滚动升级/部署葡萄酒?

  • 1

当我使用 wine 在 Lubuntu 18.04 上运行一些 Windows exe 程序文件时,我更新和升级可能已经更新了 wine。

当我仍在运行 Windows exe 程序时,我尝试运行另一个 Windows exe 程序,

$ wine another.exe
wine client error:0: version mismatch 547/571.
Your wineserver binary was not upgraded correctly,
or you have an older one somewhere in your PATH.
Or maybe the wrong wineserver is still running?

我不想退出正在运行的 Windows exe 程序。这是否意味着我不应该杀死正在运行的葡萄酒进程?我该怎么做才能启动其他窗口 exe 程序?

这是部署中的常见问题:滚动升级/部署吗?

谢谢。

upgrade wine
  • 1 个回答
  • 105 Views
Martin Hope
Tim
Asked: 2019-11-26 10:35:34 +0800 CST

为什么这个 wget 命令无法下载这个文件?[复制]

  • -4
这个问题在这里已经有了答案:
通过 wget 访问谷歌翻译 3 个答案
2年前关闭。

我想知道为什么下面的命令无法下载pdf文件,而将URL粘贴到浏览器的地址栏中可以?(我试图从这个问题中了解一些关于 HTTP、Web 服务或 Web 应用程序的知识)

我应该如何使用 wget 下载 pdf 文件?

谢谢。

$ wget https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598&rep=rep1&type=pdf
[1] 5696
[2] 5697

Redirecting output to ‘wget-log.1’.
[2]+  Done                    rep=rep1

$ cat wget-log
--2019-11-25 13:30:42--  https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598
Resolving citeseerx.ist.psu.edu (citeseerx.ist.psu.edu)... 130.203.136.95
Connecting to citeseerx.ist.psu.edu (citeseerx.ist.psu.edu)|130.203.136.95|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5641 (5.5K) [text/html]
Saving to: ‘download?doi=10.1.1.99.598’

download?doi=10.1.1.99.598                   100%[============================================================================================>]   5.51K  --.-KB/s    in 0s      

2019-11-25 13:30:42 (453 MB/s) - ‘download?doi=10.1.1.99.598’ saved [5641/5641]

[1]+  Done                    wget https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598
wget download
  • 1 个回答
  • 1575 Views
Martin Hope
Tim
Asked: 2019-11-23 04:14:16 +0800 CST

如何使用公钥身份验证访问 android 上的 ssh 服务器?

  • 0

我的 android 4.4.2(它很旧但无法升级)手机通过 SimpleSSHD 应用程序运行 SSH 服务器。它在每次登录时都会生成不同的随机密码,所以对于我作为客户端用户来说非常不方便。所以我想使用公钥认证。

以前我已经生成了一对公钥和私钥来访问 SSH 服务器。我想重复使用密钥对是可以的,所以我将公钥文件复制到android手机:

$ ssh-copy-id -p 2222 192.168.1.87
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/t/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password: 
restorecon: invalid option -- F
usage:  restorecon [-nrRv] pathname...

之后,我仍然需要输入服务器生成的随机密码才能登录。

将公钥文件复制到android手机不起作用吗?

公钥文件应该放在安卓手机的哪个目录下?

谢谢。

ssh android
  • 1 个回答
  • 3463 Views
Martin Hope
Tim
Asked: 2019-04-20 18:15:53 +0800 CST

我们可以在 pdf 文件中搜索包含多个单词且不按特定顺序排列的页面吗?

  • -2

我想在一个 pdf 文件中搜索所有页面,每个页面都包含几个给定的单词,没有特定的顺序。例如,我想查找所有包含“hello”和“world”的页面,没有特定的顺序。

我不确定是否pdfgrep 可以做到。

我正在尝试做一些类似于我们如何在谷歌图书中显示的书中搜索几个单词的事情。

谢谢。

search pdf
  • 2 个回答
  • 149 Views
Martin Hope
Tim
Asked: 2019-04-14 14:16:13 +0800 CST

jps 进程是 JVM 进程吗?

  • -4

在 Ubuntu 上,man jps说

jps - 列出目标系统上已检测的 Java 虚拟机 (JVM)。

“仪表化的 Java 虚拟机”是什么意思?

$ jps -v
29584 Jps -Dapplication.home=/usr/lib/jvm/java-11-openjdk-amd64 -Xms8m -Djdk.module.main=jdk.jcmd

根据定义,jps 进程是 JVM 进程吗?

jps 是一个 ELF 文件,而不是从 Java 程序编译的 JVM 字节码程序:

$ file /usr/lib/jvm/java-11-openjdk-amd64/bin/jps
/usr/lib/jvm/java-11-openjdk-amd64/bin/jps: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=3f48c70ab711b493ee793c92c19b3a884896bb4d, stripped

谢谢。

java
  • 2 个回答
  • 1273 Views
Martin Hope
Tim
Asked: 2019-04-14 07:25:25 +0800 CST

如何通过 `ps` 列出有关线程/LWP 的信息?

  • 2

如何列出有关线程/LWP 的信息ps?

为什么我不能简单地这样做:

$ ps 10173
  PID TTY      STAT   TIME COMMAND
$ ps -L 10173
  PID   LWP TTY      STAT   TIME COMMAND

我能做的最好的

$ ps -eL  | grep 10173
10172 10173 pts/8    00:00:00 java

这是一个 LWP,因为

$ ps -L 10172
  PID   LWP TTY      STAT   TIME COMMAND
10172 10172 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10173 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10174 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10175 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10176 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10177 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10178 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10179 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10180 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10181 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10182 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10183 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10184 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10185 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10186 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10187 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10188 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10189 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main
10172 10190 pts/8    Tl     0:00 java -cp target com.mycompany.app.Main

和

$ pstree -pau -l -G -s 10172
systemd,1 splash
  └─lxterminal,3194,t
      └─bash,12150
          └─java,10172 -cp target com.mycompany.app.Main
              ├─{java},10173
              ├─{java},10174
              ├─{java},10175
              ├─{java},10176
              ├─{java},10177
              ├─{java},10178
              ├─{java},10179
              ├─{java},10180
              ├─{java},10181
              ├─{java},10182
              ├─{java},10183
              ├─{java},10184
              ├─{java},10185
              ├─{java},10186
              ├─{java},10187
              ├─{java},10188
              ├─{java},10189
              └─{java},10190

谢谢。

process ps
  • 2 个回答
  • 6009 Views
Martin Hope
Tim
Asked: 2019-04-12 12:30:13 +0800 CST

tar可以解压jar文件吗

  • 5

来自https://dzone.com/articles/java-8-how-to-create-executable-fatjar-without-ide

tar xf ExecutableOne.jar

但为什么我会得到

$ tar xf ExecutableOne.jar 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

谢谢。

tar java
  • 3 个回答
  • 12023 Views
Martin Hope
Tim
Asked: 2019-04-07 05:35:04 +0800 CST

`ps f` 显示了哪些进程?

  • -5

来自 procps-ng 的 ps

$ ps f | wc -l
225
$ ps -e | wc -l
410
$ ps | wc -l
4

ps -e显示所有进程,并且ps仅显示当前终端作为控制终端的进程。显示了哪些过程ps f?谢谢。

ps
  • 3 个回答
  • 5531 Views
Martin Hope
Tim
Asked: 2019-04-06 08:37:37 +0800 CST

为什么 CentOS Docker 容器说它是 Ubuntu?

  • 1

我正在尝试验证为我的 Ubuntu 选择 Docker 容器映像文件时,我需要在它们之间匹配什么?

在 Lubuntu 上,一个 CentOS 容器说它是 CentOS,由

$ sudo docker run centos bash -c "cat /etc/*-release "
CentOS Linux release 7.6.1810 (Core) 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.6.1810 (Core) 
CentOS Linux release 7.6.1810 (Core) 

但也说它和主机是同一个 Ubuntu:

$ sudo docker run centos bash -c "cat /proc/version"
Linux version 4.15.0-46-generic (buildd@lgw01-amd64-038) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019


$ cat /proc/version
Linux version 4.15.0-46-generic (buildd@lgw01-amd64-038) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019
  1. 我想知道为什么这两个命令在操作系统发行版和内核版本上有所不同?

  2. 容器是否与其主机共享相同的内核?如果是,它们的内核版本应该相同吗?在为我的 Ubuntu 选择 Docker 容器镜像文件时,我需要在它们之间匹配什么?说“你不需要匹配发行版或内核版本。”

kernel docker
  • 2 个回答
  • 2503 Views
Martin Hope
Tim
Asked: 2019-04-05 22:37:40 +0800 CST

我应该如何使用`docker rm -v`?

  • 1

手册页docker rm说

删除容器及其卷

$ docker rm -v redis
redis

此命令将删除容器和与之关联的所有卷。请注意,如果使用 name 指定卷,则不会将其删除。

“使用名称指定卷”是什么意思?这样的卷不是与要删除的容器相关联的卷吗?

移除容器并有选择地移除卷

$ docker create -v awesome:/foo -v /bar --name hello redis
hello
$ docker rm -v hello

在此示例中,/foo 的音量将保持不变,但 /bar 的音量将被删除。同样的行为也适用于使用 --volumes-from 继承的卷。

为什么“/foo 的音量将保持不变,但 /bar 的音量将被删除”?

谢谢。

docker
  • 2 个回答
  • 148 Views
Martin Hope
Tim
Asked: 2019-04-04 04:21:15 +0800 CST

Docker Machine是否仅在dockerd在虚拟机而不是在实际机器中运行时使用?

  • 1

https://docs.docker.com/machine/overview/#whats-the-difference-between-docker-engine-and-docker-machine说

Docker Machine 是一种用于配置和管理Dockerized 主机(带有 Docker 引擎的主机)的工具。通常,您在本地系统上安装 Docker Machine。

Docker Machine 有自己的命令行客户端docker-machine 和 Docker Engine 客户端, docker.

您可以使用 Machine 在一个或多个虚拟系统上安装 Docker Engine 。这些虚拟系统可以是本地的(例如当您使用 Machine 在 Mac 或 Windows 上的 VirtualBox 中安装和运行 Docker Engine 时)或远程的(例如当您使用 Machine 在云提供商上配置 Dockerized 主机时)。Dockerized 主机本身可以被认为是,有时也被称为托管的“机器”。

在此处输入图像描述

“dockerized hosts”总是虚拟机,而不是实际机器吗?

Docker Machine ( docker-machine) 是否仅在 dockerd 在虚拟机中运行而不在实际机器中运行时使用?

谢谢。

docker
  • 1 个回答
  • 171 Views
Martin Hope
Tim
Asked: 2019-03-31 17:34:40 +0800 CST

Docker创建的虚拟机可以在没有Docker的情况下以独立的方式使用吗?

  • -3

Docker 可以创建虚拟机用作 swarms 中的节点。

Docker 创建的虚拟机可以在没有 Docker 的情况下以独立的方式使用,还是只能由 Docker 使用?

比如Docker用VirtualBox驱动创建的虚拟机可以和VirtualBox直接创建的虚拟机一样使用,还是只能由Docker使用?

谢谢。

docker virtual-machine
  • 1 个回答
  • 45 Views
Martin Hope
Tim
Asked: 2019-03-31 17:31:26 +0800 CST

Docker 是否适用于 VirtualBox 但不适用于 KVM/QEMU?

  • -7

Docker 可以创建虚拟机用作 swarms 中的节点。

机器驱动程序包含VirualBox 但没有 KVM/QEMU。这是否意味着

  • KVM/QEMU 创建的虚拟机不能作为 Docker swarm 中的节点?
  • Docker 可以与 VirtualBox 一起工作,但不能与 KVM/QEMU 一起工作?(如果是,这让我感到惊讶,因为 Linux 内核原生支持 Docker 和 KVM,而 VirtualBox 似乎不那么支持。Docker 是使用 VirtualBox 而不是 KVM/QEMU 的理由吗?)

如果 Docker 可以创建 KVM/QEMU 类型的虚拟机,那么要为docker-machine's指定--driver什么?

谢谢。

virtualbox virtual-machine
  • 1 个回答
  • 1398 Views
Martin Hope
Tim
Asked: 2019-03-31 14:13:05 +0800 CST

`docker container rm` 和 `docker container kill` 是否有效地实现了相同的效果?

  • 8

从手册页:

docker container rm将从主机节点中删除一个或多个容器。可以使用容器名称或 ID。这不会删除图像。

docker container kill:每个指定容器内的主进程将被发送 SIGKILL,或任何使用选项 --signal 指定的信号。

容器是图像的运行实例吗?所以这样做 docker container rm并docker container kill有效地实现相同:容器将停止存在?

他们有什么区别?

什么是“容器内的主要过程”?

容器是否完全作为主机中的进程运行?

谢谢。

docker
  • 2 个回答
  • 8023 Views
Martin Hope
Tim
Asked: 2019-03-31 08:37:31 +0800 CST

标记 Docker 映像是否会创建映像的副本?

  • -1

标记 Docker 映像是否会创建映像的副本?

在我看来,标签本身不应该。但是下面的命令似乎暗示了这一点。

谢谢。

$ docker image ls
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
friendlyhello            latest              d9e555c53008        3 minutes ago       195MB
python                   2.7-slim            1c7128a655f6        5 days ago          183MB

$ docker tag friendlyhello gordon/get-started:part2

$ docker image ls
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
friendlyhello            latest              d9e555c53008        3 minutes ago       195MB
gordon/get-started         part2               d9e555c53008        3 minutes ago       195MB
python                   2.7-slim            1c7128a655f6        5 days ago          183MB
docker
  • 1 个回答
  • 385 Views
Martin Hope
Tim
Asked: 2019-03-28 17:49:35 +0800 CST

如何在 Docker Ubuntu 容器中安装软件包?

  • -4

我使用默认下载的 Ubuntu Docker 映像。我想在它的容器中找到网络接口和IP地址,所以我想安装包含的包ifconfig,但是为什么我失败了?谢谢。

$ sudo docker run  ubuntu apt update

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [160 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [5436 B]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [361 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [3910 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]    
Get:12 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [10.8 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [955 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [725 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [6968 B]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3659 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [942 B]
Fetched 15.6 MB in 27s (571 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
5 packages can be upgraded. Run 'apt list --upgradable' to see them.

和

$ sudo docker run  ubuntu apt upgrade

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

和

$ sudo docker run -it ubuntu  apt install net-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package net-tools
docker package-management
  • 1 个回答
  • 2166 Views
Martin Hope
Tim
Asked: 2019-03-28 16:47:37 +0800 CST

我可以在虚拟机的文本虚拟控制台上启动 Debian 吗?[复制]

  • -2
这个问题在这里已经有了答案:
如何在 Debian Jessie 中禁用 X 服务器自动启动? (5 个回答)
3年前关闭。

我在 virt-manager/KVM/QEMU 中创建了一个 Debian 虚拟机。

当我运行Debian虚拟机时,我真的不需要桌面环境,这也很消耗资源。我可以只在文本虚拟控制台(例如 ctrl-alt-f1)而不是虚拟机上的图形虚拟控制台(例如 ctrl-alt-f7)上启动 Debian 吗?

谢谢。

debian kvm
  • 2 个回答
  • 399 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve