强烈建议先删除企业源:
rm /etc/apt/sources.list.d/pve-enterprise.list
export LC_ALL=en_US.UTF-8
apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git
cd pvetools
./pvetools.sh
####################安装apt-fast
git clone https://github.com/ilikenwf/apt-fast.git
cd apt-fast
cp apt-fast /usr/local/sbin/
chmod +x /usr/local/sbin/apt-fast
cp apt-fast.conf /etc
apt-get install aria2
###Bash
cp completions/bash/apt-fast /etc/bash_completion.d/
chown root:root /etc/bash_completion.d/apt-fast
. /etc/bash_completion
###Zsh
cp completions/zsh/_apt-fast /usr/share/zsh/functions/Completion/Debian/
chown root:root /usr/share/zsh/functions/Completion/Debian/_apt-fast
source /usr/share/zsh/functions/Completion/Debian/_apt-fast
###Fish
cp completions/fish/apt-fast.fish /etc/fish/conf.d/completions/
chown root:root /etc/fish/conf.d/completions/apt-fast.fish
source /etc/fish/conf.d/completions/apt-fast.fish
#######################
#######################常用软件列表
apt-fast install ifupdown2 lshw ethtool axel iperf3 htop iotop curl
######################## R8168
#安装内核,安装r8168-dkms
######################## 神之操作
apt-fast install dkms
apt --fix-broken install
########################首先是常规的pve操作内容,请用root用户,包括编译部分也要用root用户编译,老外的建议,不清楚为什么。开启IOMMU分组###功能编辑 /etc/default/grub,将以下部分修改如下:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on pcie_acs_override=downstream"
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on pcie_acs_override=downstream"
amd的cpu请将intel_iommu=on 改为 amd_iommu=on
###然后是修改/etc/modules文件, 添加如下内容:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
###然后执行
update-initramfs -u -k all
###再执行
dmesg | grep -e DMAR -e IOMMU -e AMD-Vi
######################## 锁软件锁内核
apt-mark hold linux-tools-5.0-dbgsym
apt-mark hold linux-tools-5.0
apt-mark hold pve-headers-5.0.18-1-pve
apt-mark hold pve-kernel-5.0.18-1-pve
######################## 禁用 R8169
sh -c 'echo blacklist r8169 >> /etc/modprobe.d/blacklist.conf'
####################### 全双工
ethtool -s eth0 speed 1000 duplex full
#######################安装syncting
# 添加公钥:
curl -s https://syncthing.net/release-key.txt | apt-key add -
# 添加deb源:
echo "deb https://apt.syncthing.net/ syncthing stable" | tee /etc/apt/sources.list.d/syncthing.list
# Update and install syncthing:
apt-get update
apt-get install syncthing
apt-get install apt-transport-https
在Ubuntu 18.04上配置Syncthing
现在我们已经安装了syncthing,让我们继续进行配置部分,由于Ubuntu 18.04是systemd兼容的(参考:Systemd入门教程),我们可以创建systemd单元文件来管理syncthing服务,systemd的服务文件由Syncthing提供,可以在etc/linux-systemd中找到:
vim /etc/systemd/system/syncthing@.service
添加以下内容:
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
[Service]
User=%i
ExecStart=/usr/bin/syncthing -no-browser -gui-address="192.168.1.20:8384" -no-restart -logflags=0
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
[Install]
WantedBy=multi-user.target
将192.168.1.20替换为你的系统IP地址,然后更新systemd服务列表:
systemctl daemon-reload
然后启动syncthing服务:
systemctl start syncthing@user
例如:
systemctl start syncthing@root
systemctl start syncthing@jmutai
########################最后通过apt-mark命令屏蔽掉这几个涉及的安装包解决apt总是失败的问题:
apt-mark hold zfs-zed
apt-mark hold zfs-dkms
apt-mark hold zfs-initramfs