当前位置:   article > 正文

Manjaro为包管理器pacman和yaourt\yay 添加多线程下载

yay多线程

用轻量级的axle代替了默认的wget来下载升级包。

1. paman添加多线程

编辑pacman.conf文件:
vim /etc/pacman.conf
如果有类似xfercommand的话,注释掉,加上下面这句 :
XferCommand = /usr/bin/axel -n 15 -o %o %u

2. yaourt添加多线程

修改/etc/makepkg.conf:

http::/usr/bin/wget -c -t 3 –waitretry=3 -O %o %u
类似语句改成
http::/usr/bin/axel -o %o %u


附录

1. 我的pacman.conf文件:

  1. ### Pamac configuration file
  2. ## When removing a package, also remove those dependencies
  3. ## that are not required by other packages (recurse option):
  4. #RemoveUnrequiredDeps
  5. ## How often to check for updates, value in hours (0 to disable):
  6. RefreshPeriod = 6
  7. ## When there are no updates available, hide the tray icon:
  8. #NoUpdateHideIcon
  9. ## When applying updates, enable packages downgrade:
  10. #EnableDowngrade
  11. ## Allow Pamac to search and install packages from AUR:
  12. EnableAUR
  13. ## When AUR support is enabled check for updates from AUR:
  14. CheckAURUpdates
  15. ## When check updates from AUR support is enabled check for vcs updates:
  16. #CheckAURVCSUpdates
  17. ## AUR build directory:
  18. BuildDirectory = /var/tmp
  19. ## Number of versions of each package to keep in the cache:
  20. KeepNumPackages = 3
  21. ## Remove only the versions of uninstalled packages when clean cache:
  22. #OnlyRmUninstalled
  23. ## Download updates in background
  24. #DownloadUpdates
  25. ## Maximum Parallel Downloads
  26. MaxParallelDownloads = 4
  27. ## MutiProcessing
  28. XferCommand = /usr/bin/axel -n 5 -a -o %o %u

