1、准备安装环境

sudo apt-get install python python-twisted python-openssl python-setuptools intltool python-xdg python-chardet geoip-database python-libtorrent python-notify python-pygame python-glade2 librsvg2-common xdg-utils python-mako python-dev

2、获取源码并安装

(1)获取源码

git clone git://deluge-torrent.org/deluge.git
cd deluge
git checkout -b master remotes/origin/master

(2)安装

python setup.py build
sudo python setup.py install --install-layout=deb

如果出现 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 错误,执行:

sudo apt-get install python-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python-pip

3、配置 deluge 和 deluge-web 服务

sudo cp packaging/systemd/deluged.service /etc/systemd/system/deluged.service
sudo cp packaging/systemd/deluge-web.service /etc/systemd/system/deluge-web.service

4、启动 deluged 和 deluge-web 服务,并设置自启动

sudo systemctl start deluged
sudo systemctl enable deluged

sudo systemctl start deluge-web
sudo systemctl enable deluge-web

5、开启远程访问(可选)

deluge-web默认只允许本地访问。默认端口:8112,默认密码:deluge

#启用远程访问
deluge-console "config -s allow_remote True"

#禁用远程访问
deluge-console "config allow_remote"

访问地址:http://你的IP:8112

deluge web

卸载 Deluge

sudo systemctl stop deluge-web
sudo systemctl disable deluge-web
sudo systemctl stop deluged
sudo systemctl disable deluged
sudo rm -rf /etc/systemd/system/deluge*

sudo rm -rf /usr/bin/deluge*

sudo rm -rf /usr/lib/python2.7/dist-packages/deluge*

MySQL

1、安装 MySQL 源

wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm

2、选择想要安装的版本

使用MySQL Yum repository 时,默认选择安装MySQL的最新GA版本。 如果是你想要安装的,你可以跳到下一步,用 Yum 安装 MySQL。

yum repolist all | grep mysql

如果安装最新的GA版本,不需要进行任何配置。 要从最新GA版本以外的特定版本 安装最新版本,请在运行安装命令之前禁用最新GA版本的子 repository 并启用特定版本的子 repository。执行以下命令来执行此操作,这些命令禁用8.0版本的子 repository 并启用5.7版本的子 repository:

sudo yum-config-manager --disable mysql80-community
sudo yum-config-manager --enable mysql57-community

运行以下命令并检查其输出来验证是否已启用和禁用了正确的子 repository

yum repolist enabled | grep mysql

3、开始安装 MySQL

sudo yum install mysql-community-server

4、启动 MySQL 服务

sudo systemctl start mysqld.service

检查 MySQL 是否正确启动:

sudo systemctl status mysqld.service

5、修改登录密码

通过以下命令查看默认的临时密码:

sudo grep 'temporary password' /var/log/mysqld.log

登录 MySQL

mysql -u root -p

修改密码,并使密码生效 (注意 NewPassword 替换为你想要设置的登录密码) :

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
FLUSH PRIVILEGES;

6、开启 root 用户远程访问(可选)

执行以下命令(注意 Password 替换为你想要设置的登录密码):

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

官方英文安装文档:https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

系统要求:

要安装Docker CE,仅支持以下Ubuntu 64位版本:

  • Cosmic 18.10
  • Bionic 18.04 (LTS)
  • Xenial 16.04 (LTS)

Docker CE 支持 x86_64,amd64, armhf, arm64, s390x (IBM Z), and ppc64le (IBM Power) 架构.

安装 Docker CE

1、卸载旧版 Docker

老版本的 Docker 被称为 dockerdocker.io 或 docker-engine 。如果安装了,需要先卸载它们以及相关的依赖项。

$ sudo apt-get remove docker docker-engine docker.io containerd runc

保留 /var/lib/docker/内容。

2、安装 Docker CE

(1)更新 apt 包索引:

$ sudo apt-get update

(2)安装 repository 和相关依赖:

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

