给Archlinux添加blackarch仓库镜像源

我可没干坏事啊

2020.11 目测有效,不保证该方法以后可能过时,建议自行翻阅官方文档。

导入仓库和设置国内镜像

导入仓库

按照官方文档来:

下载官网的脚本

curl -O https://blackarch.org/strap.sh

修改权限:

chmod +x strap.sh

运行

./strap.sh

然后应该就好了

看看是不是装好了:

pacman -Sg | grep blackarch

然后更新一下

sudo pacman -Syyu

这时候应该会给你安装blackarch-keying这个包,然后就可以用了

镜像源

修改/etc/pacman.conf,在最后加上

[blackarch]
Server = http://mirrors.uestc.cn/blackarch/$repo/os/$arch

Server请改成你在那里提供服务而且网速比较快的,比如tuna的

[blackarch]
Server = https://mirrors.tuna.tsinghua.edu.cn/blackarch/$repo/os/$arch

为何要写这么水的一篇博客

我之前谷歌随手搜出了ustc的镜像使用帮助,然后就开始了飘红报错,试了一圈中文的解决方案,并没有用。 (当然中文博客基本都过时了,还是有很多好好写的,不止CSDN,比如这个:用 Arch Linux 打造完美渗透环境

报错:

error: blackarch: key "F9A6E68A711354D84A9B91637533BAFE69A25079" is unknown
:: Import PGP key F9A6E68A711354D84A9B91637533BAFE69A25079? [Y/n] Y
Y
error: key "F9A6E68A711354D84A9B91637533BAFE69A25079" could not be looked up remotely
:: Synchronizing package databases...


error: blackarch: key "F9A6E68A711354D84A9B91637533BAFE69A25079" is unknown
:: Import PGP key F9A6E68A711354D84A9B91637533BAFE69A25079? [Y/n] 
error: key "F9A6E68A711354D84A9B91637533BAFE69A25079" could not be looked up remotely
error: failed to update blackarch (invalid or corrupted database (PGP signature))
error: failed to synchronize all databases

发现中文的几个解决方案全都过时了。安装blackarch-keying导入key会产生先有鸡还是先有蛋的问题。

$ sudo pacman -S blackarch-keyring
error: blackarch: key "F9A6E68A711354D84A9B91637533BAFE69A25079" is unknown
:: Import PGP key F9A6E68A711354D84A9B91637533BAFE69A25079? [Y/n] Y
error: key "F9A6E68A711354D84A9B91637533BAFE69A25079" could not be looked up remotely
error: database 'blackarch' is not valid (invalid or corrupted database (PGP signature))

转了一圈还是翻了官方文档,世界瞬间清净了。

[+] installing blackarch keyring...

loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) blackarch-keyring-20140118-3

