Debian 12 apt update GPG error: NO_PUBKEY

debian 11 版本更新 到 12,update出现两个错误。

,Hit:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease

Err:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.microsoft.com/debian/12/prod bookworm InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

解决办法:

1 下载 https://packages.microsoft.com/config/debian/12/prod.list 替换 /etc/apt/sources.list.d/microsoft-prod.list

2 直接修改 /etc/apt/sources.list.d/microsoft-prod.list 为以下内容:

deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main

Hit:6 https://packages.sury.org/php bookworm InRelease

W: https://packages.sury.org/php/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Failed to fetch https://packages.microsoft.com/debian/12/prod/dists/bookworm/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
W: Some index files failed to download. They have been ignored, or old ones used instead.

解决办法,执行以下命令:

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

在web页面中使用HTML  Symbol作为URL链接字符

看到一个地址链接中有个图标做链接锚点,尝试下确实可以打开。。。

查看代码里也是符号

<a href="https://api2u.me/tag/📚Curricula.html">📚Curricula</a>

然后直接复制进浏览器地址栏,也是可以的。Google Chrome,Microsoft Edge都可以粘贴。查询下

以前知道在html中显示转义符号,可没想过用Emoji 在代码里可以做连接符号。。。竟然浏览器也都支持了。。。

大致了解了下,我的理解是,其实使用Chromium内核的浏览器本身就可以看作一个 建构在web之上的应用容器,它已经将符号编码转义渲染了一次。所以可以在渲染代码之前就显示符号。

Link Emoji Meaning: Uses, How to Reply & More – wikihow.com

点击上面的链接,打开的页面地址栏会有带有下面图标链接的URL。

我先试试在CMD下的效果。

如果你安装了powershell 可以本机命令,wget https://xn--i-7iq.ws

在命令行窗口内也会显示符号图标

在 linux bash下 curl https://xn--i-7iq.ws 也可以显示,但是与cmd下完全不同。

📚 ❤️🔗

符号在各种编码下的编码

🔗https://www.htmlsymbol.com/unicode-code/1f517.html

Technical information
Name:Link Symbol
Symbol:🔗
Unicode Number:U+1F517
HTML Code:&#128279; &#x1F517;
HTML Entity:
CSS Code:\1F517
UTF-8 Encoding:0x1F517
UTF-16 Encoding:0x0001F517
UTF-32 Encoding:0x000000000001F517
Hex 2700-27BF / Decimal 9984-10175

https://www.w3schools.com/charsets/ref_utf_dingbats.asp

Example

<p>I will display &#9986;</p>
<p>I will display &#x2702;</p>

Will display as:

I will display ✂
I will display ✂

符号在HTML中的使用。

参考站点:

HTML Symbol Unicode symbols, html entities and codes https://www.htmlsymbol.com/

HTML Unicode (UTF-8) Reference https://www.w3schools.com/charsets/ref_html_utf8.asp

符号查询

EmojiXD®️ https://emojixd.com/

EmojiXD是一本线上Emoji百科全书📚,收录了所有emoji,帮你通过分类或者搜索轻松找到合适的表情符号,并了解各种emoji符号的相关知识和使用情景

Letterlike Symbols – https://www.unichar.app/web/

HTML Unicode (UTF-8) Reference – https://graphemica.com/🔗

powershell相关

查看别名

  • 使用Get-Command查看Alias的命令: Get-Command -CommandType Alias
  • 查看此Session中已经设定的所有别名:Get-Aliasgal
  • 查看某别名的原命令,如ls的原命令:Get-Alias ls
  • 查看某原命令的别名,如Get-ChildItem的别名:Get-Alias -Definition Get-ChildItem
  • 按属性获取别名:Get-Alias | Where-Object {$_.Options -Match "ReadOnly"}

Windows 中的兼容性别名

PowerShell 具有多个别名,使 UNIX 和 cmd.exe 用户可以在 Windows 中使用熟悉的命令。 下表显示了常用命令、相关的 PowerShell cmdlet 和 PowerShell 别名:

cmd.exe命令UNIX 命令PowerShell CmdletPowerShell 别名
cdchdircdSet-Locationslcdchdir
clsclearClear-Hostcls clear
copycpCopy-Itemcpicpcopy
deleraserdrmdirrmRemove-Itemrideleraserdrmrmdir
dirlsGet-ChildItemgcidirls
echoechoWrite-Outputwrite echo
mdmkdirNew-Itemni
movemvMove-Itemmimovemi
popdpopdPop-Locationpopd
pwdGet-Locationglpwd
pushdpushdPush-Locationpushd
renmvRename-Itemrniren
typecatGet-Contentgccattype

 备注

