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

Chris Stryczynski's questions

Martin Hope
Chris Stryczynski
Asked: 2024-09-06 23:48:24 +0800 CST

在 Debian 12 上安装 python3.11-venv 时遇到问题

  • 5

我在尝试让 virtualenv 在 Debian 12 上运行时遇到了一些问题,很难弄清楚到底是什么问题。我已经运行过了,apt update而且apt upgrade这是几天前刚刚在网络上安装的 Debian。

$ python3 -m venv code_execution_env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.11-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: /home/chris/projects/claude-engineer/code_execution_env/bin/python3
$ sudo apt install -y python3.11-venv
Reading package lists... Done
Building dependency tree... Done
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 help to resolve the situation:

The following packages have unmet dependencies:
 python3.11-venv : Depends: python3.11 (= 3.11.2-6+deb12u2) but 3.11.2-6+deb12u3 is to be installed
E: Unable to correct problems, you have held broken packages.

我也尝试过python3-venv,python3.11-full但没有成功:

$ sudo apt-get install python3.11-full
[sudo] password for chris: 
Reading package lists... Done
Building dependency tree... Done
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 help to resolve the situation:

The following packages have unmet dependencies:
 python3.11-full : Depends: python3.11 (= 3.11.2-6+deb12u2) but 3.11.2-6+deb12u3 is to be installed
                   Depends: python3.11-venv (= 3.11.2-6+deb12u2) but it is not going to be installed
                   Recommends: python3.11-doc but it is not going to be installed
                   Recommends: python3.11-examples but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-缓存策略:

$ apt-cache policy python3.11 python3.11-venv
python3.11:
  Installed: 3.11.2-6+deb12u3
  Candidate: 3.11.2-6+deb12u3
  Version table:
 *** 3.11.2-6+deb12u3 100
        100 /var/lib/dpkg/status
     3.11.2-6+deb12u2 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
python3.11-venv:
  Installed: (none)
  Candidate: 3.11.2-6+deb12u2
  Version table:
     3.11.2-6+deb12u2 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages

尝试过apt --fix-broken install:

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

任何指示都会有帮助,很难知道这是否只是一些 python 打包问题或者也许我需要进一步关注确切的错误python3.11-venv : Depends: python3.11 (= 3.11.2-6+deb12u2) but 3.11.2-6+deb12u3 is to be installed。

https://tracker.debian.org/pkg/python3.11还指出了一些相关内容:

软件包已消失 此软件包不在任何开发存储库中。这可能意味着该软件包已被删除(或已重命名)。因此,此处的信息并不重要...除非有人接管并重新引入它,否则该软件包将会消失。

debian
  • 1 个回答
  • 57 Views
Martin Hope
Chris Stryczynski
Asked: 2024-09-05 21:49:59 +0800 CST

Debian “NO_PUBKEY C47F8A8AAD743EF7”用于 fasttrack

  • 5

来自https://wiki.debian.org/VirtualBox#Debian_10_.22Buster.22.2C_Debian_11_.22Bullseye.22.2C_and_Debian_12_.22Bookworm.22-1的信息

我跑了:

sudo apt install lsb-release
echo "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main contrib" |
sudo tee /etc/apt/sources.list.d/backports.list

echo "deb http://fasttrack.debian.net/debian-fasttrack/ $(lsb_release -cs)-fasttrack main contrib" |
sudo tee /etc/apt/sources.list.d/fasttrack.list
echo "deb http://fasttrack.debian.net/debian-fasttrack/ $(lsb_release -cs)-backports-staging main contrib" |
sudo tee -a /etc/apt/sources.list.d/fasttrack.list

然而,这给了我一个错误apt update:

chris@debiandev:~/projects$ sudo apt update
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                          
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                  
Hit:4 http://deb.debian.org/debian bookworm-backports InRelease                
Get:5 http://fasttrack.debian.net/debian-fasttrack bookworm-fasttrack InRelease [12.9 kB]
Get:6 http://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease [12.9 kB]
Err:5 http://fasttrack.debian.net/debian-fasttrack bookworm-fasttrack InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C47F8A8AAD743EF7
Err:6 http://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C47F8A8AAD743EF7
Reading package lists... Done
W: GPG error: http://fasttrack.debian.net/debian-fasttrack bookworm-fasttrack InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C47F8A8AAD743EF7
E: The repository 'http://fasttrack.debian.net/debian-fasttrack bookworm-fasttrack InRelease' is not signed.
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.
W: GPG error: http://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C47F8A8AAD743EF7
E: The repository 'http://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease' is not signed.
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.

我似乎无法找到具有此确切公钥值的谷歌搜索结果,因此我有点担心,只能盲目地添加此公钥sudo apt-key adv ...。我是不是漏掉了一步

我正在使用 Debian 12 bookworm。

debian
  • 1 个回答
  • 20 Views
Martin Hope
Chris Stryczynski
Asked: 2023-07-09 19:14:10 +0800 CST

取消了 ext4 收缩,现在我似乎无法格式化驱动器?parted、fdisk 等不会与驱动器一起运行

  • 5

我正在缩小 ext4 分区,但是花费的时间太长,所以我想我应该从头开始(创建一个新分区并擦除数据)。但是,在我取消调整大小(通过 gparted 完成)后,我无法在此驱动器上使用以前可用的命令:

sudo parted /dev/sdc
echo $?             
1

parted 只是终止,gparted 也不显示驱动器。

lsblk 显示 0 大小的驱动器

lsblk | grep sdc
sdc           8:32   0     0B  0 disk

磁盘驱动器

sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sdc: No such file or directory

我是否可能在执行此操作时损坏了驱动器本身?根据https://www.scosales.com/ta/kb/104521.html,这可能是硬件问题。

如果此错误出现在同一设备上,无论其位置在哪里,则很可能是设备硬件存在问题。查明此
设备上是否存在其他常见错误。如果有,则很可能是设备出现故障。

插入驱动器时 dmesg 会记录(通过 NVME -> USB 外部接口):

[Sun Jul  9 12:14:48 2023] usb 1-4: new high-speed USB device number 8 using xhci_hcd
[Sun Jul  9 12:14:48 2023] usb 1-4: New USB device found, idVendor=0bda, idProduct=9210, bcdDevice=20.01
[Sun Jul  9 12:14:48 2023] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sun Jul  9 12:14:48 2023] usb 1-4: Product: Best USB Device
[Sun Jul  9 12:14:48 2023] usb 1-4: Manufacturer: ULT-Best
[Sun Jul  9 12:14:48 2023] usb 1-4: SerialNumber: 012938001753
[Sun Jul  9 12:14:48 2023] usb-storage 1-4:1.0: USB Mass Storage device detected
[Sun Jul  9 12:14:48 2023] scsi host6: usb-storage 1-4:1.0
[Sun Jul  9 12:14:49 2023] scsi 6:0:0:0: Direct-Access     Realtek  RTL9210          1.00 PQ: 0 ANSI: 6
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Sense Key : Illegal Request [current] 
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Add. Sense: Invalid field in cdb
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] 0 512-byte logical blocks: (0 B/0 B)
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] 0-byte physical blocks
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Write Protect is off
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Mode Sense: 37 00 00 08
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Sense Key : Illegal Request [current] 
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Add. Sense: Invalid field in cdb
[Sun Jul  9 12:14:49 2023] sd 6:0:0:0: [sdc] Attached SCSI disk
disk
  • 1 个回答
  • 34 Views
Martin Hope
Chris Stryczynski
Asked: 2023-07-02 23:47:19 +0800 CST

当传递的文件路径超过 100 个字符时,crontab 会抛出错误“没有这样的文件或目录”

  • 7
$ touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBBB
$ crontab aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBBB
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: No such file or directory

这种行为看起来很不寻常(注意它如何截断错误消息中的路径)。我正在使用 Debian bullseye 11。

这是一个错误,还是有特定原因导致 crontab 有如此特殊的限制?

我无法在此处的 docker 映像上复制它:https ://hub.docker.com/r/willfarrell/crontab

