【Linux】Ubuntu 22.04 升级 nodejs 到 v18
Ubuntu 22.04 已经安装的nodejs 版本 nodejs is already the newest version (12.22.9~dfsg-1ubuntu3.3).
删除以前的 nodejs 版本:
1. sudo apt remove nodejs
root@erp:~# sudo apt remove nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:gyp libintl-perl libintl-xs-perl libjs-events libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl libjs-source-map libjs-sprintf-jslibjs-typedarray-to-buffer libmodule-find-perl libmodule-scandeps-perl libnode-dev libnode72 libnotify-bin libproc-processtable-perl libsort-naturally-perllibuv1-dev node-abbrev node-ansi-regex node-ansi-styles node-ansistyles node-are-we-there-yet node-arrify node-asap node-asynckit node-balanced-matchnode-brace-expansion node-chownr node-clean-yaml-object node-color-convert node-color-name node-commander node-core-util-is node-decompress-responsenode-delayed-stream node-delegates node-depd node-diff node-encoding node-end-of-stream node-err-code node-escape-string-regexp node-fancy-lognode-foreground-child node-fs.realpath node-function-bind node-get-stream node-glob node-growl node-has-flag node-has-unicode node-hosted-git-infonode-iconv-lite node-iferr node-imurmurhash node-indent-string node-inflight node-inherits node-ini node-ip node-ip-regex node-is-buffer node-is-plain-objnode-is-typedarray node-isarray node-isexe node-json-parse-better-errors node-jsonparse node-kind-of node-lodash-packages node-lowercase-keys node-lru-cachenode-mimic-response node-minimatch node-minimist node-minipass node-mute-stream node-negotiator node-npm-bundled node-once node-osenv node-p-cancelablenode-p-map node-path-is-absolute node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-pump node-quick-lru node-readnode-readable-stream node-resolve node-retry node-safe-buffer node-set-blocking node-signal-exit node-slash node-slice-ansi node-source-mapnode-spdx-correct node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids node-sprintf-js node-stealthy-require node-string-decodernode-supports-color node-text-table node-time-stamp node-tmatch node-typedarray-to-buffer node-universalify node-util-deprecatenode-validate-npm-package-license node-webidl-conversions node-whatwg-fetch node-wrappy node-yallist nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:node-abab node-agent-base node-aproba node-archy node-argparse node-builtins node-cacache node-chalk node-cli-table node-clone node-colors node-columnifynode-combined-stream node-console-control-strings node-copy-concurrently node-coveralls node-cssom node-cssstyle node-debug node-defaults node-esprimanode-events node-fetch node-form-data node-fs-write-stream-atomic node-gauge node-got node-graceful-fs node-gyp node-https-proxy-agent node-js-yamlnode-jsdom node-json-buffer node-lcov-parse node-log-driver node-mime node-mime-types node-mkdirp node-move-concurrently node-ms node-noptnode-normalize-package-data node-npm-package-arg node-npmlog node-object-assign node-opener node-psl node-punycode node-read-package-json node-rimrafnode-run-queue node-semver node-source-map-support node-ssri node-stack-utils node-string-width node-strip-ansi node-tap node-tap-mocha-reporternode-tap-parser node-tar node-tough-cookie node-unique-filename node-validate-npm-package-name node-wcwidth.js node-which node-wide-alignnode-write-file-atomic node-ws nodejs npm
0 upgraded, 0 newly installed, 71 to remove and 65 not upgraded.
After this operation, 14.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 175903 files and directories currently installed.)
Removing node-coveralls (3.1.1-1) ...
Removing node-fetch (2.6.7+~2.5.12-1) ...
Removing node-jsdom (19.0.0+~cs90.11.27-1) ...
Removing node-abab (2.0.5-2) ...
Removing npm (8.5.1~ds-1) ...
Removing node-ws (8.5.0+~cs13.3.3-2) ...
Removing node-https-proxy-agent (5.0.0+~cs8.0.0-3) ...
Removing node-agent-base (6.0.2+~cs5.4.2-1) ...
Removing node-cacache (15.0.5+~cs13.9.21-3) ...
Removing node-move-concurrently (1.0.1-4) ...
Removing node-copy-concurrently (1.0.5-8) ...
Removing node-run-queue (2.0.0-2) ...
Removing node-archy (1.0.0-4) ...
Removing node-tap (12.0.1+ds-4) ...
Removing node-tap-mocha-reporter (3.0.7+ds-2) ...
Removing node-tap-parser (7.0.0+ds1-6) ...
Removing node-js-yaml (4.1.0+dfsg+~4.0.5-6) ...
Removing node-argparse (2.0.1-2) ...
Removing node-npm-package-arg (8.1.5-1) ...
Removing node-validate-npm-package-name (3.0.0-4) ...
Removing node-builtins (4.0.0-1) ...
Removing node-chalk (4.1.2-1) ...
Removing node-cli-table (0.3.11+~cs0.13.3-1) ...
Removing node-columnify (1.5.4+~1.5.1-1) ...
Removing node-gyp (8.4.1-1) ...
Removing node-npmlog (6.0.1+~4.1.4-1) ...
Removing node-gauge (4.0.2-1) ...
Removing node-wide-align (1.1.3-4) ...
Removing node-string-width (4.2.3+~cs13.2.3-1) ...
Removing node-wcwidth.js (1.0.2-1) ...
Removing node-defaults (1.0.3+~1.0.3-1) ...
Removing node-clone (2.1.2-3) ...
Removing node-colors (1.4.0-3) ...
Removing node-form-data (3.0.1-1) ...
Removing node-combined-stream (1.0.8+~1.0.3-1) ...
Removing node-console-control-strings (1.1.0-2) ...
Removing node-cssstyle (2.3.0-2) ...
Removing node-cssom (0.4.4-3) ...
Removing node-debug (4.3.2+~cs4.1.7-1) ...
Removing node-esprima (4.0.1+ds+~4.0.3-2) ...
Removing node-events (3.3.0+~3.0.0-2) ...
Removing node-fs-write-stream-atomic (1.0.10-5) ...
Removing node-got (11.8.3+~cs58.7.37-1) ...
Removing node-graceful-fs (4.2.4+repack-1) ...
Removing node-json-buffer (3.0.1-1) ...
Removing node-lcov-parse (1.0.0+20170612git80d039574ed9-5) ...
Removing node-log-driver (1.2.7+git+20180219+bba1761737-7) ...
Removing node-mime-types (2.1.33-1) ...
Removing node-mime (3.0.0+dfsg+~cs3.96.1-1) ...
Removing node-tar (6.1.11+ds1+~cs6.0.6-1) ...
Removing node-mkdirp (1.0.4+~1.0.2-1) ...
Removing node-ms (2.1.3+~cs0.7.31-2) ...
Removing node-nopt (5.0.0-2) ...
Removing node-read-package-json (4.1.1-1) ...
Removing node-normalize-package-data (3.0.3+~2.4.1-1) ...
Removing node-object-assign (4.1.1-6) ...
Removing node-opener (1.5.2+~1.4.0-1) ...
Removing node-tough-cookie (4.0.0-2) ...
Removing node-psl (1.8.0+ds-6) ...
Removing node-punycode (2.1.1-5) ...
Removing node-rimraf (3.0.2-1) ...
Removing node-semver (7.3.5+~7.3.8-1) ...
Removing node-source-map-support (0.5.21+ds+~0.5.4-1) ...
Removing node-ssri (8.0.1-2) ...
Removing node-stack-utils (2.0.5+~2.0.1-1) ...
Removing node-strip-ansi (6.0.1-1) ...
Removing node-unique-filename (1.1.1+ds-1) ...
Removing node-which (2.0.2+~cs1.3.2-2) ...
Removing node-write-file-atomic (3.0.3+~3.0.2-1) ...
Removing node-aproba (2.0.0-2) ...
Removing nodejs (12.22.9~dfsg-1ubuntu3.3) ...
Processing triggers for man-db (2.10.2-1) ...
2. sudo apt autoremove
root@erp:~# sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:gyp libintl-perl libintl-xs-perl libjs-events libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl libjs-source-map libjs-sprintf-jslibjs-typedarray-to-buffer libmodule-find-perl libmodule-scandeps-perl libnode-dev libnode72 libnotify-bin libproc-processtable-perl libsort-naturally-perllibuv1-dev node-abbrev node-ansi-regex node-ansi-styles node-ansistyles node-are-we-there-yet node-arrify node-asap node-asynckit node-balanced-matchnode-brace-expansion node-chownr node-clean-yaml-object node-color-convert node-color-name node-commander node-core-util-is node-decompress-responsenode-delayed-stream node-delegates node-depd node-diff node-encoding node-end-of-stream node-err-code node-escape-string-regexp node-fancy-lognode-foreground-child node-fs.realpath node-function-bind node-get-stream node-glob node-growl node-has-flag node-has-unicode node-hosted-git-infonode-iconv-lite node-iferr node-imurmurhash node-indent-string node-inflight node-inherits node-ini node-ip node-ip-regex node-is-buffer node-is-plain-objnode-is-typedarray node-isarray node-isexe node-json-parse-better-errors node-jsonparse node-kind-of node-lodash-packages node-lowercase-keys node-lru-cachenode-mimic-response node-minimatch node-minimist node-minipass node-mute-stream node-negotiator node-npm-bundled node-once node-osenv node-p-cancelablenode-p-map node-path-is-absolute node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-pump node-quick-lru node-readnode-readable-stream node-resolve node-retry node-safe-buffer node-set-blocking node-signal-exit node-slash node-slice-ansi node-source-mapnode-spdx-correct node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids node-sprintf-js node-stealthy-require node-string-decodernode-supports-color node-text-table node-time-stamp node-tmatch node-typedarray-to-buffer node-universalify node-util-deprecatenode-validate-npm-package-license node-webidl-conversions node-whatwg-fetch node-wrappy node-yallist nodejs-doc
0 upgraded, 0 newly installed, 122 to remove and 65 not upgraded.
After this operation, 81.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 172820 files and directories currently installed.)
Removing gyp (0.1+20210831gitd6c5dd5-5) ...
Removing libintl-xs-perl (1.26-3build2) ...
Removing libintl-perl (1.26-3build2) ...
Removing libjs-events (3.3.0+~3.0.0-2) ...
Removing nodejs-doc (12.22.9~dfsg-1ubuntu3.3) ...
Removing libjs-highlight.js (9.18.5+dfsg1-1) ...
Removing node-are-we-there-yet (3.0.0+~1.1.0-1) ...
Removing node-readable-stream (3.6.0+~cs3.0.0-1) ...
Removing node-glob (7.2.1+~cs7.6.15-1) ...
Removing node-inherits (2.0.4-4) ...
Removing libjs-inherits (2.0.4-4) ...
Removing node-typedarray-to-buffer (4.0.0-2) ...
Removing node-is-typedarray (1.0.0-4) ...
Removing libjs-is-typedarray (1.0.0-4) ...
Removing libjs-psl (1.8.0+ds-6) ...
Removing node-source-map (0.7.0++dfsg2+really.0.6.1-9) ...
Removing libjs-source-map (0.7.0++dfsg2+really.0.6.1-9) ...
Removing node-sprintf-js (1.1.2+ds1+~1.1.2-1) ...
Removing libjs-sprintf-js (1.1.2+ds1+~1.1.2-1) ...
Removing libjs-typedarray-to-buffer (4.0.0-2) ...
Removing libmodule-find-perl (0.15-1) ...
Removing libmodule-scandeps-perl (1.31-1) ...
Removing libnode-dev (12.22.9~dfsg-1ubuntu3.3) ...
Removing libnode72:amd64 (12.22.9~dfsg-1ubuntu3.3) ...
Removing node-growl (1.10.5-4) ...
Removing libnotify-bin (0.7.9-3ubuntu5.22.04.1) ...
Removing libproc-processtable-perl:amd64 (0.634-1build1) ...
Removing libsort-naturally-perl (1.03-2) ...
Removing libuv1-dev:amd64 (1.43.0-1) ...
Removing node-abbrev (1.1.1+~1.1.2-1) ...
Removing node-ansi-regex (5.0.1-1) ...
Removing node-slice-ansi (5.0.0+~cs9.0.0-4) ...
Removing node-ansi-styles (4.3.0+~4.2.0-1) ...
Removing node-ansistyles (0.1.3-5) ...
Removing node-minimist (1.2.5+~cs5.3.2-1) ...
Removing node-arrify (2.0.1-2) ...
Removing node-asap (2.0.6+~2.0.0-1) ...
Removing node-asynckit (0.4.0-4) ...
Removing node-minimatch (3.1.1+~3.0.5-1) ...
Removing node-brace-expansion (2.0.1-1) ...
Removing node-balanced-match (2.0.0-1) ...
Removing node-chownr (2.0.0-1) ...
Removing node-clean-yaml-object (0.1.0-5) ...
Removing node-color-convert (2.0.1-1) ...
Removing node-color-name (1.1.4+~1.1.1-2) ...
Removing node-commander (9.0.0-2) ...
Removing node-core-util-is (1.0.3-1) ...
Removing node-decompress-response (6.0.0-2) ...
Removing node-delayed-stream (1.0.0-5) ...
Removing node-delegates (1.0.0-3) ...
Removing node-depd (2.0.0-2) ...
Removing node-diff (5.0.0~dfsg+~5.0.1-3) ...
Removing node-minipass (3.1.6+~cs8.7.18-1) ...
Removing node-encoding (0.1.13-2) ...
Removing node-get-stream (6.0.1-1) ...
Removing node-pump (3.0.0-5) ...
Removing node-end-of-stream (1.4.4+~1.4.1-1) ...
Removing node-promise-retry (2.0.1-2) ...
Removing node-err-code (2.0.3+dfsg-3) ...
Removing node-p-map (4.0.0+~3.1.0+~3.0.1-1) ...
Removing node-escape-string-regexp (4.0.0-2) ...
Removing node-fancy-log (1.3.3+~cs1.3.1-2) ...
Removing node-foreground-child (2.0.0-3) ...
Removing node-fs.realpath (1.0.0-2) ...
Removing node-resolve (1.20.0+~cs5.27.9-1) ...
Removing node-function-bind (1.1.1+repacked+~1.0.3-1) ...
Removing node-supports-color (8.1.1+~8.1.1-1) ...
Removing node-has-flag (4.0.0-2) ...
Removing node-has-unicode (2.0.1-4) ...
Removing node-hosted-git-info (4.0.2-1) ...
Removing node-iconv-lite (0.6.3-2) ...
Removing node-iferr (1.0.2+~1.0.2-1) ...
Removing node-imurmurhash (0.1.4+dfsg+~0.1.1-1) ...
Removing node-indent-string (4.0.0-2) ...
Removing node-inflight (1.0.6-2) ...
Removing node-ini (2.0.1-1) ...
Removing node-ip (1.1.5+~1.1.0-1) ...
Removing node-ip-regex (4.3.0+~4.1.1-1) ...
Removing node-kind-of (6.0.3+dfsg-2) ...
Removing node-is-buffer (2.0.5-2) ...
Removing node-is-plain-obj (3.0.0-2) ...
Removing node-isarray (2.0.5-3) ...
Removing node-isexe (2.0.0+~2.0.1-4) ...
Removing node-json-parse-better-errors (1.0.2+~cs3.3.1-1) ...
Removing node-jsonparse (1.3.1-10) ...
Removing node-lodash-packages (4.17.21+dfsg+~cs8.31.198.20210220-5) ...
Removing node-lowercase-keys (2.0.0-2) ...
Removing node-lru-cache (6.0.0+~5.1.1-1) ...
Removing node-mimic-response (3.1.0-7) ...
Removing node-promzard (0.3.0-2) ...
Removing node-read (1.0.7-3) ...
Removing node-mute-stream (0.0.8+~0.0.1-1) ...
Removing node-negotiator (0.6.2+~0.6.1-1) ...
Removing node-npm-bundled (1.1.2-1) ...
Removing node-once (1.4.0-4) ...
Removing node-osenv (0.1.5+~0.1.0-1) ...
Removing node-p-cancelable (2.1.1-1) ...
Removing node-path-is-absolute (2.0.0-2) ...
Removing node-process-nextick-args (2.0.1-2) ...
Removing node-promise-inflight (1.0.1+~1.0.0-1) ...
Removing node-quick-lru (5.1.1-1) ...
Removing node-retry (0.13.1+~0.12.1-1) ...
Removing node-string-decoder (1.3.0-5) ...
Removing node-safe-buffer (5.2.1+~cs2.1.2-2) ...
Removing node-set-blocking (2.0.0-2) ...
Removing node-signal-exit (3.0.6+~3.0.1-1) ...
Removing node-slash (3.0.0-2) ...
Removing node-validate-npm-package-license (3.0.4-2) ...
Removing node-spdx-correct (3.1.1-2) ...
Removing node-spdx-expression-parse (3.0.1+~3.0.1-1) ...
Removing node-spdx-exceptions (2.3.0-2) ...
Removing node-spdx-license-ids (3.0.11-1) ...
Removing node-stealthy-require (1.1.1-5) ...
Removing node-text-table (0.2.0-4) ...
Removing node-time-stamp (2.2.0-1) ...
Removing node-tmatch (5.0.0-4) ...
Removing node-universalify (2.0.0-3) ...
Removing node-util-deprecate (1.0.2-3) ...
Removing node-webidl-conversions (7.0.0~1.1.0+~cs15.1.20180823-2) ...
Removing node-whatwg-fetch (3.6.2-5) ...
Removing node-wrappy (1.0.2-2) ...
Removing node-yallist (4.0.0+~4.0.1-1) ...
Processing triggers for man-db (2.10.2-1) ...
安装 nodejs v18
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
查看 nodejs 版本
nodejs -v
v18.19.0
遇到的问题
2024-02-07 16:59:23 - Error: Failed to run ‘apt-get update’ (Exit Code: 0)
root@erp:~# curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
2024-02-07 16:59:10 - Installing pre-requisites
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
Hit:2 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:4 http://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease
Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
Hit:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
Hit:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease
Hit:7 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Ign:8 https://www.collaboraoffice.com/repos/CollaboraOnline/23.05/customer-deb- ./ InRelease
Get:9 https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2204 ./ InRelease [1,728 B]
Err:9 https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2204 ./ InReleaseThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0C54D189F4BA284D
Get:10 https://www.collaboraoffice.com/repos/CollaboraOnline/23.05/customer-deb- ./ Release
Ign:11 https://www.collaboraoffice.com/repos/CollaboraOnline/23.05/customer-deb- ./ Release.gpgReading package lists... Done
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: GPG error: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2204 ./ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0C54D189F4BA284D
E: The repository 'https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2204 ./ 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.
E: The repository 'https://www.collaboraoffice.com/repos/CollaboraOnline/23.05/customer-deb- ./ Release' 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.
2024-02-07 16:59:23 - Error: Failed to run 'apt-get update' (Exit Code: 0)
查看是 CollaboraOnline 造成的
cd /etc/apt/sources.list.d/
# 修改或者删除CollaboraOnline list
sudo apt-get update # 问题解决
相关文章:
【Linux】Ubuntu 22.04 升级 nodejs 到 v18
Ubuntu 22.04 已经安装的nodejs 版本 nodejs is already the newest version (12.22.9~dfsg-1ubuntu3.3). 删除以前的 nodejs 版本: 1. sudo apt remove nodejs rooterp:~# sudo apt remove nodejs Reading package lists... Done Building dependency tree..…...
当go get获取不到软件包时
当使用go get命令获取软件包时,如果无法成功获取,您可以尝试以下方法来解决问题: 检查网络连接:首先,确保您的计算机能够访问互联网,并且没有任何网络防火墙或代理设置阻止了go get命令的正常运行。 设置代…...