(3)添加 Docker 官方 GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

通过搜索指纹的最后8个字符,确认含有指纹9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88的密钥。

$ sudo apt-key fingerprint 0EBFCD88
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

(4)添加 repository

根据不同架构选择需要添加的 repository

# x86_64 / amd64
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#armhf
$ sudo add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#arm64
$ sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#ppc64le (IBM Power)
$ sudo add-apt-repository "deb [arch=ppc64el] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#s390x (IBM Z)
$ sudo add-apt-repository "deb [arch=s390x] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

(5)更新 apt 包索引:

$ sudo apt-get update

(6)安装最新版 Docker CE 和 containerd

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

通过运行 hello-world 镜像验证是否正确安装了Docker CE:

$ sudo docker run hello-world

官方英文安装文档:https://docs.docker.com/install/linux/docker-ce/ubuntu/

Docker

Docker是一个开放源代码软件项目,让应用程序部署在软件货柜下的工作可以自动化进行,借此在Linux操作系统上,提供一个额外的软件抽象层,以及操作系统层虚拟化的自动管理机制。

1、卸载旧版 Docker

老版本的 Docker 被称为 dockerdocker-engine 。如果安装了,需要先卸载它们以及相关的依赖项。

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

2、添加 Docker CE 源

wget https://download.docker.com/linux/centos/docker-ce.repo
sudo mv docker-ce.repo /etc/yum.repos.d/docker-ce.repo

3、安装 Docker CE 和 Containered 最新版

sudo yum install docker-ce docker-ce-cli containerd.io

4、启动 Docker CE 服务

sudo systemctl start docker

查看 Docker CE 版本

docker -v

Docker version 18.09.6, build 481bc77156

官方英文安装: https://docs.docker.com/install/linux/docker-ce/centos/

Welcome to nginx!

安装

1、准备编译环境

yum -y install libxml2 libxml2-devel libxslt-devel gd-devel gperftools libuuid-devel libblkid-devel libudev-devel fuse-devel libedit-devel libatomic_ops-devel gcc-c++

以及安装 libmaxminddb(如不启用 GeoIP2 模块可以忽略)

2、下载并解压

由于 GeoIP 官方已不再支持,如果要支持最新 GeoIP2 ,需要添加ngx_http_geoip2_module。下载 GeoIP2 模块

git clone https://github.com/leev/ngx_http_geoip2_module.git

下载,解压

wget https://nginx.org/download/nginx-1.16.0.tar.gz
tar -xvf nginx-1.16.0.tar.gz
cd nginx-1.16.0

3、配置并构建 Nginx

./configure \
--prefix=/usr/local \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-select_module \
--with-poll_module \
--with-threads \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_xslt_module=dynamic \
--with-http_image_filter_module \
--with-http_image_filter_module=dynamic \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_slice_module \
--with-http_stub_status_module \
--with-mail \
--with-mail=dynamic \
--with-mail_ssl_module \
--with-stream \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_ssl_preread_module \
--with-google_perftools_module \
--with-cpp_test_module \
--with-compat \
--with-pcre \
--with-pcre-jit \
--with-libatomic \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' \
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
--add-dynamic-module=../ngx_http_geoip2_module
make
sudo make install

查看 Nginx 是否安装成功

nginx -v

nginx version: nginx/1.16.0

4、创建 nginx 用户

groupadd nginx
useradd -g nginx nginx

5、创建 nginx cache 文件夹

mkdir /var/cache/nginx

6、配置 nginx.service

sudo vi /usr/lib/systemd/system/nginx.service

复制粘贴:

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target

7、启用 GeoIP2 模块(可选)

编辑 /etc/nginx/nginx.conf 文件

在 events 之前加入:

load_module /usr/lib64/nginx/modules/ngx_http_geoip2_module.so;

在 http 内加入以下代码:

