<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="TurnKey Linux系统安装后简单优化">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2023-04-18 15:31<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
TurnKey Linux系统安装后简单优化





官网：https://www.turnkeylinux.org/

中科大下载地址：http://mirrors.ustc.edu.cn/turnkeylinux/images/





介绍：

TurnKey Linux 的Debian的版本对应关系：是基于 Debian 的虚拟应用程序库，它将一些最好的开放源码软件集成到完备可用的解决方案中。每一个虚拟应用程序都为易用性进行了优化，并能在数分钟内就部署在裸机、虚拟机及云中。每一个虚拟应用都可以光盘镜像或是虚拟机镜像的形式获得。最新core版本是turnkey-core-17.1-bullseye-amd64.iso，是以Debian11为基础的，可以用Debian11的源安装软件。core版本是未安装其他APP的基础版本，可以以它为基础构建自己的服务器。目前TurnKey Linux系统仅支持legacy启动，物理机安装时候新机器可以切换到legacy启动，如果仅有UEFI启动，则无法使用本系统。

以下为TurnKey Linux 的Debian的版本对应关系（以下均为X64版本）：



XML/HTML代码


    turnkey-core-14.2-jessie-amd64.iso                   Debian8

    turnkey-core-15.0-stretch-amd64.iso                  Debian9

    tturnkey-core-16.1-buster-amd64.iso                  Debian10

    turnkey-core-17.1-bullseye-amd64.iso                 Debian11






安装：

下载最新的turnkey-core-17.1-bullseye-amd64.iso，虚拟机载入安装系统，以下均为此版本实例。

启动虚拟机后，默认进入分区界面，一般选择 Guided - use entire disk（向导，整个磁盘），如果有特殊需求可以选择LVM或者手动Manual。然后下面全都选择 YES , 一路回车，直到重启，完成安装。

重启后出现第一个需要输入的是root密码，输入两次，下面的安装选项，全都 skip 跳过，直到出现confconsole控制台，显示本地的IP等信息。（转移从17版本开始，系统密码要求复杂才可以确认，尽量使用大小写加上数字或者符号，否则无法继续安装。）





配置：

在confconsole控制台，回车后进入登录模式，输入root和刚设置的密码，进入系统。

然后输入 confconsole 回车，进入GUI 模式设置系统基本配置。

Networking：DHCP（自动获取IP）StaticIP（固定IP）设置后 Apply 马上生效，无需重启系统。

Region config：Locales（选择zh_CN开头的4个，空格选择，然后下一步选择 zh_CN.UTF-8 为默认）Tzdata（Asia-Shanghai 设置中国时区，以便时间同步）

Reboot（重启系统）Shutdown（关机）Quit（退出confconsole的GUI）





网络通了以后可以SSH远程登录，配置系统参数。

修改默认源地址，因为默认源地址为国外，速度比较慢，所以改成国内快的源，安装软件方便，以下以中科大源为例：

中科大源地址：

https://mirrors.ustc.edu.cn/repogen/





修改并添加以下地址到 /etc/apt/sources.list.d/sources.list （Debian11原版地址为 /etc/apt/sources.list ），security.sources.list一般禁用，可以改名为security.sources.list.disabled。



XML/HTML代码


    deb http://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free

    deb-src http://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free

    deb http://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free

    deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free

    deb http://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free

    deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free

    deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free

    deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free






常用软件安装



XML/HTML代码


    #更新源

    apt-get -y update

    #升级软件

    apt-get -y upgrade

    #安装常用软件

    apt-get -y install  htop nload ncdu wget curl  tar gzip  bzip2 xz-utils  unzip net-tools sudo

    #安装编译所需的软件

    apt-get -y install  build-essential

    #卸载man-db

    apt-get -y remove man-db






设置终端支持中文



XML/HTML代码


    sed -i '$a \export LC_ALL=&quot;zh_CN.UTF-8&quot;' /etc/profile

    sed -i '$a \export LC_CTYPE=&quot;zh_CN.UTF-8&quot;' /etc/profile

    sed -i '$a \export LANG=&quot;zh_CN.UTF-8&quot;' /etc/profile

    source  /etc/profile






Webmin管理：

TurnKey Linux安装后默认自带Webmin管理软件，用户名密码为系统的账号密码。



XML/HTML代码


    https://IP:12321/ - System control panel

    https://IP:12320/ - Web based command line terminal






TurnKey Linux本身就是国外一个非常好用的为虚拟化定制的系统，精简安全，ISO才300多M，安装速度快，整个国产两三分钟搞定。支持物理机虚拟机，非常好用。 

一键安装Docker（官方）：



XML/HTML代码


    curl -sSL https://get.docker.com/ | sh




一键安装docker-compose



XML/HTML代码


    curl -L &quot;https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose

    chmod +x /usr/local/bin/docker-compose




或者命令安装



XML/HTML代码


    apt-get -y install docker-compose




一键安装portainer中文版



XML/HTML代码


    docker run -d --restart=always --name=&quot;portainer&quot; -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data 6053537/portainer-ce




一键安装网络测速容器



XML/HTML代码


    docker run -d --restart=always --name=&quot;speedtest-x&quot; -p 88:80 -it badapple9/speedtest-x

    docker run -d --restart=always --name=&quot;speedtest&quot; -p 99:80 -it adolfintel/speedtest

    docker run -d --restart=always --name=&quot;homebox&quot; -p 89:3300  -it xgheaven/homebox




支持ARM64



XML/HTML代码


    docker run -d --restart=always --name=&quot;speedtest-x&quot; -p 88:80 -it stilleshan/speedtest-x






修改系统时区



XML/HTML代码


    timedatectl set-timezone  Asia/Shanghai




修改Docker容器的时区



XML/HTML代码


    /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

    echo 'Asia/Shanghai' &gt;/etc/timezone






其他后续补充


</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