全网最详细解法|同济大学|高等数学|第八版|习题1-5
文章目录 全网最详细解法|同济大学|高等数学|第八版|习题1-5|5.1全网最详细解法|同济大学|高等数学|第八版|习题1-5|5.2 全网最详细解法|同济大学…...

可视化工具:将多种数据格式转化为交互式图形展示的利器
引言 在数据驱动的时代,数据的分析和理解对于决策过程至关重要。然而,不同的数据格式和结构使得数据的解读变得复杂和困难。为了解决这个问题,一种强大的可视化工具应运而生。这个工具具有将多种数据格式(包括JSON、YAML、XML、C…...

[嵌入式AI从0开始到入土]14_orangepi_aipro小修补含yolov7多线程案例
[嵌入式AI从0开始到入土]嵌入式AI系列教程 注:等我摸完鱼再把链接补上 可以关注我的B站号工具人呵呵的个人空间,后期会考虑出视频教程,务必催更,以防我变身鸽王。 第1期 昇腾Altas 200 DK上手 第2期 下载昇腾案例并运行 第3期 官…...

机器学习、深度学习、强化学习、迁移学习的关联与区别
Hi,大家好,我是半亩花海。本文主要了解并初步探究机器学习、深度学习、强化学习、迁移学习的关系与区别,通过清晰直观的关系图展现出四种“学习”之间的关系。虽然这四种“学习”方法在理论和应用上存在着一定的区别,但它们之间也…...
苹果为什么需要台积电3nm工艺芯片?
据《经济日报》报道,苹果公司的产品线将迎来重大升级。下一代应用于iPad、MacBook和iPhone的M4和A18处理器预计将会增加内置AI计算核心的数量,从而大幅提高AI运算能力。这一变化将导致对台积电(TSMC)订单的显著增长。据悉…...
力扣:53. 最大子数组和
解题思路: 1.先把数组为空和数组的长度为1时的特殊情况分别开来。声明一个sum变量用于计算数组中的连续子数组的总和值 。在声明一个guo变量用于一种接收sum中的前i-1的总和。另一种接收sum中前i的总和,主要根据sum的值来判断是接收的哪一种。在声明一个…...

幻兽帕鲁Palworld专用服务器CPU内存配置怎么选择?
腾讯云幻兽帕鲁服务器配置怎么选?根据玩家数量选择CPU内存配置,4到8人选择4核16G、10到20人玩家选择8核32G、2到4人选择4核8G、32人选择16核64G配置,腾讯云百科txybk.com来详细说下腾讯云幻兽帕鲁专用服务器CPU内存带宽配置选择方法ÿ…...
学习总结11
KMP算法 全称Knuth-Morris-Pratt算法,是一种字符串匹配算法。该算法的目的是在一个文本串S内查找一个模式串P的出现位置。 KMP算法的核心思想是利用模式串自身的特性来避免不必要的字符比较。算法通过构建一个部分匹配表(也称为next数组)&a…...
Hadoop运行环境搭建
模板虚拟机环境准备 1)准备一台模板虚拟机hadoop100,虚拟机配置要求如下: 模板虚拟机:内存4G,硬盘50G,安装必要环境,为安装hadoop做准备 [roothadoop100 ~]# yum install -y epel-release [r…...