debian
  • 1 个回答
  • 42 Views
Martin Hope
Chris Stryczynski
Asked: 2023-06-27 01:34:51 +0800 CST

仅当通过 SSH 调用时,Bash 脚本才会出现“未绑定变量”错误

  • 5

当我跑步时:

ssh [email protected] bash -c "/home/devops_staging/deployJob.sh example"

我遇到以下错误:

/home/devops_staging/deployJob.sh: line 4: $1: unbound variable

如果我在没有该bash -c部件的情况下运行它,它会按预期工作。

ssh [email protected] /home/devops_staging/deployJob.sh example
deploy success

为什么会出现这种情况?

这是非常出乎意料的,因为我似乎记得总是使用这种语法,ssh ... bash -c "commands param1 param2"没有任何问题。

有问题的脚本非常简单,我在第 4 行所做的就是分配一个变量$1(这应该是第一个参数):

#!/usr/bin/env bash
set -euo pipefail

CI_PROJECT_NAME="$1"
...

调试时bash -x -c ...我看到以下可疑的行:

 + '[' -z '' ']'
 + return
 + case $- in
 + return
 + /home/devops_staging/deployJob.sh
/home/devops_staging/deployJob.sh: line 4: $1: unbound variable

bash
  • 1 个回答
  • 30 Views
Martin Hope
Chris Stryczynski
Asked: 2022-10-01 02:55:21 +0800 CST

使用 dd 将较小磁盘克隆到较大磁盘后修复 GPT

  • 1

我使用 dd 将较小的磁盘克隆到较大的磁盘上,但是现在启动时出现以下 dmesg 错误:

[Fri Sep 30 11:48:43 2022] GPT:Primary header thinks Alt. header is not at the end of the disk.
[Fri Sep 30 11:48:43 2022] GPT:1953525167 != 3907029167
[Fri Sep 30 11:48:43 2022] GPT:Alternate GPT header not at the end of the disk.
[Fri Sep 30 11:48:43 2022] GPT:1953525167 != 3907029167
[Fri Sep 30 11:48:43 2022] GPT: Use GNU Parted to correct GPT errors.

我该如何解决这个问题?该错误表明使用parted,但我不确定要运行哪些命令?

disk gpt
  • 1 个回答
  • 35 Views
Martin Hope
Chris Stryczynski
Asked: 2022-01-23 10:57:27 +0800 CST

Ubuntu ext4 分区未按预期使用 growpart 或 resize2fs 进行扩展或调整大小

  • 1

我以前在 Linux 系统中使用过growpart并resize2fs调整挂载的在线 ext4 分区的大小。

目前我有一个在 virtualbox 中运行的 Ubuntu 来宾,我想调整分区的大小/dev/sda5。我已经通过 扩展了主机上的虚拟磁盘vboxmanage modifyhd --resize...,但是在运行后(在来宾内)growpart我没有看到分区表有任何变化(我假设它是从 lsblk 返回的值)。

chris@chris-VirtualBox:~$ lsblk
...
sda      8:0    0  53.9G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  37.8G  0 part /
...

调整大小:

chris@chris-VirtualBox:~$ sudo growpart /dev/sda 5
CHANGED: partition=5 start=1052672 old: size=79251456 end=80304128 new: size=111996895 end=113049567
chris@chris-VirtualBox:~$ sudo resize2fs /dev/sda5
resize2fs 1.45.5 (07-Jan-2020)
The filesystem is already 9906432 (4k) blocks long.  Nothing to do!

lsblk仍然显示旧值:

...
sda      8:0    0  53.9G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  37.8G  0 part /
...

这是virtualbox的限制吗?还是有可行的替代方案?