Total Installed Size:  0.04 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                         [#######################################] 100%
(1/1) checking package integrity                                       [#######################################] 100%
(1/1) loading package files                                            [#######################################] 100%
(1/1) checking for file conflicts                                      [#######################################] 100%
:: Processing package changes...
(1/1) installing blackarch-keyring                                     [#######################################] 100%
==> Appending keys from blackarch.gpg...
gpg: public key DB323392796CA067 is 3037 days newer than the signature
gpg: public key CF66D153D884358F is 16 seconds newer than the signature
==> Locally signing trusted keys in keyring...
  -> Locally signing key A0917C4147A37007CB54C1CFD295AA940EFDDF62...
  -> Locally signing key 4345771566D76038C7FEB43863EC0ADBEA87E4E3...
  -> Locally signing key CBA3C7D4798912702DCF568E67D8BDF42AD93F4E...
  -> Locally signing key 8F9A9793CB8591147C2EC70566E0CDBD1E01F333...
==> Importing owner trust values...
gpg: inserting ownertrust of 4
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
==> Updating trust database...
gpg: key 1EB2638FF56C0C53: no user ID for key signature packet of class 10
gpg: key 1EB2638FF56C0C53: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: public key DB323392796CA067 is 3037 days newer than the signature
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: public key CF66D153D884358F is 16 seconds newer than the signature
gpg: depth: 0  valid:   1  signed:  56  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:  56  signed:  81  trust: 1-, 0q, 0n, 55m, 0f, 0u
gpg: depth: 2  valid:  77  signed:  26  trust: 77-, 0q, 0n, 0m, 0f, 0u
gpg: next trustdb check due at 2020-12-03
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Appending keys from archlinuxcn.gpg...
==> Appending keys from archlinux.gpg...
==> Appending keys from blackarch.gpg...
==> Appending keys from endeavouros.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key 57957BAD5D038B07C28EF49A15B26377262268C1...
  -> Locally signing key 9AF7EED0F7CE3639965C85619BA8AAAAAAAAAAAA...
  -> Locally signing key 87F2E316E0ABC98B9DE8D4EF042FD810600954EF...
  -> Locally signing key 99399D88F7B752BF364CD485A85E3925A6211F05...
  -> Locally signing key 90403E12F4CE5E0E950E4AD2C96492E347202001...
  -> Locally signing key F905932C85D705FD2A3CC9E47C63370395FF0792...
  -> Locally signing key 1F255DC97A5431001F9D01F8CDABD988DD8AD93B...
  -> Locally signing key D8AFDDA07A5B6EDFA7D8CCDAD6D055F927843F1C...
  -> Locally signing key 4A6D297E6F74638E4D5F8E99152AC7B5F7608B26...
  -> Locally signing key 4B1DE545A801D4549BFD3FEF90CB3D62C13D4796...
  -> Locally signing key DC6FB7FC761E848F76E98B4FCCAF35548C65530F...
  -> Locally signing key 0AABCAF6773D5B6E1F4ECF794E72AF09097DAE2E...
  -> Locally signing key A0917C4147A37007CB54C1CFD295AA940EFDDF62...
  -> Locally signing key 43A253584139DC6D923B6EFC34F1E61A0EEB4F51...
  -> Locally signing key 3167205DC1F2582F226007FAB012733142D79E59...
  -> Locally signing key 9BE836747F3533EAABA99F1485AEA2926167AD32...
  -> Locally signing key 708DFB13CBED9AB39449DBFB41C04120C297B594...
  -> Locally signing key F357BC80BE28C292B40ECEC8997995DF61A0959A...
  -> Locally signing key DDB867B92AA789C165EEFA799B729B06A680C281...
  -> Locally signing key 7B314BE77DBCA20E02DDBBC050BF8B712DCAD7EA...
  -> Locally signing key D88390B2991F8242FABD2A3C07F45E2A1937DD32...
  -> Locally signing key 53641635F498CDD60227A7ED0832F151DB0FB18E...
  -> Locally signing key 1C874172781545C15399D4CF7E9BA67AD5E38E78...
  -> Locally signing key 38009E1FD96C320609BF05870A5BAD445D80C1CC...
  -> Locally signing key 4CFF42599833CF3AE98A2F098850CBC20940E3F9...
  -> Locally signing key 1C9084FAFE017CEAE4AF59C91DF6CF104433578C...
  -> Locally signing key 1D5AB52A241CC492A724FE14E8D79E63E3D142F3...
  -> Locally signing key 356690A1E7404E30D0E902B2E64D049594A54F54...
  -> Locally signing key 0285FB6900D102030550F20A34908FFBC0BFAC35...
  -> Locally signing key 1B53ED6B05A88B45FE02AE6186CC4303D870877E...
  -> Locally signing key 02E02B85AF209AA00F784A1DD48313B447CD9E46...
  -> Locally signing key BEA7E7644AE093AB557E521A26D9876AC0719A0B...
  -> Locally signing key 4345771566D76038C7FEB43863EC0ADBEA87E4E3...
  -> Locally signing key 48ADDE10F27BAFB47BB0CCAF2D2595A00D08ACE0...
  -> Locally signing key CBA3C7D4798912702DCF568E67D8BDF42AD93F4E...
  -> Locally signing key 2AC4CFDB42972D38F105800BC0EB1AA4536A8318...
  -> Locally signing key B5971F2C5C10A9A08C60030F786C63F330D7CB92...
  -> Locally signing key 8F9A9793CB8591147C2EC70566E0CDBD1E01F333...
  -> Locally signing key D87D10B4E132FFA40DEC232B7A3A9FA6E4FD4A8D...
  -> Locally signing key 21E347C47A6A13CDE64713CBAE62544C55609060...
  -> Locally signing key 22D8A46B2CDA6605A1C0CFD1E060B3E215CE49BB...
  -> Locally signing key 83F817213361BF5F02E7E124F9F9FA97A403F63E...
  -> Locally signing key 243C14E5339E1B88EDCB29C595FC83B3084A5ADD...
  -> Locally signing key 86EEEC214D245137446F4AB195304B04071CCDB4...
  -> Locally signing key CF73A9AE20AD483CE51130E0303A369BE11E4BE7...
  -> Locally signing key A0B55B12351C08FED81DAAF4840A50A14EEF0D58...
  -> Locally signing key 481C4474AF1572165AE4C6AF3FDDD575826C5C30...
  -> Locally signing key 91FFE0700E80619CEB73235CA88E23E377514E00...
  -> Locally signing key 7028E1F320C45EE98473B1C35F1BC1A1BF2B11D0...
  -> Locally signing key 688E1D093C3638F588890D4450268311C7AD3F62...
  -> Locally signing key 00e716120987a801cd25070828d10c49a44f261e...
  -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
  -> Locally signing key 9AD42FE922425C9D93E60B43BAD2804227A0AF05...
  -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...
  -> Locally signing key C41D545A576AC1FE4DBE90C9B6CF41D1879E8002...
  -> Locally signing key 504357523094066C67E56CF58D99AA5CAD3908B0...
  -> Locally signing key 1FDBDCE2D26BD8F100EE2E73B1B9AAD8BE7E7326...
  -> Locally signing key 5984EA8F3C6C92945EB2EE40BE378C0A19C6421B...
==> Importing owner trust values...
==> Disabling revoked keys in keyring...
  -> Disabling key 8F76BEEA0289F9E1D3E229C05F946DED983D4366...
  -> Disabling key 63F395DE2D6398BBE458F281F2DBB4931985A992...
  -> Disabling key 50F33E2E5B0C3D900424ABE89BDCF497A4BBCC7F...
  -> Disabling key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
  -> Disabling key 39F880E50E49A4D11341E8F939E4F17F295AFBF4...
  -> Disabling key 8840BD07FC24CB7CE394A07CCF7037A4F27FB7DA...
  -> Disabling key 5559BC1A32B8F76B3FCCD9555FA5E5544F010D48...
  -> Disabling key 0B20CA1931F5DA3A70D0F8D2EA6836E1AB441196...
  -> Disabling key 07DFD3A0BC213FA12EDC217559B3122E2FA915EC...
  -> Disabling key 4FCF887689C41B09506BE8D5F3E1D5C5D30DB0AD...
  -> Disabling key 2A83ADADD054CB3C4CF7DF9D2D1E72461CCBBA98...
  -> Disabling key 5A2257D19FF7E1E0E415968CE62F853100F0D0F0...
  -> Disabling key 4E43CCE7ADF712FF75C7B4A5EF50AB125C83BB2D...
  -> Disabling key D921CABED130A5690EF1896E81AF739EC0711BF1...
  -> Disabling key 7FA647CD89891DEDC060287BB9113D1ED21E1A55...
  -> Disabling key BC1FBE4D2826A0B51E47ED62E2539214C6C11350...
  -> Disabling key 24F24E986EB2FE628DBDD3CFB9E701221C820178...
  -> Disabling key 4A8B17E20B88ACA61860009B5CED81B7C2E5C0D2...
  -> Disabling key 417A75A94D7DCA0FE37EBA89BF971BB9D4D40A3B...
  -> Disabling key 5696C003B0854206450C8E5BE613C09CB4440678...
  -> Disabling key AA0CBF3859E580B97D9F04638FDE3D8FC99F40AE...
  -> Disabling key 684148BB25B49E986A4944C55184252D824B18E8...
  -> Disabling key 8CF934E339CAD8ABF342E822E711306E3C4F88BC...
  -> Disabling key F5A361A3A13554B85E57DDDAAF7EF7873CFD4BB6...
  -> Disabling key 5E7585ADFF106BFFBBA319DC654B877A0864983E...
  -> Disabling key 65EEFE022108E2B708CBFCF7F9E712E59AF5F22A...
  -> Disabling key 40440DC037C05620984379A6761FAD69BA06C6A9...
  -> Disabling key 34C5D94FE7E7913E86DC427E7FB1A3800C84C0A5...
  -> Disabling key 1A60DC44245D06FEF90623D6EEEEE2EEEE2EEEEE...
  -> Disabling key 81D7F8241DB38BC759C80FCE3A726C6170E80477...
  -> Disabling key 86F797B20DE062D8540D6D243CD72EBFE6DE17D8...
  -> Disabling key A373F9E056E8E4912F842CF596D6420DD2E3A1F0...
  -> Disabling key E7210A59715F6940CF9A4E36A001876699AD6E84...
  -> Disabling key 5357F3B111688D88C1D88119FCF2CB179205AC90...
  -> Disabling key 4D913AECD81726D9A6C74F0ADA6426DD215B37AD...
  -> Disabling key FB871F0131FEA4FB5A9192B4C8880A6406361833...
  -> Disabling key 66BD74A036D522F51DD70A3C7F2A16726521E06D...
  -> Disabling key 487EACC08557AD082088DABA1EB2638FF56C0C53...
  -> Disabling key B1F2C889CB2CCB2ADA36D963097D629E437520BD...
  -> Disabling key 9515D8A8EAB88E49BB65EDBCE6B456CAF15447D5...
  -> Disabling key 76B4192E902C0A52642C63C273B8ED52F1D357C1...
  -> Disabling key 40776A5221EF5AD468A4906D42A1DB15EC133BAD...
  -> Disabling key D4DE5ABDE2A7287644EAC7E36D1A9E70E19DAA50...
  -> Disabling key 44D4A033AC140143927397D47EFD567D4C7EA887...
==> Updating trust database...
gpg: next trustdb check due at 2020-12-03

[+] keyring installed successfully
[+] updating package databases
:: Synchronizing package databases...
 core                                      129.9 KiB  6.34 MiB/s 00:00 [---------------------------------------] 100%
 extra                                    1634.4 KiB  4.09 MiB/s 00:00 [---------------------------------------] 100%
 community                                   5.2 MiB  11.1 MiB/s 00:00 [---------------------------------------] 100%
 multilib                                  154.2 KiB  7.53 MiB/s 00:00 [---------------------------------------] 100%
 endeavouros                                14.2 KiB  0.00   B/s 00:00 [---------------------------------------] 100%
 archlinuxcn                              1354.5 KiB  11.0 MiB/s 00:00 [---------------------------------------] 100%
 blackarch                                   3.3 MiB   500 KiB/s 00:07 [---------------------------------------] 100%
 blackarch.sig                             566.0   B  0.00   B/s 00:00 [---------------------------------------] 100%
Packages (2) blackarch-keyring-20180925-2  perl-expect-1.35-6

Total Download Size:   0.07 MiB
Total Installed Size:  0.15 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
 blackarch-keyring-20180925-2-any                                                                   18.1 KiB  0.00   B/s 00:00 [-----------------------------------------------------------------------------] 100%
 perl-expect-1.35-6-any                                                                             50.9 KiB  1698 KiB/s 00:00 [-----------------------------------------------------------------------------] 100%
(2/2) checking keys in keyring                                                                                                 [-----------------------------------------------------------------------------] 100%
(2/2) checking package integrity                                                                                               [-----------------------------------------------------------------------------] 100%
(2/2) loading package files                                                                                                    [-----------------------------------------------------------------------------] 100%
(2/2) checking for file conflicts                                                                                              [-----------------------------------------------------------------------------] 100%
:: Processing package changes...
(1/2) upgrading blackarch-keyring                                                                                              [-----------------------------------------------------------------------------] 100%
==> Appending keys from blackarch.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key A0917C4147A37007CB54C1CFD295AA940EFDDF62...
  -> Locally signing key 4345771566D76038C7FEB43863EC0ADBEA87E4E3...
  -> Locally signing key CBA3C7D4798912702DCF568E67D8BDF42AD93F4E...
  -> Locally signing key 8F9A9793CB8591147C2EC70566E0CDBD1E01F333...
==> Importing owner trust values...
==> Disabling revoked keys in keyring...
  -> Disabling key 5E210889BBB5C48500E0C4F9C75E985FF8B993B4...
==> Updating trust database...
gpg: key 1EB2638FF56C0C53: no user ID for key signature packet of class 10
gpg: key 1EB2638FF56C0C53: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: key 786C63F330D7CB92: no user ID for key signature packet of class 10
gpg: public key DB323392796CA067 is 3037 days newer than the signature
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: public key CF66D153D884358F is 16 seconds newer than the signature
gpg: depth: 0  valid:   1  signed:  56  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:  56  signed:  81  trust: 1-, 0q, 0n, 55m, 0f, 0u
gpg: depth: 2  valid:  77  signed:  26  trust: 77-, 0q, 0n, 0m, 0f, 0u
gpg: next trustdb check due at 2020-12-03
(2/2) upgrading perl-expect                                                                                                    [-----------------------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Warn about old perl modules
:: Searching databases for updates...
:: Searching AUR for updates...
 -> python-pgspecial: local (1.11.10-2) is newer than blackarch (1.11.10-1)
 there is nothing to do

事实证明还是得看官方文档解决问题,以后直接看官方文档啊同志们!

CSDN和一堆过时文档害人啊!

参考

  1. https://github.com/BlackArch/blackarch
  2. https://www.blackarch.org/downloads.html#install-repo