CTFshow web(php命令执行59-67)
web59 <?php /* # -*- coding: utf-8 -*- # Author: Lazzaro # Date: 2020-09-05 20:49:30 # Last Modified by: h1xa # Last Modified time: 2020-09-07 22:02:47 # email: h1xactfer.com # link: https://ctfer.com */ // 你们在炫技吗? if(isset($_POST…...

03、全文检索 -- Solr -- Solr 身份验证配置(给 Solr 启动身份验证、添加用户、删除用户)
目录 全文检索 -- Solr -- Solr 身份验证配置启用身份验证:添加用户:删除用户: 全文检索 – Solr – Solr 身份验证配置 学习之前需要先启动 Solr 执行如下命令即可启动Solr: solr start -p <端口>如果不指定端口…...

怎么使用ChatGPT提高工作效率?
怎么使用ChatGPT提高工作效率,这是一个有趣的话题。 相信不同的人有不同的观点,大家的知识背景和从事的工作都不完全相同,所以最终ChatGPT能起到的作用也不一样。 在编程过程中,如果我们要找一个库,我们最先做的肯定…...

【微服务】skywalking自定义告警规则使用详解
目录 一、前言 二、SkyWalking告警功能介绍 2.1 SkyWalking告警是什么 2.2 为什么需要SkyWalking告警功能 2.2.1 及时发现系统异常 2.2.2 保障和提升系统稳定性 2.2.3 避免数据丢失 2.2.4 提高故障处理效率 三、 SkyWalking告警规则 3.1 SkyWalking告警规则配置 3.2 …...