2. 我的makepkg.conf文件:

  1. #
  2. # /etc/makepkg.conf
  3. #
  4. #########################################################################
  5. # SOURCE ACQUISITION
  6. #########################################################################
  7. #
  8. #-- The download utilities that makepkg should use to acquire sources
  9. # Format: 'protocol::agent'
  10. DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
  11. 'ftp::/usr/bin/axel -n 15 -o %o %u'
  12. 'http::/usr/bin/axel -n 15 -o %o %u'
  13. 'https::/usr/bin/axel -n 15 -o %o %u'
  14. 'rsync::/usr/bin/rsync --no-motd -z %u %o'
  15. 'scp::/usr/bin/scp -C %u %o')
  16. # Other common tools:
  17. # /usr/bin/snarf
  18. # /usr/bin/lftpget -c
  19. # /usr/bin/wget
  20. #-- The package required by makepkg to download VCS sources
  21. # Format: 'protocol::package'
  22. VCSCLIENTS=('bzr::bzr'
  23. 'git::git'
  24. 'hg::mercurial'
  25. 'svn::subversion')
  26. #########################################################################
  27. # ARCHITECTURE, COMPILE FLAGS
  28. #########################################################################
  29. #
  30. CARCH="x86_64"
  31. CHOST="x86_64-pc-linux-gnu"
  32. #-- Compiler and Linker Flags
  33. # -march (or -mcpu) builds exclusively for an architecture
  34. # -mtune optimizes for an architecture, but builds for whole processor family
  35. CPPFLAGS="-D_FORTIFY_SOURCE=2"
  36. CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
  37. CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
  38. LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
  39. #-- Make Flags: change this for DistCC/SMP systems
  40. #MAKEFLAGS="-j2"
  41. #-- Debugging flags
  42. DEBUG_CFLAGS="-g -fvar-tracking-assignments"
  43. DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
  44. #########################################################################
  45. # BUILD ENVIRONMENT
  46. #########################################################################
  47. #
  48. # Defaults: BUILDENV=(!distcc color !ccache check !sign)
  49. # A negated environment option will do the opposite of the comments below.
  50. #
  51. #-- distcc: Use the Distributed C/C++/ObjC compiler
  52. #-- color: Colorize output messages
  53. #-- ccache: Use ccache to cache compilation
  54. #-- check: Run the check() function if present in the PKGBUILD
  55. #-- sign: Generate PGP signature file
  56. #
  57. BUILDENV=(!distcc color !ccache check !sign)
  58. #
  59. #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
  60. #-- specify a space-delimited list of hosts running in the DistCC cluster.
  61. #DISTCC_HOSTS=""
  62. #
  63. #-- Specify a directory for package building.
  64. #BUILDDIR=/tmp/makepkg
  65. #########################################################################
  66. # GLOBAL PACKAGE OPTIONS
  67. # These are default values for the options=() settings
  68. #########################################################################
  69. #
  70. # Default: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
  71. # A negated option will do the opposite of the comments below.
  72. #
  73. #-- strip: Strip symbols from binaries/libraries
  74. #-- docs: Save doc directories specified by DOC_DIRS
  75. #-- libtool: Leave libtool (.la) files in packages
  76. #-- staticlibs: Leave static library (.a) files in packages
  77. #-- emptydirs: Leave empty directories in packages
  78. #-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
  79. #-- purge: Remove files specified by PURGE_TARGETS
  80. #-- debug: Add debugging flags as specified in DEBUG_* variables
  81. #
  82. OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
  83. #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
  84. INTEGRITY_CHECK=(md5)
  85. #-- Options to be used when stripping binaries. See `man strip' for details.
  86. STRIP_BINARIES="--strip-all"
  87. #-- Options to be used when stripping shared libraries. See `man strip' for details.
  88. STRIP_SHARED="--strip-unneeded"
  89. #-- Options to be used when stripping static libraries. See `man strip' for details.
  90. STRIP_STATIC="--strip-debug"
  91. #-- Manual (man and info) directories to compress (if zipman is specified)
  92. MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
  93. #-- Doc directories to remove (if !docs is specified)
  94. DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
  95. #-- Files to be removed from all packages (if purge is specified)
  96. PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
  97. #-- Directory to store source code in for debug packages
  98. DBGSRCDIR="/usr/src/debug"
  99. #########################################################################
  100. # PACKAGE OUTPUT
  101. #########################################################################
  102. #
  103. # Default: put built package and cached source in build directory
  104. #
  105. #-- Destination: specify a fixed directory where all packages will be placed
  106. #PKGDEST=/home/packages
  107. #-- Source cache: specify a fixed directory where source files will be cached
  108. #SRCDEST=/home/sources
  109. #-- Source packages: specify a fixed directory where all src packages will be placed
  110. #SRCPKGDEST=/home/srcpackages
  111. #-- Log files: specify a fixed directory where all log files will be placed
  112. #LOGDEST=/home/makepkglogs
  113. #-- Packager: name/email of the person or organization building packages
  114. #PACKAGER="John Doe <john@doe.com>"
  115. #-- Specify a key to use for package signing
  116. #GPGKEY=""
  117. #########################################################################
  118. # COMPRESSION DEFAULTS
  119. #########################################################################
  120. #
  121. COMPRESSGZ=(gzip -c -f -n)
  122. COMPRESSBZ2=(bzip2 -c -f)
  123. COMPRESSXZ=(xz -c -z -)
  124. COMPRESSLRZ=(lrzip -q)
  125. COMPRESSLZO=(lzop -q)
  126. COMPRESSZ=(compress -c -f)
  127. #########################################################################
  128. # EXTENSION DEFAULTS
  129. #########################################################################
  130. #
  131. # WARNING: Do NOT modify these variables unless you know what you are
  132. # doing.
  133. #
  134. PKGEXT='.pkg.tar.xz'
  135. SRCEXT='.src.tar.gz'

转载于:https://www.cnblogs.com/geoffreyone/p/10336864.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/74506
推荐阅读
相关标签
  

闽ICP备14008679号