查看系统版本
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
# cat /etc/issue
Ubuntu 20.04.4 LTS \n \l
安装curl命令
- 直接执行命令 sudo apt-get install curl ,如果有报错,请参照第二步
Ign:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.10
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.10
404 Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.68.0-1ubuntu2.10_amd64.deb 404 Not Found [IP: 185.125.190.39 80]
E: Internal Error, ordering was unable to handle the media swap
- 若第一步出现报错,请更新源后再安装,即先执行命令:sudo apt-get update, 成功后再执行命令:
sudo apt install curl
安装wget命令
背景
Ubuntu 20.04.4 LTS
安装方法如下
1.1.获取源码
curl -o wget-1.20.tar.gz ftp://ftp.gnu.org/gnu/wget/wget-1.20.tar.gz
1.2.解压源码
tar -xvf wget-1.20.tar.gz && rm -rf wget-1.20.tar.gz
2.3.切换到源码目录
cd wget-1.20
2.4.安装一些依赖的包或库
sudo apt-get install pkg-config
sudo apt-get install zlib1g-dev
2.4.配置
./configure --prefix=/usr --sysconfdir=/etc --with-ssl=openssl
–prefix指定安装目录,–sysconfdir指定系统配置存放路径,–with-ssl指定加入ssl功能,并且使用的是openssl
2.5 编译
make -j2 (2表示cpu个数)
2.6 安装
sudo make install (要使用最高权限进行安装)
安装cmake命令
wget https://github.com/Kitware/CMake/releases/download/v3.20.3/cmake-3.20.3.tar.gz
tar -zxvf cmake-3.20.3.tar.gz
cd cmake-3.20.3/
./bootstrap
make && sudo make install
帮助手册
[root@localhost ~]# cmake --version
cmake version 3.20.3
[root@localhost ~]# cmake --help
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
cmake [options] -S <path-to-source> -B <path-to-build>
指定源目录,以便在当前工作目录中(重新)为其生成生成系统。指定现有的生成目录以重新生成其生成系统。
Options
-S <path-to-source> = 显式指定源目录
-B <path-to-build> = 显式指定构建目录
-C <initial-cache> = 预加载一个脚本来填充缓存
-D <var>[:<type>]=<value> = 创建或更新cmake缓存条目
-U <globbing_expr> = 从CMake缓存中删除匹配的条目
-G <generator-name> = 指定生成系统生成器
-T <toolset-name> = 如果生成器支持,请指定工具集名称
-A <platform-name> = 如果生成器支持,请指定平台名称
-Wdev = Enable developer warnings.
-Wno-dev = Suppress developer warnings.
-Werror=dev = Make developer warnings errors.
-Wno-error=dev = Make developer warnings not errors.
-Wdeprecated = Enable deprecation warnings.
-Wno-deprecated = Suppress deprecation warnings.
-Werror=deprecated = Make deprecated macro and function warnings
errors.
-Wno-error=deprecated = Make deprecated macro and function warnings
not errors.
-E = CMake command mode.
-L[A][H] = List non-advanced cached variables.
--build <dir> = Build a CMake-generated project binary tree.
--install <dir> = Install a CMake-generated project binary
tree.
--open <dir> = Open generated project in the associated
application.
-N = View mode only.
-P <file> = Process script mode.
--find-package = Run in pkg-config like mode.
--graphviz=[file] = Generate graphviz of dependencies, see
CMakeGraphVizOptions.cmake for more.
--system-information [file] = Dump information about this system.
--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>
= Set the verbosity of messages from CMake
files. --loglevel is also accepted for
backward compatibility reasons.
--debug-trycompile = Do not delete the try_compile build tree.
Only useful on one try_compile at a time.
--debug-output = Put cmake in a debug mode.
--trace = Put cmake in trace mode.
--trace-expand = Put cmake in trace mode with variable
expansion.
--trace-source=<file> = Trace only this CMake file/module. Multiple
options allowed.
--trace-redirect=<file> = Redirect trace output to a file instead of
stderr.
--warn-uninitialized = Warn about uninitialized values.
--warn-unused-vars = Warn about unused variables.
--no-warn-unused-cli = Don't warn about command line options.
--check-system-vars = Find problems with variable usage in system
files.
--help,-help,-usage,-h,-H,/? = Print usage information and exit.
--version,-version,/V [<f>] = Print version number and exit.
--help-full [<f>] = Print all help manuals and exit.
--help-manual <man> [<f>] = Print one help manual and exit.
--help-manual-list [<f>] = List help manuals available and exit.
--help-command <cmd> [<f>] = Print help for one command and exit.
--help-command-list [<f>] = List commands with help available and exit.
--help-commands [<f>] = Print cmake-commands manual and exit.
--help-module <mod> [<f>] = Print help for one module and exit.
--help-module-list [<f>] = List modules with help available and exit.
--help-modules [<f>] = Print cmake-modules manual and exit.
--help-policy <cmp> [<f>] = Print help for one policy and exit.
--help-policy-list [<f>] = List policies with help available and exit.
--help-policies [<f>] = Print cmake-policies manual and exit.
--help-property <prop> [<f>] = Print help for one property and exit.
--help-property-list [<f>] = List properties with help available and
exit.
--help-properties [<f>] = Print cmake-properties manual and exit.
--help-variable var [<f>] = Print help for one variable and exit.
--help-variable-list [<f>] = List variables with help available and exit.
--help-variables [<f>] = Print cmake-variables manual and exit.
事件产生器
The following generators are available on this platform (* marks default):
* Unix Makefiles = Generates standard UNIX makefiles.
Green Hills MULTI = Generates Green Hills MULTI files
(experimental, work-in-progress).
Ninja = Generates build.ninja files.
Watcom WMake = Generates Watcom WMake makefiles.
CodeBlocks - Ninja = Generates CodeBlocks project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
CodeLite - Ninja = Generates CodeLite project files.
CodeLite - Unix Makefiles = Generates CodeLite project files.
Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
Sublime Text 2 - Unix Makefiles
= Generates Sublime Text 2 project files.
Kate - Ninja = Generates Kate project files.
Kate - Unix Makefiles = Generates Kate project files.
Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
You know why everyone’s targeting you? Because you’re not strong enough!