#/usr/share/GeoIP/GeoIP2-Country.mmdb 替换为实际路径
geoip2 /usr/share/GeoIP/GeoIP2-Country.mmdb {
    auto_reload 60m;
    $geoip2_metadata_country_build metadata build_epoch;
    $geoip2_data_country_code country iso_code;
    $geoip2_data_country_name country names en;
}

#/usr/share/GeoIP/GeoIP2-City.mmdb 替换为实际路径
geoip2 /usr/share/GeoIP/GeoIP2-City.mmdb {
    auto_reload 60m;
    $geoip2_data_city_name city names en;
}

fastcgi_param COUNTRY_CODE $geoip2_data_country_code;
fastcgi_param COUNTRY_NAME $geoip2_data_country_name;
fastcgi_param CITY_NAME    $geoip2_data_city_name;

8、启动 nginx 服务

systemctl start nginx
systemctl enable nginx

解决 error: the HTTP XSLT module requires the libxml2/libxslt 错误

yum -y install libxml2 libxml2-dev
yum -y install libxslt-devel

解决 error: the HTTP image filter module requires the GD library. 错误

yum -y install gd-devel

解决 error: the GeoIP module requires the GeoIP library. 错误

yum -y install GeoIP GeoIP-devel GeoIP-data

解决 error: the Google perftools module requires the Google perftools 错误

yum -y install gperftools

解决 error: libatomic_ops library was not found. 错误

yum -y install libuuid-devel libblkid-devel libudev-devel fuse-devel libedit-devel libatomic_ops-devel

解决 error trying to exec 'cc1plus': execvp: No such file or directory 错误

yum -y install gcc-c++

解决 error: [pool www] cannot get uid for user 'www-data' 错误

groupadd www-data
useradd -g www-data www-data

解决configure: error: mbed TLS libraries not found. 错误。

需要安装mbedtls,教程:https://www.24kplus.com/linux/281.html

解决 error: Cannot find OpenSSL's <evp.h> 错误

yum install openssl openssl-devel
ln -s /usr/lib64/libssl.so /usr/lib/

解决 error: Libtool library used but 'LIBTOOL' is undefined 错误

yum install libtool

解决 exec: g++: not found 错误

yum -y update gcc
yum -y install gcc+ gcc-c++

解决 configure: error: tss lib not found: libtspi.so 错误

yum install trousers-devel

解决 Can't exec "autopoint": No such file or directory 错误

yum install gettext gettext-devel gettext-common-devel

解决 configure: error: libcrypto not found. 错误

yum remove openssl-devel
yum -y install openssl-devel

解决 configure: error: Package requirements (libffi >= 3.0.0) were not met: No package 'libffi' found 错误

yum install libffi-devel

解决 fatal error: uuid.h: No such file or directory 错误

yum install e2fsprogs-devel uuid-devel libuuid-devel

解决 configure: error: openssl lib not found: libcrypto.so 错误

yum install openssl-devel

解决 tar (child): lbzip2: Cannot exec: No such file or directory 错误

yum -y install bzip2

解决 configure: error: C++ preprocessor "/lib/cpp" fails sanity check 错误

yum install gcc-c++

解决 configure: error: Please reinstall the BZip2 distribution 错误

yum install bzip2 bzip2-devel

解决 configure: error: cURL version 7.15.5 or later is required to compile php with cURL support 错误

yum install curl-devel

解决 configure: error: not found. Please provide a path to MagickWand-config or Wand-config program 错误

yum install ImageMagick-devel

解决 configure: error: no acceptable C compiler found in $PATH 错误

yum install gcc

解决 configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met: 错误

yum install libicu-devel

解决 configure: error: Package requirements (sqlite3 > 3.7.4) were not met: No package 'sqlite3' found 错误

yum install sqlite-devel

解决 configure: error: Package requirements (oniguruma) were not met: No package 'oniguruma' found 错误

yum install oniguruma oniguruma-devel

注意:.NET Core仅支持64位系统。