嗯实际上/dev/sda2分区看起来很可疑(它的大小似乎太大了?它是否与/dev/sda5?重叠:

chris@chris-VirtualBox:~$ sudo parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 57.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  538MB   537MB   primary   fat32        boot
 2      539MB   41.1GB  40.6GB  extended
 5      539MB   41.1GB  40.6GB  logical   ext4
partition resize2fs
  • 1 个回答
  • 1909 Views
Martin Hope
Chris Stryczynski
Asked: 2020-02-29 12:08:10 +0800 CST

如何确定 Hydra 中为 Nix nixpkgs 缓存的软件包版本?

  • 5

我试图用旧的 nixpkgs 通道/分支(18.03)构建一个旧的 Haskell 项目。

在我第一次尝试构建它时,我将编译器版本指定为ghc843......但是在构建时 - 当我期望它来自缓存时,它似乎正在构建所有外部库。

幸运的是,我记得我之前遇到过这个问题:调试为什么 nix 在应该在 nixpkgs 二进制缓存中构建一个包时不必要地构建一个包?

问题基本上出在哪里,我使用的是 ghc 的“非默认”版本(Hydra 不会构建/缓存)。

所以现在我的问题是,我怎样才能找出什么是“默认”编译器版本——或者是 Hydra 构建/缓存的那个?

{
  nixpkgs ? import <nixpkgs> {}
, sources ? import ./nix/sources.nix
, compiler ? "ghc843" } :
let
  niv = import sources.nixpkgs {
    overlays = [
      (_ : _ : { niv = import sources.niv {}; })
    ] ;
    config = {};
  };
  pkgs = niv.pkgs;
  myHaskellPackages = pkgs.haskell.packages.${compiler}.override {
  };
in
(myHaskellPackages.callCabal2nix "abc" (./.) {})

碰巧我尝试ghc823了这似乎是默认设置(或者至少在 Hydra 中缓存了资产)。


我想出了如何使用 nix repl 列出可用的 ghc 编译器版本,如下所示:

nix-repl> yolo = (import nix/sources.nix {}) 
nix-repl> yolo.blablaTestTabCompletion
nix-repl> yolo2 = (import yolo.nixpkgs {})
nix-repl> yolo2.haskell.packages.
yolo2.haskell.packages.ghc7103         yolo2.haskell.packages.ghc843
yolo2.haskell.packages.ghc7103Binary   yolo2.haskell.packages.ghcHEAD
yolo2.haskell.packages.ghc802          yolo2.haskell.packages.ghcjs
yolo2.haskell.packages.ghc821Binary    yolo2.haskell.packages.ghcjsHEAD
yolo2.haskell.packages.ghc822          yolo2.haskell.packages.integer-simple
yolo2.haskell.packages.ghc841
nix nixos
  • 1 个回答
  • 678 Views
Martin Hope
Chris Stryczynski
Asked: 2020-02-21 10:35:22 +0800 CST

如何将频道回滚到上一代 Nixos?

  • 3
$ sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
...
 600   2020-01-25 21:01:11   
 601   2020-02-03 13:44:19   
 602   2020-02-09 14:06:20   
 603   2020-02-09 14:11:11   
 604   2020-02-11 00:02:43   
 605   2020-02-13 12:26:22   
 606   2020-02-16 16:40:02   (current)

我怎样才能获得 Nixos 一代的提交/频道生成(这是一件事吗?) - 并可能将频道回滚到它?

或者换句话说,我怎样才能将我的“通道状态”回滚到第 605 代时的状态?


为什么我想知道是因为我做了一个sudo nix-channel --update,sudo nixos-rebuild switch几天前 - 无论发生什么包更新 - 导致系统不稳定。

所以为了缓解这种情况,我启动并继续使用老一代(605)。

我现在想更新我的 Nixos 系统配置中的特定包,并将更改基于605而不是最新的606.


我确实找到了https://stackoverflow.com/questions/39090387/how-to-undo-nix-channel-update ( nix-channel --rollback..) 但是我可能已经更新了几次频道 - 所以“最后一个”频道状态可能不是什么我需要。

我确实注意到您可以指定通道代号作为此命令的参数 - 但我不确定它与 nixos 代之间的关系是什么?它似乎与我尝试605的结果不同:

sudo nix-channel --rollback 605
error: generation 605 does not exist
error: program '/nix/store/cs47wjxwiqgyl1nkjnksyf3s2rb93piq-nix-2.3.2/bin/nix-env' failed with exit code 1
nix nixos
  • 2 个回答
  • 1330 Views
Martin Hope
Chris Stryczynski
Asked: 2020-02-18 16:04:37 +0800 CST

使用带有 Nix 的 Tap 网络在 VM 之间设置网络?

  • 0

我正在尝试在多个虚拟机之间共享网络。

我试过添加:

    qemu.networkingOptions = [
                               "-nic user,model=virtio-net-pci"
                               "-netdev tap,id=mynet0"
                             ];

但是,这会导致以下错误:

qemu-system-x86_64: network script /etc/qemu-ifup failed with status 256

即使以 root 身份运行。我也看不到这个文件的实际位置?这会在客人身上吗?

qemu virtual-machine
  • 2 个回答
  • 1154 Views
Martin Hope
Chris Stryczynski
Asked: 2020-02-16 04:12:42 +0800 CST

为什么是美元!为后台运行的子shell返回错误的进程ID?

  • 4
$(sleep 5) &
echo $!
sleep 1
echo "done"

上述输出:

$ ./test.sh
7483
done

但是,如果我在中搜索sleep,ps aux我会看到:

 ps aux | rg sleep
chris     7484  0.0  0.0 132788  1432 pts/6    S+   12:10   0:00 sleep 1
chris     7485  0.0  0.0 132788  1432 pts/6    S+   12:10   0:00 sleep 5
chris     7519  0.0  0.0  10376  5744 pts/7    S+   12:10   0:00 rg --no-ignore-vcs sleep

sleep 5 进程7485不是7483脚本的输出。这种行为的原因是什么?

shell process
  • 1 个回答
  • 465 Views
Martin Hope
Chris Stryczynski
Asked: 2020-01-15 12:07:51 +0800 CST

如何列出构建生成中引用的所有 nix 存储路径?

  • 1

我正在尝试调试一个问题,其中一台机器上的 nixos 配置在路径中具有可访问的应用程序(它在 中列出/run/current-system/sw/bin),而在具有相同 nixos 配置(减号hardware-configuration.nix等)的另一台机器上却没有。

如何查询 Nixos 一代的所有商店路径?这将通过在机器之间进行比较来帮助我调试问题。

nix nixos
  • 1 个回答
  • 377 Views
Martin Hope
Chris Stryczynski
Asked: 2019-12-19 13:51:55 +0800 CST

如何在 nix 派生中克隆私有 git 存储库

  • 4
{
  nixpkgs ? import <nixpkgs> {}
}:nixpkgs.pkgs.fetchgitPrivate {
        url = "ssh://[email protected]/trycatchchris/blog.git";
        rev = "0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716";
        sha256 = "02951e82c1183aaf1ce4b9669bf9ae32e50c4c641550797eed37739cd4528b58";
      }

我有上面的 nix 表达式,其中 repo 是一个私有 git 存储库。

我确实可以通过我的用户的公钥访问此存储库。

如果我尝试常规nix-build:

nix-build
trace: Please set your nix-path such that ssh-config-file points to a file that will allow ssh to access private repositories. The builder will not be able to see any running ssh agent sessions unless ssh-auth-sock is also set in the nix-path.

Note that the config file and any keys it points to must be readable by the build user, which depending on your nix configuration means making it readable by the build-users-group, the user of the running nix-daemon, or the user calling the nix command which started the build. Similarly, if using an ssh agent ssh-auth-sock must point to a socket the build user can access.

You may need StrictHostKeyChecking=no in the config file. Since ssh will refuse to use a group-readable private key, if using build-users you will likely want to use something like IdentityFile /some/directory/%u/key and have a directory for each build user accessible to that user.

these derivations will be built:
  /nix/store/hlnshdb0ckckih46cv66xj8pyqds6w7y-blog-0f5fe7e.drv
building '/nix/store/hlnshdb0ckckih46cv66xj8pyqds6w7y-blog-0f5fe7e.drv'...
exporting ssh://[email protected]/trycatchchris/blog.git (rev 0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716) into /nix/store/mkinydhkdyg6dyw7fp399m90qw5bsbqd-blog-0f5fe7e
Initialized empty Git repository in /nix/store/mkinydhkdyg6dyw7fp399m90qw5bsbqd-blog-0f5fe7e/.git/
Can't open user config file /var/lib/empty/config: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Can't open user config file /var/lib/empty/config: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Unable to checkout 0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716 from ssh://[email protected]/trycatchchris/blog.git.
builder for '/nix/store/hlnshdb0ckckih46cv66xj8pyqds6w7y-blog-0f5fe7e.drv' failed with exit code 1
error: build of '/nix/store/hlnshdb0ckckih46cv66xj8pyqds6w7y-blog-0f5fe7e.drv' failed

我尝试过使用 ssh 代理以及(来自https://github.com/NixOS/nixpkgs/issues/4004#issuecomment-236434045):

创建一个ssh包含以下内容的文件:

Host gitlab.com
  StrictHostKeyChecking No
  UserKnownHostsFile /dev/null
  IdentityFile /home/chris/.ssh/id_rsa

并运行:

nix-build -I ssh-config-file=$PWD/ssh           
these derivations will be built:
  /nix/store/ng4qdayni3a69b57kfmrvf4ba03ryfv9-blog-0f5fe7e.drv
building '/nix/store/ng4qdayni3a69b57kfmrvf4ba03ryfv9-blog-0f5fe7e.drv'...
exporting ssh://[email protected]/trycatchchris/blog.git (rev 0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716) into /nix/store/mkinydhkdyg6dyw7fp399m90qw5bsbqd-blog-0f5fe7e
Initialized empty Git repository in /nix/store/mkinydhkdyg6dyw7fp399m90qw5bsbqd-blog-0f5fe7e/.git/
Can't open user config file /home/chris/temp/wiptemp/11/ssh: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Can't open user config file /home/chris/temp/wiptemp/11/ssh: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Unable to checkout 0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716 from ssh://[email protected]/trycatchchris/blog.git.
builder for '/nix/store/ng4qdayni3a69b57kfmrvf4ba03ryfv9-blog-0f5fe7e.drv' failed with exit code 1
error: build of '/nix/store/ng4qdayni3a69b57kfmrvf4ba03ryfv9-blog-0f5fe7e.drv' failed

然而这也失败了......我如何使用上述方法或其他方法克隆私人仓库?

nix
  • 1 个回答
  • 2711 Views
Martin Hope
Chris Stryczynski
Asked: 2019-12-11 16:20:22 +0800 CST

为什么/root/目录默认有700权限?

  • 2

我只是注意到默认情况下在 Ubuntu、Debian 和 Nixos 上/root/具有权限。700例如,为什么这与其他目录的处理方式不同/bin/?

/root/除了作为 root 用户的主目录之外,还有什么特别之处?

我想授予用户查看其中目录的权限/root- 但这需要在目录本身上设置可执行权限。(访问子目录时父目录的权限重要吗?)

permissions root
  • 1 个回答
  • 766 Views
Martin Hope
Chris Stryczynski
Asked: 2019-11-21 09:17:30 +0800 CST

即使文件存在,Apache RewriteCond 在“REQUEST_FILENAME”上也不匹配?

  • 0

跟踪日志:

apache_1    | [Wed Nov 20 17:14:43.950796 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] init rewrite engine with requested uri /css/main.css
apache_1    | [Wed Nov 20 17:14:43.950822 2019] [rewrite:trace3] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | [Wed Nov 20 17:14:43.950836 2019] [rewrite:trace4] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] RewriteCond: input='/css/main.css' pattern='-f' => not-matched
apache_1    | [Wed Nov 20 17:14:43.950839 2019] [rewrite:trace3] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | [Wed Nov 20 17:14:43.950842 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] rewrite '/css/main.css' -> '/index.php'
apache_1    | [Wed Nov 20 17:14:43.950845 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] local path result: /index.php
apache_1    | [Wed Nov 20 17:14:43.950850 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] prefixed with document_root to /var/www/html/public/index.php
apache_1    | [Wed Nov 20 17:14:43.950852 2019] [rewrite:trace1] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] go-ahead with /var/www/html/public/index.php [OK]