BUGKU-WEB 矛盾
题目描述 进入场景看看: 代码如下: $num$_GET[num]; if(!is_numeric($num)) { echo $num; if($num1) echo flag{**********}; }解题思路 需要读懂一下这段PHP代码的意思明显是一道get相关的题目,需要提供一个num的参数,然后需要传入一个不…...

2024-02-11 Unity 编辑器开发之编辑器拓展2 —— 自定义窗口
文章目录 1 创建窗口类2 显示窗口3 窗口事件回调函数4 窗口中常用的生命周期函数5 编辑器窗口类中的常用成员6 小结 1 创建窗口类 当想为 Unity 拓展一个自定义窗口时,只需实现继承 EditorWindow 的类即可,并在该类的 OnGUI 函数中编写面板控件相关的…...

Python 读取pdf文件
Python 实现读取pdf文件简单示例。 安装命令 需要安装操作pdf的三方类库,命令如下: pip install pdfminer3K 安装过程如下: 引入类库 需要引入很多的类库。 示例如下: import sys import importlib importlib.reload(sys)fr…...
人究其一生只是在通用智能模型基础上作微调和对齐
Yann LeCun 在 WGS 上说: 目前的LLM不可能走到AGI,原因很简单,现在训练这些LLM所使用的数据量为10万亿个令牌,也就是130亿个词,如果你计算人类阅读这些数据需要多长时间,一个人每天阅读8小时,需…...