此表中的别名特定于 Windows。 某些别名在其他平台上不可用。 这是为了使本机命令能够在 PowerShell 会话中工作。 例如,未在 macOS 或 Linux 上将 ls 定义为 PowerShell 别名,以便运行本机命令而不是 Get-ChildItem

Windows 下GUI编辑工具 PowerShell ISE

单击“开始”,选择“Windows PowerShell”,然后单击“Windows PowerShell ISE”。 或者,可以在任何命令外壳或“运行”框中键入内容。powershell_ise.exe

Linux下安装 powershell

如果你已安装 .NET Core SDK,则可以轻松地安装 PowerShell 作为 .NET 全局工具

sh复制

dotnet tool install --global PowerShell

dotnet 工具安装程序将 ~/.dotnet/tools 添加到 PATH 环境变量中。 但是,当前运行的 shell 没有更新的 PATH。 应该可以通过键入 pwsh 从新 shell 启动 PowerShell。

尝试刷新 DNS 缓存的方法

当计算机首次访问网站时,它会将网站的DNS信息存储在缓存中,并且在下次访问同一网站时,它会在缓存中查找是否存在网站的信息以供使用。如果网站的 DNS 信息自上次访问计算机以来发生更改,则会打开旧版本的站点。

当 DNS指向IP 地址发生更改或缓存错误结果时,通过删除刷新DNS缓存中存储的数据,从而强制计算机查找网站的新 DNS 信息。这样做通常是为了加快该过程并最大限度地减少对相同主机名的请求。DNS缓存可以通过命令行或从浏览器清除。刷新主要操作系统和浏览器的 DNS 缓存,可以尝试以下的步骤:

在 Windows 10 中刷新 DNS
选项 1 – 命令提示符

要重置 DNS 解析程序缓存,请执行以下步骤:

  1. 点按按钮,然后键入Startcmd
  2. 右键单击 ,然后选择 。Command PromptRun as Administrator
  3. 键入,然后按 。(确保斜杠前有一个空格ipconfig /flushdnsEnter)

命令框将在屏幕上闪烁一瞬间,并清除 DNS 解析程序缓存。

此外,您可能还对其他一些相关命令感兴趣:

  • ipconfig /displaydns:它在Windows IP配置下显示您当前的DNS缓存。
  • ipconfig /registerdns:注册记录在主机文件中的 DNS 缓存。
  • ipconfig /release:释放当前的 IP 地址设置。
  • ipconfig /renew:重置并请求新的 IP 地址。
选项 2 – Windows PowerShell
  1. 选择按钮,然后键入Startpowershell
  2. 选择Windows PowerShell
  3. 键入以下命令,然后按 Enter 键:
  4. Clear-DnsClientCache
Chromium 内核浏览器

打开浏览器在地址栏中键入:

Chrome浏览器 chrome://net-internals/#dns

Edge浏览器 edge://net-internals/#dns

点击 Clear host cache 按钮,清理主机缓存

在地址栏中,键入:chrome://net-internals/#sockets

单击 ,然后单击 Close idle socketsFlush socket pools 按钮

systemctl is-enabled 检查服务是否开启自启动

systemctl 命令之后有很多选项和命令。罗列几个常用的命令。

#service --status-all

#列出全部服务
systemctl list-units --type=service

#查看一个服务的状态,列出有没有正在执行、开机时是否启动等信息。
systemctl status 服务名.service

#开启服务自启动,下次开机服务启动
systemctl enable 服务名.service

#禁用服务自启动,下次开机时,服务不会被启动
systemctl disable 服务名.service

#检查一个服务是否正在运行
systemctl is-active 服务名.service

#检查一个服务的设置,是否为自启动的
systemctl is-enabled 服务名.service


systemctl [command] [unit]

systemctl start  #立刻启动后面接的 unit。
systemctl stop  #立刻关闭后面接的 unit。
systemctl restart  #重启动服务,先关闭再启动的意思。
systemctl reload  #不关闭 unit 的情况下,重新载入配置文件,让设置生效。
systemctl kill  #杀死一个服务的所有子进程。
systemctl show  #列出 unit 的配置。
systemctl mask  #注销 unit,注销后你就无法启动这个 unit 了。
systemctl unmask  #取消对 unit 的注销。

systemctl daemon-reload #重新加载服务配置文件

在 .Net 6/7 中修改配置让生成项目时版本号自增长

项目里先添加一个“程序集信息文件” :AssemblyInfo.cs

[assembly: AssemblyVersion("1.0.0.*")] //修订号为*
//[assembly: AssemblyFileVersion("1.0.0.0")] //此行文件版本注释掉