1、添加 dotnet repos

在安装.NET之前,需要注册 Microsoft key,注册 repos 并安装所需的依赖项。

打开 terminal 并运行以下命令:

sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm

2、 安装 .NET SDK

在 terminal 中,运行以下命令:

sudo yum update
sudo yum install dotnet-sdk-2.2

官方英文原文:https://dotnet.microsoft.com/download/linux-package-manager/centos/sdk-current

Ubuntu 16.04 或更高版本安装 .NET Core SDK,需要注意的是.NET Core仅支持 16.04 或更高版本的 64位系统。

1、注册 Microsoft key和 repos

在安装.NET之前,需要注册 Microsoft key,注册 repos 并安装所需的依赖项。

打开 terminal 并运行以下命令:

wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

2、 安装 .NET SDK

在 terminal 中,运行以下命令:

sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

如果出现Unable to locate package dotnet-sdk-2.2错误,运行以下命令:

sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

如果还没有安装成功,可以尝试以下命令运行手动安装:

sudo apt-get install -y gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

官方英文原文:https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current

前言

Deluge是一个功能齐全的跨平台BitTorrent 客户端软件,可在Linux, OS X, Unix和Windows操作系统下工作。它使用libtorrent作为其后端,有包括GTK+,网络远程客户端,命令行模式等多种用户界面。其设计方针是体积小巧且节约系统资源,通过丰富的插件来实现核心以外的众多功能。Deluge响应Freedesktop.org的倡议,兼容于GNOME, KDE, XFCE和其它多种桌面环境。它还是一款自由软件,使用GPLv3进行授权。

1、安装 deluge

sudo apt-get install deluge

2、安装 deluge web 管理面板

sudo apt-get install deluged deluge-web deluge-console

deluge 的安装目录在 /usr/lib/python2.7/dist-packages/deluge

如果出现add-apt-repository: command not found错误,执行:

sudo apt-get install python-software-properties

3、创建 deluged.service 配置文件

sudo vi /etc/systemd/system/deluged.service

复制粘贴:

[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/deluged -d
ExecStop=/usr/bin/killall -w -s 2 /usr/bin/deluged
Restart=on-failure
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target

4、创建 deluge-web.service 配置文件

sudo vi /etc/systemd/system/deluge-web.service

复制粘贴:

[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=network-online.target deluged.service
Wants=deluged.service
[Service]
Type=simple
User=root
ExecStart=/usr/bin/deluge-web
ExecStop=/usr/bin/kill /usr/bin/deluge-web
Restart=on-failure
[Install]
WantedBy=multi-user.target

5、启动 deluged 和 deluge-web 服务,并设置自启动

sudo systemctl start deluged
sudo systemctl enable deluged

sudo systemctl start deluge-web
sudo systemctl enable deluge-web

6、开启远程访问(可选)

deluge-web默认只允许本地访问。默认端口:8112,默认密码:deluge

#启用远程访问
deluge-console "config -s allow_remote True"

#禁用远程访问
deluge-console "config allow_remote"

访问地址:http://你的公网IP:8112

deluge web

到此,deluge 客户端配置基本完成。

deluge 官方网站:https://www.deluge-torrent.org/

解决configure: error: The Sodium crypto library libraries not found.错误。

1、下载并解压

wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz
tar -zxf libsodium-1.0.18-stable.tar.gz
cd libsodium-stable

备用下载地址:https://down.24kplus.com/linux/libsodium-1.0.18-stable.tar.gz

2、编译安装

./configure --prefix=/usr
make && make check
sudo make install
sudo ldconfig

如出现以下错误:

config.status: error: Something went wrong bootstrapping makefile fragments
     for automatic dependency tracking.  Try re-running configure with the
     '--disable-dependency-tracking' option to at least be able to build
     the package (albeit without support for automatic dependency tracking). 

执行:

yum install make -y

更多错误解决方案:https://www.24kplus.com/linux/400.html