Zeta.
2024-02-17 09:44 deepin
运行您的脚本后报了一个错误
Zero@Zero-PC:~/Desktop/apt$ sudo bash aptupdate.sh
请输入密码:
验证成功
+ DEB_FOLDERS=./deb
+ [email protected]
+ APT_CONF=/etc/apt-ftparchive.conf
+ pushd ./deb
+ [[ -d dists/stable/main/binary-amd64/ ]]
+ [[ -d pool/main ]]
+ dpkg-scanpackages --arch amd64 pool/
dpkg-scanpackages: info: Wrote 0 entries to output Packages file.
+ cat dists/stable/main/binary-amd64/Packages
+ gzip -9
+ apt-ftparchive release dists/stable
+ Origin=ppwq
+ Label=ppwq
+ Codename=stable
+ Version=2024
+ Architectures=amd64
+ Components=main
+ Description='ppwq packages'
+ tee /etc/apt-ftparchive.conf
Origin: ppwq
Label: ppwq
Codename: stable
Version: 2024
Architectures: amd64
Components: main
Description: ppwq packages
+ sed -i '1r /etc/apt-ftparchive.conf' dists/stable/Release
+ gpg --default-key [email protected] -abs
+ cat dists/stable/Release
gpg: 传递给‘--default-key’的所有值被忽略
gpg: 签名时失败: 对设备不适当的 ioctl 操作
gpg: signing failed: 对设备不适当的 ioctl 操作
下面是我添加我的信息的脚本和gpg命令
gpg --gen-key
gpg --armor --export [email protected] > zhsoft.gpg
脚本:
#!/usr/bin/env bash
set -eux
DEB_FOLDERS="./"
GPG_KEY="[email protected]"
APT_CONF="/etc/apt-ftparchive.conf"
pushd "$DEB_FOLDERS" >/dev/null 2>&1
[[ -d "dists/stable/main/binary-amd64/" ]] || mkdir -p dists/stable/main/binary-amd64/
[[ -d "pool/main" ]] || mkdir -p pool/main
dpkg-scanpackages --arch amd64 pool/ > dists/stable/main/binary-amd64/Packages
cat dists/stable/main/binary-amd64/Packages | gzip -9 > dists/stable/main/binary-amd64/Packages.gz
apt-ftparchive release dists/stable > dists/stable/Release
# Add deb info to head
Origin=ppwq
Label=ppwq
Codename=stable
Version=2024
Architectures=amd64
Components=main
Description="$Origin packages"
tee $APT_CONF << EOF
Origin: $Origin
Label: $Label
Codename: $Codename
Version: $Version
Architectures: $Architectures
Components: $Components
Description: $Description
EOF
sed -i "1r $APT_CONF" dists/stable/Release
cat dists/stable/Release | gpg --default-key "$GPG_KEY" -abs > dists/stable/Release.gpg
cat dists/stable/Release | gpg --default-key "$GPG_KEY" -abs --clearsign > dists/stable/InRelease
popd > /dev/null 2>&1
Reply Like 0 View the author
一、APT 服务器配置
以方式一为例:
输入对应的
Real name
和Email address
后,按 O 确定,显示下图按
TAB 键
选择OK
,回车确认回车确认
...
后续的操作同上
...
最终显示
debfetch.sh
https://framagit.org/-/snippets/7181
源码:
环境变量
执行脚本
比如
或者,将 deb 文件保存到
pool/main
下,再执行脚本更新autoindex on
,如桌面客户端
https://framagit.org/-/snippets/7181
get.sh
源码:
更新源