双击项目文件,进行编辑,在<PropertyGroup>节点中加入以下内容:

<!-- 自定义版本开关-->
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<Deterministic>False</Deterministic>

		<VersionSuffix>1.0.1.$([System.DateTime]::UtcNow.ToString(mmff))</VersionSuffix>
		<AssemblyVersion Condition=" '$(VersionSuffix)' == '' ">0.0.0.1</AssemblyVersion>
		<AssemblyVersion Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix)</AssemblyVersion>
		<Version Condition=" '$(VersionSuffix)' == '' ">0.0.1.0</Version>
		<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix)</Version>
<!-- 自定义版本开关-->

然后生成就行了,每次文件版本最后的修订号根据时间递增。

我个人是这样用的,也可以按自己习惯自己改下。

使用 .htpasswd 对文件目录进行用户验证

先确定需要密码保护的目录(该目录中的所有子目录和文件也将受密码保护),然后参考下面的文本制作 .htaccess 文件。

.htaccess 文件示例1 :

AuthName "Member's Area Name"
AuthUserFile /path/to/password/file/.htpasswd
AuthType Basic
Require valid-user

.htaccess 文件示例2 :

AuthType Basic
AuthName "Password Required"
AuthUserFile "/www/passwords/password.file"
AuthGroupFile "/www/passwords/group.file"
Require group admins

.htgroup 文件(AuthGroupFile)用户组是可选的。

网址调用

.htpasswd 中设置的密码和用户名, 可以使用URL直接调用:

http://xyz.net?AAA 【仅一个参数的字符串被解释为密码

http://xyz.net?AAA:BBB 【用分号分隔的两个字符串被解释为用户名和密码

相关页面

OpenLiteSpeed 下配置 .htpasswd

在线生成 .htpasswd

https://htpasswd.org/ (生成用户名和密码组合(每行一个))

https://wtools.io/generate-htpasswd-online (不能选择加密方式)

https://tool.oschina.net/htpasswd (中文 – – 在线 htpasswd 生成器)

如何从 Debian 10 (Buster) 升级到 Debian 11 (Bullseye)

先查看确认Debian的版本

cat /etc/os-release
cat /etc/debian_version
lsb_release -a

更新包存储库:

将 /etc/apt/sources.list 文件中的 buster 关键字替换为 bullseye

sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list

或者直接去这个地址生成一个sources.list文件,保存下来替换:

https://mirrors.ustc.edu.cn/repogen/

之后先更新下系统的软件包列表:

sudo apt update

再下一步,执行最小系统更新 upgrade --without-new-pkgs

执行完整的系统升级将删除系统中保留的大量软件包。因此,分两阶段的方法将 Debian 10 升级到 Debian 11。先进行最小升级,之后再进行完全升级。

在最小更新将只升级当前软件包,而不安装新软件包或删除现有软件包。执行以下命令:

sudo apt upgrade --without-new-pkgs

在此过程中,如果屏幕出现选择提示,要求重新启动系统服务或保留或删除配置选项。 一般都单击“是”,按回车键继续。

此步升级完成后,我们执行完整的系统升级(full-upgrade)将系统升级到 Debian 11。会安装 Debian 11 附带的最新软件包并解决依赖问题。

sudo apt full-upgrade

会再出现几次提示。比如Openssh提示做什么操作。选择了保留当前安装的选项,确定ok下一步。

等待完全升级完成,就可以重新启动系统了。

重启后,再查看系统发行版本信息。已经升级至Debian 11(bulleye)

cat /etc/os-release
cat /etc/debian_version
lsb_release -a

另外,wsl 下默认安装的debian执行“lsb_release -a”查看发行版本,会提示:“lsb_release: command not found”

需要执行安装 lsb_release

apt-get install -y lsb-release

解决windows下访问WSL文件拒绝访问

通过文件管理器直接访问 \\wsl$ 编辑linux子系统文件时提示文件拒绝访问。

原因是因为你启动linux的非管理员账号

解决方法
如果是这样的话,需要修改默认登录用户为root即可,修改方式如下:

C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\debian.exe config --default-user root

修改完成后重启wsl,如下:

关闭wsl:wsl --shutdown
之后,在重新启动wsl

VPS下检测虚拟化方式的工具

imvirt

http://micky.ibh.net/~liske/imvirt.html

virt-what

https://people.redhat.com/~rjones/virt-what/

另外,wsl下执行“lsb_release -a”查看发行版本,会提示:“lsb_release: command not found”

执行命令安装 lsb_release

apt-get install -y lsb-release