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-373893

balon's questions

Martin Hope
Fco Javier Balón
Asked: 2023-01-21 05:16:03 +0800 CST

当变量是随机(证书)文本时,如何将 sed 与变量一起使用

  • 7

我正在尝试制作一个 bash shell 脚本,该脚本从一些预先获得的变量中装载一个文本文件。

为此,我使用 sed,根据需要更改文件的标志:

sed "s/this is a line in text/$var/g" file

它工作正常,没有问题。然而,$var变量通常有奇怪的字符,通常是加密密钥,例如:

-----BEGIN CERTIFICATE-----
MIID0DCCArigAwIBAgIJAMZxe+Z+DbdtMA0GCSqGSIb3DQEBCwUAME4xCzAJBgNV
BAYTAi0tMQswCQYDVQQIEwItLTELMAkGA1UEBxMCLS0xCzAJBgNVBAoTAi0tMRgw
FgYJKoZIhvcNAQkBFgltZUBteS5vcmcwHhcNMjEwODI1MDgyODMzWhcNMzEwODIz
MDgyODMzWjBOMQswCQYDVQQGEwItLTELMAkGA1UECBMCLS0xCzAJBgNVBAcTAi0t
MQswCQYDVQQKEwItLTEYMBYGCSqGSIb3DQEJARYJbWVAbXkub3JnMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1VtgDdOnhyGGd3OQO+QHcqfiH1wP1wJC
5MPZFm9FOQKC74FscbeLflu+hXVSLQQjP8XgJrbCk+xNe+SFOLMoIG mpxvRsjZU
eLzA5lUR8PvmBvgt1iR s1AQQAyh6R7z5QdwamsjmyoE1Si6maRzeCiv46qmlyet
iUEqbXslMk8N6Pa3KsKskv7BgzSOlfLHuWaZScewViGBSbyKUUYV0ljWbGozs21i
w FftSM6JnyNIq6l0wvGYkpJoDpGyxeNPTykswSO6WsG5o8ogJYOQR3KduUqdalj
tHbBsnGB1PNqfhpkBn75FY 8aNryND+uYkkQu1fGVJG0j2XVcPSPpBywZSwGtcCO
LPTL9OIYlRzzVi vTS CRx4NqSY=
-----END CERTIFICATE-----

发生这种情况时,sed命令中断,导致:

sed: -e expression #1, char 39: unterminated `s' command

我知道变量的内容被解释sed为sed命令的一部分,给出了错误。

有没有办法将变量sed作为纯文本发送到并且不被解释?如果不可能,sed在这种情况下是否有任何简单的替代方法可以替换?


更新证书内容具有特殊性的证明/。

cat ca.crt | grep "\/"

grep: warning: stray \ before /
5MPZFm9FOQKC74FscbeLflu+hXVSLQQjP8XgJrbCk+xNe+SFOLMoIG/mpxvRsjZU
eLzA5lUR8PvmBvgt1iR/s1AQQAyh6R7z5QdwamsjmyoE1Si6maRzeCiv46qmlyet
gUX/9Bunyu65hQ+h5kV4aWMRgnDH8HoTQsrJQd4eshHwsqgQA3+Oou4m6GLihkfC
QwsENypmlOiOeYvmxBC0X/w/2IeZMEDbmrMO0yUL6No9xQan7wKNFwIDAQABo4Gw
ggEBAJBDpHQBNlFoMjeQrH1szNe+30rp3ECCwXH4L+qKegobZ5/+joWSk84pRF0J
w/FftSM6JnyNIq6l0wvGYkpJoDpGyxeNPTykswSO6WsG5o8ogJYOQR3KduUqdalj
tHbBsnGB1PNqfhpkBn75FY/8aNryND+uYkkQu1fGVJG0j2XVcPSPpBywZSwGtcCO
LPTL9OIYlRzzVi/vTS/CRx4NqSY=
bash
  • 3 个回答
  • 267 Views
Martin Hope
Fco Javier Balón
Asked: 2022-12-01 03:02:24 +0800 CST

了解 power_supply 文件

  • 6

这是一个非常简单的问题,但我认为就其简单性而言,它具有 aqua 输出。

案例是我有兴趣更好地了解托管在中的文件,这些文件/sys/class/power_supply管理系统的电池监控。就我而言,我使用带电池的笔记本电脑,其目录位于/sys/class/power_supply/BAT0. 另一方面,据我从这里了解到,我有ac-ADaPter接口。/sys/class/power_supply/AC0

在电池接口里面,我找到了各种文件:

/sys/class/power_supply/BAT0$ ls
alarm               model_name
capacity            power
capacity_level      present
charge_full         serial_number
charge_full_design  status
charge_now          subsystem
current_now         technology
cycle_count         type
device              uevent
hwmon2              voltage_min_design
manufacturer        voltage_now

我理解是capacity指当前电池百分比。我也理解上下文capacity_level和status:

/sys/class/power_supply/BAT0$ cat capacity
81

/sys/class/power_supply/BAT0$ cat capacity_level
Normal

/sys/class/power_supply/BAT0$ cat status
Discharging

但是,我不理解其他文件,例如charge_full、charge_full_design、或:charge_nowcurrent_nowcycle_count

/sys/class/power_supply/BAT0$ cat charge_full
900000
/sys/class/power_supply/BAT0$ cat charge_full_design
4100000
/sys/class/power_supply/BAT0$ cat charge_now
630000
/sys/class/power_supply/BAT0$ cat current_now
1191000
/sys/class/power_supply/BAT0$ cat cycle_count
0