DS:二叉树的链式结构及实现
创作不易,友友们给个三连吧!! 一、前言 前期我们解释过二叉树的顺序结构(堆)为什么比较适用于完全二叉树,因为如果用数组来实现非完全二叉树,那么数组的中间部分就可能会存在大量的空间浪费。 …...

【JavaEE】-- HTTP
1. HTTP是什么? HTTP(全称为"超文本传输协议")是一种应用非常广泛的应用层协议,HTTP是基于TCP协议的一种应用层协议。 应用层协议:是计算机网络协议栈中最高层的协议,它定义了运行在不同主机上…...

【项目实战】通过多模态+LangGraph实现PPT生成助手
PPT自动生成系统 基于LangGraph的PPT自动生成系统,可以将Markdown文档自动转换为PPT演示文稿。 功能特点 Markdown解析:自动解析Markdown文档结构PPT模板分析:分析PPT模板的布局和风格智能布局决策:匹配内容与合适的PPT布局自动…...

Psychopy音频的使用
Psychopy音频的使用 本文主要解决以下问题: 指定音频引擎与设备;播放音频文件 本文所使用的环境: Python3.10 numpy2.2.6 psychopy2025.1.1 psychtoolbox3.0.19.14 一、音频配置 Psychopy文档链接为Sound - for audio playback — Psy…...

