Linux系统小知识

换Linux系统快半年了,刚开始总是碰到各种各样的问题,虽然斗解决了,由于没有记录,过一段时间就忘了,故在这里记录一下。

选择国内镜像源:

Manjaro有一个很好用的命令rankmirrors。rankmirrors -h可以查看帮助,如下:

Version 4.16.4
USAGE:
 pacman-mirrors [-h] [-f [NUMBER]] [-i [-d]] [-m METHOD] [--status]
        [-c COUNTRY [COUNTRY...] | [--geoip] | [--continent]]
        [-l] [-lc] [-q] [-t SECONDS] [-v] [-n]
        [--api] [-S/-B BRANCH] [-p PREFIX]
            [-P PROTO [PROTO...]] [-R] [-U URL]

METHODS:
  -i, --interactive     Generate custom mirrorlist
  -f, --fasttrack [NUMBER]
                        Generate mirrorlist with a number of up-to-date mirrors. Overrides : --geoip, --method
  -c, --country COUNTRY [COUNTRY ...]
                        Comma separated list of countries, from which mirrors will be used
  --geoip               Get current country using geolocation
  --continent           Use continent from geolocation

API:
  -a, --api             [-p PREFIX][-R][-S/-B|-G BRANCH][-P PROTO [PROTO ...]]
  -S, -B, --set-branch {stable,stable-staging,testing,unstable}
                        API: Replace branch in configuration
  -p, --prefix PREFIX   API: Set prefix to : $mnt | /mnt/install
  -P, --proto, --protocols {all,http,https,ftp,ftps} [{all,http,https,ftp,ftps} ...]
                        API: Replace protocols in configuration
  -R, --re-branch       API: Replace branch in mirrorlist
  -U, --url URL         API: Replace mirror url in mirrorlist

MISC:
  -G, --get-branch      Return branch from configuration
  -d, --default         INTERACTIVE: Load default mirror file
  -h, --help
  -l, --list, --country-list
                        List all available countries
  -lc, --country-config
                        lists configured mirror countries
  -m, --method {rank,random}
                        Generation method
  -n, --no-mirrorlist   Use to skip generation of mirrorlist
  -q, --quiet           Quiet mode - less verbose output
  -s, --no-status       Ignore mirror branch status
  -t, --timeout SECONDS
                        Maximum waiting time for server response
  -v, --version         Print the pacman-mirrors version
  --no-color
  --interval INTERVAL   Max. number of hours since last sync
  -g                    Create mirror list from active pool.
  --status              Status for the current mirror list.
  --use-async           Experimental async mirror test.

这里我们着重关注一下-f这个参数,这可参数可以直接生成可用的mirrorlist。了解这个参数后直接用rankmirrors -f即可。

Linux系统小知识

上一篇:Linux服务器下配置tomcat宕机自动重启监控机制


下一篇:linux top命令