在uevent课程中,您可以查看之前的每个变量,并提供更多详细信息:

POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11400000
POWER_SUPPLY_VOLTAGE_NOW=11759000
POWER_SUPPLY_CURRENT_NOW=1089000
POWER_SUPPLY_CHARGE_FULL_DESIGN=4100000
POWER_SUPPLY_CHARGE_FULL=900000
POWER_SUPPLY_CHARGE_NOW=675000
POWER_SUPPLY_CAPACITY=75
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=standard
POWER_SUPPLY_MANUFACTURER=OEM
POWER_SUPPLY_SERIAL_NUMBER=00001

了解清楚电池容量的百分比来自于POWER_SUPPLY_CHARGE_NOW(/sys/class/power_supply/BAT0/charge_now)对POWER_SUPPLY_CHARGE_FULL(/sys/class/power_supply/BAT0/charge_full)的计算:100*675000/900000=75。

但是你怎么能理解这些价值观呢?从哪里来POWER_SUPPLY_CHARGE_NOW?上述值的电压会干扰什么吗?

linux
  • 1 个回答
  • 47 Views
Martin Hope
Fco Javier Balón
Asked: 2022-11-24 03:14:48 +0800 CST

没有横幅的 SSH 客户端连接(在客户端上)

  • 5

我正在开发一个简单的脚本,它连接到某些计算机并通过ssh会话执行某些命令:

sshpass -p 'password' ssh $target_ip << EOF
    echo \$PATH
    # example
    echo \$HOSTNAME
    [...]
EOF

该操作是正确的,但令我困扰的是,在每个连接上它都会显示ssh服务器横幅并干扰脚本的其余部分stdout:

Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-81-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Nov 23 11:58:14 CET 2022

  System load:  0.44               Processes:             131
  Usage of /:   9.2% of 108.79GB   Users logged in:       0
  Memory usage: 26%                IPv4 address for br0:  172.16.20.11
  Swap usage:   0%                 IPv4 address for br0:  10.130.1.1
  Temperature:  36.0 C             IPv4 address for tun0: 10.130.0.27

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

241 updates can be installed immediately.
134 of these updates are security updates.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update
New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

因此,我不希望显示该横幅,只希望显示我在EOF.

以防万一,我使用的 SSH 版本是OpenSSH_9.1p1, OpenSSL 3.0.7 1 Nov 2022. 在服务器的情况下,它是OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020.

我不想从服务器上删除横幅,这可以在sshd配置中完成。我想要的是让客户端在脚本中禁用横幅打印。

但是,对其他人有用的 ssh 线路选项(我来过这里和这里)对我不起作用:

ssh -o LogLevel=error $ip

还:

ssh -q $ip

如何在客户端级别禁用此功能?是否没有允许我执行此操作的 ssh 选项或参数?如果没有,我如何才能将其重定向stdout到/dev/null而不触及我在内部执行的命令的输出EOF?

ssh
  • 1 个回答
  • 43 Views
Martin Hope
Fco Javier Balón
Asked: 2022-11-08 01:57:54 +0800 CST

无法为 HDMI 适配器初始化 displaylink 服务

  • 6

我正在尝试让 USB 3.0 到 HDMI 适配器工作,该适配器支持服务器中archlinux的displaylink 驱动程序Xorg,执行以下操作:

  1. 我已经evdi为开发中的内核模块安装了。
  2. 我已经安装了displaylink驱动程序。
yay -S evdi displaylink
  1. 我已启用displaylink.service.
  2. 将modesetting驱动程序与AccelMethod "none"and MatchDriver "evdi"(in /etc/X11/xorg.conf.d/20-evdi.conf) 一起使用:
Section "OutputClass"
    Identifier "DisplayLink"
    MatchDriver "evdi"
    Driver "modesetting"
    Option "AccelMethod" "none"
EndSection

这是arch-wiki的官方程序。

但是,在启动或启用时displaylink.service,我收到错误:

● displaylink.service - DisplayLink Manager Service
     Loaded: loaded (/usr/lib/systemd/system/displaylink.service; disabled; vendor preset: d>
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-10-05 12:06:37 EDT>
    Process: 24554 ExecStartPre=/sbin/modprobe evdi (code=exited, status=1/FAILURE)
        CPU: 2ms
lines 1-5/5 (END)

检查 journalctl,我得到:

The job identifier is 33183.
Oct 05 12:07:34 minnow modprobe[24572]: modprobe: FATAL: Module evdi not found in directory 

Oct 05 12:07:34 minnow systemd[1]: displaylink.service: Control process exited, code=exited,>
Subject: Unit process exited

但我已经确认evdi安装正确。

arch-linux
  • 1 个回答
  • 18 Views
Martin Hope
Fco Javier Balón
Asked: 2022-10-28 00:46:22 +0800 CST

如何确定笔记本电脑上的 USB-C 端口是否有视频输出(适用于适配器 USB-C - HDMI)?

  • 7

我曾尝试使用带 hdmi 端口的集线器连接到我电脑的 USB-C 端口,但这个集线器不起作用。

检查 Internet(和此处)上的其他类似线程,我发现问题可能是相关的 USB-C 端口不支持视频输出(集线器本身有 USB 端口并且它们工作正常)。

那么有没有办法从我的电脑上展示它以保持冷静?我只能使用制造商的文档进行检查吗?

欲了解更多信息:

lsusb -t连接轮毂前:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 10000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 7: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 2, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 3, Class=Video, Driver=uvcvideo, 480M
    |__ Port 10: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 10: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

lsusb -t集线器连接后:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 10000M
    |__ Port 3: Dev 8, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 7: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 2, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 2, If 3, Class=Video, Driver=uvcvideo, 480M
    |__ Port 8: Dev 41, If 0, Class=Hub, Driver=hub/5p, 480M
    |__ Port 10: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 10: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

xrander集线器连接前后的输出:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 310mm x 170m
   1920x1080     60.01*+  59.93
   1680x1050     59.95    59.88
   1400x1050     59.98
   1600x900      60.00    59.95    59.82
   1280x1024     60.02
   1400x900      59.96    59.88
   1280x960      60.00
   1368x768      60.00    59.88    59.85
   1280x800      59.81    59.91
   1280x720      59.86    60.00    59.74
   1024x768      60.00
   1024x576      60.00    59.90    59.82
   960x540       60.00    59.63    59.82
   800x600       60.32    56.25
   864x486       60.00    59.92    59.57
   640x480       59.94
   720x405       59.51    60.00    58.99
   640x360       59.84    59.32    60.00
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

并xrandr在 HDMI 端口显示器连接后:

Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1920x1080     60.01*+  59.93
   1680x1050     59.95    59.88
   1400x1050     59.98
   1600x900      60.00    59.95    59.82
   1280x1024     60.02
   1400x900      59.96    59.88
   1280x960      60.00
   1368x768      60.00    59.88    59.85
   1280x800      59.81    59.91
   1280x720      59.86    60.00    59.74
   1024x768      60.00
   1024x576      60.00    59.90    59.82
   960x540       60.00    59.63    59.82
   800x600       60.32    56.25
   864x486       60.00    59.92    59.57
   640x480       59.94
   720x405       59.51    60.00    58.99
   640x360       59.84    59.32    60.00
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
   1920x1080     60.00*+  50.00    59.94
   1680x1050     59.88
   1600x900      60.00
   1280x1024     60.02
   1440x900      59.90
   1280x800      59.91
   1280x720      60.00    50.00    59.94
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       60.00    59.94
   720x400       70.08
VIRTUAL1 disconnected (normal left inverted right x axis y axis) 
hardware
  • 1 个回答
  • 21 Views
Martin Hope
balon
Asked: 2021-11-11 01:11:35 +0800 CST

释放低磁盘 PC 上的 mysql 空间

  • 0

我有一台带小磁盘的 PC:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.5G  3.1G  249M  93% /
devtmpfs        459M     0  459M   0% /dev
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           463M   36M  428M   8% /run
tmpfs           5.0M  8.0K  5.0M   1% /run/lock
tmpfs           463M     0  463M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M   25M   38M  40% /boot
tmpfs            64M  140K   64M   1% /mnt/ramdisk

我有一个简单的数据库,但其中一个表有超过 500 万行,在这么小的记录上占用了很多:

# ls -lh /var/lib/mysql/datalogger/
total 1.1G
...
-rw-rw---- 1 mysql mysql 1.1G Nov 10 09:56 avg_values.ibd
...

我的目标是在没有占用太多空间的其他类似计算机上完成(大约在该表中的一半)是运行删除超过 6 个月的数据的查询。查询与案例无关。查询后,运行optimize NO_WRITE_TO_BINLOG table avg_values;释放ibd空间。

有问题的计算机的问题是 - 我相信 - 可用空间非常有限,您无法在如此大的表上执行查询(我理解缓存),导致通信不稳定,即使查询有一个限制:

MariaDB [datalogger]> select * from avg_values limit 10;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: datalogger

ERROR 2013 (HY000): Lost connection to MySQL server during query

对于其他较小的表,通常没有问题(尽管它也表示错误):

MariaDB [datalogger]> select * from raw_values;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: datalogger

+----+---------------------+-------------------+------+-------+
| id | timestamp           | channel           | raw  | value |
+----+---------------------+-------------------+------+-------+
|  1 | 2021-11-10 09:46:51 | AI1               |    1 | 0.011 |
|  2 | 2021-11-10 09:46:51 | AI2               |    1 | 0.011 |
|  3 | 2021-11-10 09:46:51 | AI3               |    2 | 0.022 |
|  4 | 2021-11-10 09:46:51 | AI4               |    2 | 0.022 |
|  5 | 2021-11-10 09:46:51 | pyr1_sensor1_data |  113 |   113 |
|  6 | 2021-11-10 09:46:51 | pyr1_body_temp    |   42 |    42 |
|  7 | 2021-11-10 09:46:51 | pyr2_sensor1_data | NULL |  NULL |
|  8 | 2021-11-10 09:46:51 | pyr2_body_temp    | NULL |  NULL |
|  9 | 2021-11-10 09:46:46 | AI1               |    1 | 0.011 |
| 10 | 2021-11-10 09:46:46 | AI2               |    1 | 0.011 |
| 11 | 2021-11-10 09:46:46 | AI3               |    2 | 0.022 |
| 12 | 2021-11-10 09:46:46 | AI4               |    2 | 0.022 |
| 13 | 2021-11-10 09:46:46 | pyr1_sensor1_data |  115 |   115 |
| 14 | 2021-11-10 09:46:46 | pyr1_body_temp    |   42 |    42 |
| 15 | 2021-11-10 09:46:46 | pyr2_sensor1_data | NULL |  NULL |
| 16 | 2021-11-10 09:46:46 | pyr2_body_temp    | NULL |  NULL |
| 17 | 2021-11-10 09:46:52 | AI1               |    1 | 0.011 |
| 18 | 2021-11-10 09:46:52 | AI2               |    1 | 0.011 |
| 19 | 2021-11-10 09:46:52 | AI3               |    2 | 0.022 |
| 20 | 2021-11-10 09:46:52 | AI4               |    2 | 0.022 |
| 21 | 2021-11-10 09:46:52 | pyr1_sensor1_data |  112 |   112 |
| 22 | 2021-11-10 09:46:52 | pyr1_body_temp    |   42 |    42 |
| 23 | 2021-11-10 09:46:52 | pyr2_sensor1_data | NULL |  NULL |
| 24 | 2021-11-10 09:46:52 | pyr2_body_temp    | NULL |  NULL |
+----+---------------------+-------------------+------+-------+
24 rows in set (0.02 sec)

有什么方法可以运行这些查询,尤其是使用这个小磁盘来释放空间?

mysql disk
  • 1 个回答
  • 51 Views
Martin Hope
balon
Asked: 2020-03-11 01:42:40 +0800 CST

通过守护进程 systemd 在相对路径中启动 dotnet core 可执行文件

  • 0

dotnet core我已经为 linux arm 机器开发并发布了一个 Web 应用程序。为此,已启动命令:

dotnet publish --runtime linux-arm -p:PublishSingleFile=true

结果给出了目录:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       10/03/2020      8:56                wwwroot
-a----       09/03/2020     10:54            162 appsettings.Development.json
-a----       09/03/2020     10:54            192 appsettings.json
-a----       10/03/2020      8:56      108097487 coremonitor
-a----       09/03/2020     12:59           7248 coremonitor.pdb
-a----       10/03/2020      8:56            474 web.config

coremonitor可执行文件在哪里。该数据被发送到服务器并存储在路径中/root/datalogger/linux-arm/。然后我们创建了 systemd 守护进程来启动它:

[Unit]
Description=Data Logger Monitor Daemon

[Service]
ExecStart=./coremonitor
WorkingDirectory=/root/dataloggermonitor/linux-arm
User=dotnetuser
Group=dotnetuser
Restart=on-failure
SyslogIdentifier=DataLoggerMonitor-Service
PrivateTmp=true

[Install]
WantedBy=multi-user.target

重新启动后,我得到以下 systemd 日志(systemctl status dataloggermonitor):

● dataloggermonitor.service - Data Logger Monitor Daemon
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
systemd daemon
  • 1 个回答
  • 271 Views
Martin Hope
balon
Asked: 2019-11-27 07:07:03 +0800 CST

Raspbian 中的 apt 问题,其中 /var 内容已被删除或损坏

  • 3

显然在生产服务器上出现了一些问题,有人删除了该/var文件夹的内容。

这导致了一些错误,我一直在使用各种服务作为 Web 服务器来解决这些错误。

我遇到的apt问题,不允许我更新、删除或安装软件包的问题。

例如我想重新安装数据库服务器mariadb-server,但它告诉我系统中没有安装包(这是错误的,我个人安装了它):

root# apt remove mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mariadb-server' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 chkconfig : Depends: perl but it is not going to be installed
             Recommends: insserv but it is not going to be installed
 libboost-chrono1.50.0 : Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed
                         Depends: libstdc++6 (>= 4.4.0) but it is not going to be installed
 libboost-system1.50.0 : Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed
                         Depends: libstdc++6 (>= 4.4.0) but it is not going to be installed
 libboost-thread1.50.0 : Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed
                         Depends: libstdc++6 (>= 4.6) but it is not going to be installed
 libc6 : Depends: libgcc1 but it is not going to be installed
 libprotobuf-lite7 : Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed
                     Depends: libstdc++6 (>= 4.4.0) but it is not going to be installed
                     Depends: zlib1g (>= 1:1.1.4) but it is not going to be installed
 oracle-java8-jdk : Depends: libasound2 (>= 1.0.16)
                    Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed
                    Depends: libx11-6 but it is not going to be installed
                    Depends: libxext6 but it is not going to be installed
                    Depends: libxi6 but it is not going to be installed
                    Depends: libxrender1 but it is not going to be installed
                    Depends: libxtst6 but it is not going to be installed
                    Recommends: netbase but it is not going to be installed
 redis-server : Depends: init-system-helpers (>= 1.18~) but it is not going to be installed
                Depends: libjemalloc1 (>= 2.1.1) but it is not going to be installed
                Depends: adduser but it is not going to be installed
 redis-tools : Depends: libjemalloc1 (>= 2.1.1) but it is not going to be installed
 watchdog : Depends: debconf (>= 0.5) but it is not going to be installed or
                     debconf-2.0
            Depends: init-system-helpers (>= 1.18~) but it is not going to be installed
            Depends: makedev (>= 2.3.1-24) but it is not going to be installed or
                     udev but it is not going to be installed
            Depends: lsb-base (>= 3.2-14) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如果我启动告诉我解决未满足的依赖项的命令:

root# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  adduser apt apt-utils base-passwd ca-certificates coreutils debconf debconf-i18n debianutils dpkg e2fslibs e2fsprogs gnupg gnupg-curl gpgv ifupdown init-system-helpers initscripts insserv iproute2 isc-dhcp-client isc-dhcp-common
  krb5-locales libacl1 libalgorithm-c3-perl libapt-inst1.5 libapt-pkg4.12 libarchive-extract-perl libasound2 libasound2-data libatm1 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libcgi-fast-perl libcgi-pm-perl
  libclass-c3-perl libclass-c3-xs-perl libcomerr2 libcpan-meta-perl libcurl3-gnutls libdata-optlist-perl libdata-section-perl libdb5.3 libdebconfclient0 libdns-export100 libfcgi-perl libffi6 libgcc1 libgcrypt20 libgdbm3 libgmp10
  libgnutls-deb0-28 libgpg-error0 libgpm2 libgssapi-krb5-2 libhogweed2 libidn11 libirs-export91 libisc-export95 libisccfg-export90 libjemalloc1 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblocale-gettext-perl
  liblog-message-perl liblog-message-simple-perl liblzma5 libmodule-build-perl libmodule-pluggable-perl libmodule-signature-perl libmount1 libmro-compat-perl libncurses5 libnettle4 libp11-kit0 libpackage-constants-perl libpam-modules
  libpam-modules-bin libpam0g libparams-util-perl libpcre3 libpng12-0 libpod-latex-perl libpod-readme-perl libreadline6 libregexp-common-perl librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libselinux1 libsemanage-common
  libsemanage1 libsepol1 libslang2 libsmartcols1 libsoftware-license-perl libss2 libssh2-1 libssl1.0.0 libstdc++6 libsub-exporter-perl libsub-install-perl libsystemd0 libtasn1-6 libterm-ui-perl libtext-charwidth-perl libtext-iconv-perl
  libtext-soundex-perl libtext-template-perl libtext-wrapi18n-perl libtinfo5 libusb-0.1-4 libustr-1.0-1 libuuid1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxrender1 libxtables10 libxtst6 lsb-base makedev netbase
  openssl passwd perl perl-base perl-modules psmisc raspbian-archive-keyring readline-common redis-server redis-tools rename sensible-utils startpar sysv-rc sysvinit-utils tar tzdata util-linux uuid-runtime x11-common zlib1g
Suggested packages:
  aptitude synaptic wajig dpkg-dev apt-doc python-apt debconf-doc debconf-utils whiptail dialog gnome-utils libterm-readline-gnu-perl libgtk2-perl libnet-ldap-perl libqtgui4-perl libqtcore4-perl gpart parted fuse2fs e2fsck-static
  gnupg-doc libpcsclite1 parcimonie xloadimage imagemagick eog ppp rdnssd net-tools bootchart2 iproute2-doc resolvconf avahi-autoipd libasound2-plugins alsa-utils rng-tools gnutls-bin gpm krb5-doc krb5-user libpam-doc
  libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal perl-doc make libb-lint-perl libcpanplus-dist-build-perl libcpanplus-perl libfile-checktree-perl
  libobject-accessor-perl readline-doc bum bootlogd sash bzip2 ncompress xz-utils tar-scripts dosfstools kbd console-tools util-linux-locales
Recommended packages:
  libarchive-tar-perl
The following NEW packages will be installed:
  adduser apt apt-utils base-passwd ca-certificates coreutils debconf debconf-i18n debianutils dpkg e2fslibs e2fsprogs gnupg gnupg-curl gpgv ifupdown init-system-helpers initscripts insserv iproute2 isc-dhcp-client isc-dhcp-common
  krb5-locales libacl1 libalgorithm-c3-perl libapt-inst1.5 libapt-pkg4.12 libarchive-extract-perl libasound2 libasound2-data libatm1 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libcgi-fast-perl libcgi-pm-perl
  libclass-c3-perl libclass-c3-xs-perl libcomerr2 libcpan-meta-perl libcurl3-gnutls libdata-optlist-perl libdata-section-perl libdb5.3 libdebconfclient0 libdns-export100 libfcgi-perl libffi6 libgcc1 libgcrypt20 libgdbm3 libgmp10
  libgnutls-deb0-28 libgpg-error0 libgpm2 libgssapi-krb5-2 libhogweed2 libidn11 libirs-export91 libisc-export95 libisccfg-export90 libjemalloc1 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblocale-gettext-perl
  liblog-message-perl liblog-message-simple-perl liblzma5 libmodule-build-perl libmodule-pluggable-perl libmodule-signature-perl libmount1 libmro-compat-perl libncurses5 libnettle4 libp11-kit0 libpackage-constants-perl libpam-modules
  libpam-modules-bin libpam0g libparams-util-perl libpcre3 libpng12-0 libpod-latex-perl libpod-readme-perl libreadline6 libregexp-common-perl librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libselinux1 libsemanage-common
  libsemanage1 libsepol1 libslang2 libsmartcols1 libsoftware-license-perl libss2 libssh2-1 libssl1.0.0 libstdc++6 libsub-exporter-perl libsub-install-perl libsystemd0 libtasn1-6 libterm-ui-perl libtext-charwidth-perl libtext-iconv-perl
  libtext-soundex-perl libtext-template-perl libtext-wrapi18n-perl libtinfo5 libusb-0.1-4 libustr-1.0-1 libuuid1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxrender1 libxtables10 libxtst6 lsb-base makedev netbase
  openssl passwd perl perl-base perl-modules psmisc raspbian-archive-keyring readline-common rename sensible-utils startpar sysv-rc sysvinit-utils tar tzdata util-linux uuid-runtime x11-common zlib1g
The following packages will be upgraded:
  redis-server redis-tools
2 upgraded, 153 newly installed, 0 to remove and 3 not upgraded.
11 not fully installed or removed.
Need to get 37.1 MB of archives.
After this operation, 120 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://archive.raspberrypi.org/debian/ jessie/main libasound2-data all 1.0.28-1+rpi3 [65.3 kB]
Get:2 http://archive.raspberrypi.org/debian/ jessie/main libasound2 armhf 1.0.28-1+rpi3 [320 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libgcc1 armhf 1:4.9.2-10+deb8u2 [39.5 kB]
Get:4 http://archive.raspberrypi.org/debian/ jessie/main x11-common all 1:7.7+16 [251 kB]
[...]
Get:152 http://mirrordirector.raspbian.org/raspbian/ jessie/main libterm-ui-perl all 0.42-1 [19.1 kB]
Get:153 http://mirrordirector.raspbian.org/raspbian/ jessie/main libtext-soundex-perl armhf 3.4-1+b2 [13.3 kB]
Get:154 http://mirrordirector.raspbian.org/raspbian/ jessie/main psmisc armhf 22.21-2 [117 kB]
Get:155 http://mirrordirector.raspbian.org/raspbian/ jessie/main rename all 0.20-3 [12.4 kB]
Fetched 37.1 MB in 2min 29s (249 kB/s)
Reading changelogs... Done
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 19%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 38%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 58%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 77%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 96%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 100%
dpkg: regarding .../libgcc1_1%3a4.9.2-10+deb8u2_armhf.deb containing libgcc1:armhf, pre-dependency problem:
 libgcc1 pre-depends on multiarch-support
  multiarch-support is unpacked, but has never been configured.

dpkg: error processing archive /var/cache/apt/archives/libgcc1_1%3a4.9.2-10+deb8u2_armhf.deb (--unpack):
 pre-dependency problem - not installing libgcc1:armhf
Errors were encountered while processing:
 /var/cache/apt/archives/libgcc1_1%3a4.9.2-10+deb8u2_armhf.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

这是mariadb-server已安装的证明(错误是由于删除了/var,所以我想重新安装它):

root# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")

如您所见,两者都会在目录中丢失内容apt并mariadb-server抛出错误。/var所以我进入了一个循环,我不知道如何继续解决这个问题。

raspbian apt
  • 1 个回答
  • 245 Views
Martin Hope
balon
Asked: 2019-11-21 07:19:02 +0800 CST

如何在实践中演示内核压缩的类型?

  • 11

我必须找出我的arch linux系统的linux内核的压缩类型,但是我找不到比理论更多的方法:现在是bzip2(bz),以前是gzip(z)。

在我的计算机中,我运行以下命令:

$ file /boot/vmlinuz-linux
/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 5.3.11-arch1-1 (linux@archlinux) #1 SMP PREEMPT Tue, 12 Nov 2019 22:19:48 +0000, RO-rootFS, swap_dev 0x5, Normal VGA

查看理论,我看到它bzImage必须被 压缩gzip (z),但我无法证明:

bzImage 是使用 gzip 压缩的,直到 Linux 2.6.30 引入了更多算法。虽然有一种流行的误解,认为 bz 前缀意味着使用了 bzip2 压缩(bzip2 包通常与以 bz 为前缀的工具一起分发,例如 bzless、bzcat 等),但事实并非如此。

有什么方法可以在我自己的机器上证明吗?或者在这种情况下,理论本身是“经验的”?

linux linux-kernel
  • 3 个回答
  • 8030 Views
Martin Hope
balon
Asked: 2019-11-15 01:19:29 +0800 CST

显示从命令更改实时值的 Bash 脚本

  • 9

在 Linux 机器上,我有一系列提供不同传感器状态数值的命令。

这些命令的调用类似于以下内容:

$ command1
5647
$ command2
76
$ command3
8754

这些值是实时变化的,每次我想检查其中一个的状态时,我都必须重新启动命令……这对我没有任何好处,因为我需要双手来操作硬件。

我的目标是制作一个简单的 Bash 脚本来调用这些命令并保持值更新(实时异步或每 x 秒刷新一次值),如下所示:

$ ./myScript.sh
command1: x
command2: y
command3: z
command4: v

其中x、y和是变化的值z。v

Bash 可以简单有效地实现这一点吗?还是我应该选择用另一种语言来做,比如 Python?

更新更多信息:

我当前的脚本是:

#!/bin/bash
echo "Célula calibrada: " $(npe ?AI1)
echo "Anemómetro: " $(npe ?AI2)
echo "Célula temperatura: " $(npe ?AI3)
echo "Célula temperatura: " $(npe ?AI4)

npe是一个返回数值的示例命令。我期望这样的输出:

在此处输入图像描述

我使用命令得到的这个输出watch -n x ./myScript.sh,其中x是秒的刷新值。如果我像这样编辑我的脚本:

#!/bin/bash
while sleep 1; do
   clear; # added to keep the information in the same line 
   echo "Célula calibrada: " $(npe ?AI1);
   echo "Anemómetro: " $(npe ?AI2);
   echo "Célula temperatura: " $(npe ?AI3);
   echo "Célula temperatura: " $(npe ?AI4);
done

我的输出带有令人讨厌的闪烁:

在此处输入图像描述

linux
  • 10 个回答
  • 8236 Views
Martin Hope
balon
Asked: 2019-11-14 06:35:06 +0800 CST

使用组合字母和数字的大括号扩展创建多个文件

  • 1

我正在尝试创建一系列带有大括号扩展的文件。我想fileA1用fileZ100所有可能的组合(类似的东西touch file[A..Z][1..100])创建文件。

如果我运行该命令touch $(printf "file%d " {1..100}),则输出正常:

file1    file15  file21  file28  file34  file40  file47  file53  file6   file66  file72  file79  file85  file91  file98
file10   file16  file22  file29  file35  file41  file48  file54  file60  file67  file73  file8   file86  file92  file99
file100  file17  file23  file3   file36  file42  file49  file55  file61  file68  file74  file80  file87  file93
file11   file18  file24  file30  file37  file43  file5   file56  file62  file69  file75  file81  file88  file94
file12   file19  file25  file31  file38  file44  file50  file57  file63  file7   file76  file82  file89  file95
file13   file2   file26  file32  file39  file45  file51  file58  file64  file70  file77  file83  file9   file96
file14   file20  file27  file33  file4   file46  file52  file59  file65  file71  file78  file84  file90  file97

如果我运行相同touch $(printf "file%c " {A..Z}):

fileA  fileC  fileE  fileG  fileI  fileK  fileM  fileO  fileQ  fileS  fileU  fileW  fileY
fileB  fileD  fileF  fileH  fileJ  fileL  fileN  fileP  fileR  fileT  fileV  fileX  fileZ

我正在尝试将它们结合起来touch $(printf "file%c%d " {A..Z}{1..100}),但输出是:

[...]
-bash: printf: Y2: invalid number
-bash: printf: Y4: invalid number
-bash: printf: Y6: invalid number
-bash: printf: Y8: invalid number
-bash: printf: Y10: invalid number
-bash: printf: Y12: invalid number
-bash: printf: Y14: invalid number
-bash: printf: Y16: invalid number
-bash: printf: Y18: invalid number
-bash: printf: Y20: invalid number
-bash: printf: Y22: invalid number
-bash: printf: Y24: invalid number
-bash: printf: Y26: invalid number
-bash: printf: Y28: invalid number
-bash: printf: Y30: invalid number
-bash: printf: Y32: invalid number
-bash: printf: Y34: invalid number
-bash: printf: Y36: invalid number
-bash: printf: Y38: invalid number
-bash: printf: Y40: invalid number
-bash: printf: Y42: invalid number
-bash: printf: Y44: invalid number
-bash: printf: Y46: invalid number
-bash: printf: Y48: invalid number
-bash: printf: Y50: invalid number
-bash: printf: Y52: invalid number
-bash: printf: Y54: invalid number
-bash: printf: Y56: invalid number
-bash: printf: Y58: invalid number
-bash: printf: Y60: invalid number
-bash: printf: Y62: invalid number
-bash: printf: Y64: invalid number
-bash: printf: Y66: invalid number
-bash: printf: Y68: invalid number
-bash: printf: Y70: invalid number
-bash: printf: Y72: invalid number
-bash: printf: Y74: invalid number
-bash: printf: Y76: invalid number
-bash: printf: Y78: invalid number
-bash: printf: Y80: invalid number
-bash: printf: Y82: invalid number
-bash: printf: Y84: invalid number
-bash: printf: Y86: invalid number
-bash: printf: Y88: invalid number
-bash: printf: Y90: invalid number
-bash: printf: Y92: invalid number
-bash: printf: Y94: invalid number
-bash: printf: Y96: invalid number
-bash: printf: Y98: invalid number
-bash: printf: Y100: invalid number
-bash: printf: Z2: invalid number
-bash: printf: Z4: invalid number
-bash: printf: Z6: invalid number
-bash: printf: Z8: invalid number
-bash: printf: Z10: invalid number
-bash: printf: Z12: invalid number
-bash: printf: Z14: invalid number
-bash: printf: Z16: invalid number
-bash: printf: Z18: invalid number
-bash: printf: Z20: invalid number
-bash: printf: Z22: invalid number
-bash: printf: Z24: invalid number
-bash: printf: Z26: invalid number
-bash: printf: Z28: invalid number
-bash: printf: Z30: invalid number
-bash: printf: Z32: invalid number
-bash: printf: Z34: invalid number
-bash: printf: Z36: invalid number
-bash: printf: Z38: invalid number
-bash: printf: Z40: invalid number
-bash: printf: Z42: invalid number
-bash: printf: Z44: invalid number
-bash: printf: Z46: invalid number
-bash: printf: Z48: invalid number
-bash: printf: Z50: invalid number
-bash: printf: Z52: invalid number
-bash: printf: Z54: invalid number
-bash: printf: Z56: invalid number
-bash: printf: Z58: invalid number
-bash: printf: Z60: invalid number
-bash: printf: Z62: invalid number
-bash: printf: Z64: invalid number
-bash: printf: Z66: invalid number
-bash: printf: Z68: invalid number
-bash: printf: Z70: invalid number
-bash: printf: Z72: invalid number
-bash: printf: Z74: invalid number
-bash: printf: Z76: invalid number
-bash: printf: Z78: invalid number
-bash: printf: Z80: invalid number
-bash: printf: Z82: invalid number
-bash: printf: Z84: invalid number
-bash: printf: Z86: invalid number
-bash: printf: Z88: invalid number
-bash: printf: Z90: invalid number
-bash: printf: Z92: invalid number
-bash: printf: Z94: invalid number
-bash: printf: Z96: invalid number
-bash: printf: Z98: invalid number
-bash: printf: Z100: invalid number

那么......什么是正确的正则表达式?我应该使用管道吗?

bash
  • 2 个回答
  • 222 Views
Martin Hope
balon
Asked: 2019-10-31 14:46:11 +0800 CST

有没有办法在 bash 中为具体的单词着色?

  • 1

我想知道是否有任何方法可以着色,.bashrc例如根据什么词或什么情况。

我自己解释一下:我想给控制台上出现的 IP 地址上色,我还想把所有的错误词都涂成红色,还有每个命令的第一个参数(命令本身的名称)。

linux
  • 1 个回答
  • 72 Views
Martin Hope
balon
Asked: 2019-10-25 03:50:07 +0800 CST

Linux内核路径和压缩

  • 0

我正在尝试查找 Linux 内核路径,以找出它在工业 Raspberry Pi 中使用的压缩类型。

我正在运行命令cat /proc/cmdline并获取输出:

dwc_otg.lpm_enable=0 smsc95xx.macaddr=18:83:C4:04:49:C5 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait noinitrd elevator=deadline bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080

的内容/boot是(Linux内核镜像应该在这里):

total 24948
-rwxr-xr-x 1 root root   15747 Jul 31  2018 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root    3667 Jul 31  2018 bcm2710-rpi-cm3.dts
-rwxr-xr-x 1 root root   50192 Feb 10  2017 bootcode.bin
-rwxr-xr-x 1 root root     391 Oct  7  2019 boot.scr
-rwxr-xr-x 1 root root     136 Jan  1  1980 cmdline.txt
-rwxr-xr-x 1 root root     103 Jul 31  2018 config.txt
-rwxr-xr-x 1 root root       4 Oct  7  2019 console_status
-rwxr-xr-x 1 root root   18693 Aug 21  2015 COPYING.linux
-rwxr-xr-x 1 root root   39946 Jul 31  2018 dt-blob.bin
-rwxr-xr-x 1 root root   62963 Jul 31  2018 dt-blob.dts
-rwxr-xr-x 1 root root    2527 Nov 25  2016 fixup_cd.dat
-rwxr-xr-x 1 root root    6617 Feb 10  2017 fixup.dat
-rwxr-xr-x 1 root root    9751 Nov 25  2016 fixup_db.dat
-rwxr-xr-x 1 root root    9749 Nov 25  2016 fixup_x.dat
-rwxr-xr-x 1 root root     512 Jan  1  1980 FSCK0000.REC
-rwxr-xr-x 1 root root     512 Jan  1  1980 FSCK0001.REC
-rwxr-xr-x 1 root root     512 Jan  1  1980 FSCK0002.REC
-rwxr-xr-x 1 root root     512 Jan  1  1980 FSCK0003.REC
-rwxr-xr-x 1 root root     145 Nov 25  2016 issue.txt
-rwxr-xr-x 1 root root 4228952 Feb 10  2017 kernel7.img
-rwxr-xr-x 1 root root 4128712 Nov 25  2016 kernel.img
-rwxr-xr-x 1 root root    1494 Nov 18  2015 LICENCE.broadcom
-rwxr-xr-x 1 root root   18974 Nov 25  2016 LICENSE.oracle
drwxr-xr-x 2 root root    8192 Jul 31  2018 overlays
-rwxr-xr-x 1 root root  633636 Nov 25  2016 start_cd.elf
-rwxr-xr-x 1 root root 4954692 Nov 25  2016 start_db.elf
-rwxr-xr-x 1 root root 2830532 Feb 10  2017 start.elf
-rwxr-xr-x 1 root root 3904260 Nov 25  2016 start_x.elf
drwxr-xr-x 2 root root     512 Feb 10  2017 System Volume Information
-rwxr-xr-x 1 root root     383 Jan  1 01:00 tb_config
-rwxr-xr-x 1 root root   35700 Jan  1 01:00 tb_config_tmp
-rwxr-xr-x 1 root root     391 Jul 31  2018 tmp_boot.cmd_servic_off
-rwxr-xr-x 1 root root     438 Jul 31  2018 tmp_boot.cmd_servic_on
-rwxr-xr-x 1 root root  340632 Feb 10  2017 u-boot.bin
-rwxr-xr-x 1 root root 4228672 Feb 10  2017 zImage

但我看不出它们之间的关系......有人可以帮我识别图像并解释命令的输出cat /proc/cmdline吗?

更新

在我的带有 Arch Linux 的笔记本电脑中,这种关系很清楚:

输入:cat/proc/cmdline

输出:BOOT_IMAGE=/vmlinuz-linux root=UUID=[...] rw quiet

在/boot我可以找到:

-rw-r--r-- 1 root root 6289792 oct 18 02:15 vmlinuz-linux

kernel
  • 1 个回答
  • 144 Views
Martin Hope
balon
Asked: 2019-10-09 08:33:43 +0800 CST

在 Debian 10 Buster 中安装 php-db 时出错

  • 0

我已经尝试在 Debian 10 Buster 中安装 php-db,这是 PandoraFMS 控制台所需的依赖项(我正在安装它),但对我不起作用。

当我尝试安装时,我缺少依赖项:

[...]
dpkg: dependency problems prevent configuration of pandorafms-console:
   pandorafms-console depends on php-db; however:
      Package php-db is not installed.

如果我尝试手动安装 php-db:

# apt install php-db
[...]
Package php-db is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-db' has no installation candidate

在 packages.debian.org 我可以搜索包,我发现:

打包 php-db

+ jessie (oldoldstable) (php): PHP PEAR Database Abstraction Layer
  1.7.14-3: all
+ stretch (oldstable) (php): Database Abstraction Layer
  1.9.2-1: all
+ sid (unstable) (php): Database Abstraction Layer
  1.9.2-2: all

有关更多信息,/etc/apt/sources.list 的内容是(省略的注释):

deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main

deb http://security.debian.org/ buster/updates main
deb-src http://security.debian.org/ buster/updates main
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main

deb http://deb.debian.org/debian buster-backports main
deb-src http://deb.debian.org/debian buster-backports main

目录 /etc/apt/sources.list.d/ 是空的。

我可以做什么?

debian
  • 2 个回答
  • 1369 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