重要的一点是:

RewriteCond: input='/css/main.css' pattern='-f' => not-matched

为什么找不到文件?它肯定在那里。

配置有:

    DocumentRoot /var/www/html/public/

该文件位于:/var/www/html/public/css/main.css.


在apache上运行strace我看到以下内容:

apache_1    | [pid    11] poll([{fd=9, events=POLLIN}], 1, 3000 <unfinished ...>
apache_1    | [pid    10] <... select resumed> )      = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112492
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112592
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112692
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0} <unfinished ...>
apache_1    | [pid    67] <... epoll_wait resumed> [{EPOLLIN, {u32=3893182512, u64=140578172780592}}], 52, -1) = 1
apache_1    | [pid    59] <... epoll_wait resumed> [{EPOLLIN, {u32=3893182512, u64=140578172780592}}], 52, -1) = 1
apache_1    | [pid    67] accept4(3,  <unfinished ...>
apache_1    | [pid    59] accept4(3,  <unfinished ...>
apache_1    | [pid    67] <... accept4 resumed> {sa_family=AF_INET, sin_port=htons(42176), sin_addr=inet_addr("172.18.0.1")}, [128->16], SOCK_CLOEXEC) = 16
apache_1    | [pid    59] <... accept4 resumed> 0x7fda85ffad30, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
apache_1    | [pid    67] futex(0x7fdae80d3160, FUTEX_WAKE_PRIVATE, 1) = 1
apache_1    | [pid    59] epoll_wait(13,  <unfinished ...>
apache_1    | [pid    67] epoll_wait(13,  <unfinished ...>
apache_1    | [pid    22] <... futex resumed> )       = 0
apache_1    | [pid    22] futex(0x7fdae80d30e8, FUTEX_WAKE_PRIVATE, 1) = 0
apache_1    | [pid    22] getsockname(16, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("172.18.0.3")}, [128->16]) = 0
apache_1    | [pid    22] fcntl(16, F_GETFL)          = 0x2 (flags O_RDWR)
php-main_1  | - -  20/Nov/2019:17:40:08 +0000 "GET /css/main.css" 200
apache_1    | [pid    22] fcntl(16, F_SETFL, O_RDWR|O_NONBLOCK) = 0
apache_1    | [pid    22] read(16, "GET /css/main.css HTTP/1.1\r\nHost"..., 8000) = 90
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966703 2019"..., 249[Wed Nov 20 17:40:08.966703 2019] [rewrite:trace2] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] init rewrite engine with requested uri /css/main.css
apache_1    | ) = 249
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966779 2019"..., 240[Wed Nov 20 17:40:08.966779 2019] [rewrite:trace3] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | ) = 240
apache_1    | [pid    22] stat("/css/main.css", 0x7fdae534f8d0) = -1 ENOENT (No such file or directory)
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966875 2019"..., 259[Wed Nov 20 17:40:08.966875 2019] [rewrite:trace4] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] RewriteCond: input='/css/main.css' pattern='-f' => not-matched
apache_1    | ) = 259
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966925 2019"..., 240[Wed Nov 20 17:40:08.966925 2019] [rewrite:trace3] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | ) = 240
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966980 2019"..., 236[Wed Nov 20 17:40:08.966980 2019] [rewrite:trace2] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] rewrite '/css/main.css' -> '/index.php'