04-初识css
一、css样式引入 1.1.内部样式 <div style"width: 100px;"></div>1.2.外部样式 1.2.1.外部样式1 <style>.aa {width: 100px;} </style> <div class"aa"></div>1.2.2.外部样式2 <!-- rel内表面引入的是style样…...

算法:模拟
1.替换所有的问号 1576. 替换所有的问号 - 力扣(LeetCode) 遍历字符串:通过外层循环逐一检查每个字符。遇到 ? 时处理: 内层循环遍历小写字母(a 到 z)。对每个字母检查是否满足: 与…...
MySQL JOIN 表过多的优化思路
当 MySQL 查询涉及大量表 JOIN 时,性能会显著下降。以下是优化思路和简易实现方法: 一、核心优化思路 减少 JOIN 数量 数据冗余:添加必要的冗余字段(如订单表直接存储用户名)合并表:将频繁关联的小表合并成…...
C#学习第29天:表达式树(Expression Trees)
目录 什么是表达式树? 核心概念 1.表达式树的构建 2. 表达式树与Lambda表达式 3.解析和访问表达式树 4.动态条件查询 表达式树的优势 1.动态构建查询 2.LINQ 提供程序支持: 3.性能优化 4.元数据处理 5.代码转换和重写 适用场景 代码复杂性…...

spring Security对RBAC及其ABAC的支持使用
RBAC (基于角色的访问控制) RBAC (Role-Based Access Control) 是 Spring Security 中最常用的权限模型,它将权限分配给角色,再将角色分配给用户。 RBAC 核心实现 1. 数据库设计 users roles permissions ------- ------…...

【Vue】scoped+组件通信+props校验
【scoped作用及原理】 【作用】 默认写在组件中style的样式会全局生效, 因此很容易造成多个组件之间的样式冲突问题 故而可以给组件加上scoped 属性, 令样式只作用于当前组件的标签 作用:防止不同vue组件样式污染 【原理】 给组件加上scoped 属性后…...
Ubuntu 可执行程序自启动方法
使用 autostart(适用于桌面环境) 适用于 GNOME/KDE 桌面环境(如 Ubuntu 图形界面) 1. 创建 .desktop 文件 sudo vi ~/.config/autostart/my_laser.desktop[Desktop Entry] TypeApplication NameMy Laser Program Execbash -c &…...