编辑

为什么 Apache 试图阅读/css/main.css?为什么它不在那里使用文档根目录

apache-httpd rewrite
  • 1 个回答
  • 301 Views
Martin Hope
Chris Stryczynski
Asked: 2019-11-04 14:51:15 +0800 CST

lz4压缩只用单核?

  • 4

我正在使用cat largeFile.iso | lz4 -10 -它,它的速度很慢(30mb/s?)。

使用htop我看到它只使用一个核心来100%?我需要指定任何其他参数吗?我似乎在lz4 --help.

我希望它使用多个内核,从而更快地压缩此文件。

compression
  • 1 个回答
  • 1406 Views
Martin Hope
Chris Stryczynski
Asked: 2019-11-04 10:40:41 +0800 CST

调试为什么 nix 在 nixpkgs 二进制缓存中不必要地构建包?

  • 5

我在 IRC 频道中问过这个问题,但我想我会在这里记录它以供我自己和其他人参考。


我有一个 shell.nix 文件需要很长时间才能构建,特别是它似乎正在构建一个HUnit包。

我的 shell.nix 文件如下所示:

{
 sources ? import ./nix/sources.nix
, compiler ? "ghc865" } :
let
  niv = import sources.nixpkgs {
    overlays = [
      (_ : _ : { niv = import sources.niv {}; })
    ] ;
    config = {};
  };
  pkgs = niv.pkgs;
  myHaskellPackages = pkgs.haskell.packages.${compiler}.override {
  };
in
myHaskellPackages.callCabal2nix "moscoviumorange" (./.) {}

并且源被固定到(使用 niv):

{
    "niv": {
        "branch": "master",
        "description": "Easy dependency management for Nix projects",
        "homepage": "https://github.com/nmattia/niv",
        "owner": "nmattia",
        "repo": "niv",
        "rev": "88d6f20882b0422470acbcbf2d1b5f07e1d436f0",
        "sha256": "0wkvz4drnglmmdrz8q1i1yr2fqizpf96k1wq2rlhd8l8x1522izq",
        "type": "tarball",
        "url": "https://github.com/nmattia/niv/archive/88d6f20882b0422470acbcbf2d1b5f07e1d436f0.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    },
    "nixpkgs": {
        "branch": "nixos-19.03",
        "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
        "homepage": "https://github.com/NixOS/nixpkgs",
        "owner": "NixOS",
        "repo": "nixpkgs-channels",
        "rev": "775fb69ed73e7cf6b7d3dd9853a60f40e8efc340",
        "sha256": "1w068b0ydw4c26mcjiwlzdfqcdk3rrwmfx4hxzgfhfwcz2nmh3if",
        "type": "tarball",
        "url": "https://github.com/NixOS/nixpkgs-channels/archive/775fb69ed73e7cf6b7d3dd9853a60f40e8efc340.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    }
}

当我假设它们应该在 nixpkg 的二进制缓存中时,为什么 nix 会构建一堆包?

例如 nix-shell 的输出包括:

building '/nix/store/7011izw8f2xyvhqadrhnmapddyz61f29-HUnit-1.6.0.0.drv'...
nixos
  • 1 个回答
  • 589 Views
Martin Hope
Chris Stryczynski
Asked: 2019-11-04 08:59:41 +0800 CST

Nixos 如何在特定频道中搜索包?

  • 5

nix-env -v -qaP '*'目前返回我所有频道中可用的所有包。

如何指定从特定渠道返回包裹,例如unstable/ 18.03?

nixos
  • 1 个回答
  • 813 Views
Martin Hope
Chris Stryczynski
Asked: 2019-10-10 05:35:44 +0800 CST

如何为 bash 命令失败执行 if 条件?

  • 5

我想要一个非常简单的条件,只有在command失败时才会执行。

在此示例中,它是基于命令成功的条件。

if command ; then
    echo "Command succeeded"
fi

我想要相反的- 我该怎么做?除了做一个比较之外,有没有一种优雅的方式$?

我不想使用||or 运算符 - 它确实在语义上传达了(在我看来)所需的功能。的情况下command || echo "command failed"。

bash
  • 2 个回答
  • 6122 Views
Martin Hope
Chris Stryczynski
Asked: 2019-10-06 14:10:26 +0800 CST

带有 ZSH 的 Nixos ssh - 找不到命令

  • 1

我有一个新的 nixos 虚拟机。我有一个小问题,通过 ssh 运行命令时似乎没有设置 PATH。例如:

ssh [email protected] 'whoami'- 输出:

with zsh:1: command not found: whoami.

这个错误的原因是什么?

nixos
  • 1 个回答
  • 310 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