一、更新系統
指令一:sudo apt-get update
指令二:sudo apt-get -y dist-upgrade
指令三:sudo apt-get clean
說明:清除更新時下載回來的軟件包。
指令四:sudo apt-get autoremove
說明:自動清除更新後用不到的舊版本文件(例如舊的核心文件)
備註:若不及時移除舊核心文件,容易造成 /boot 空間不足,可能導致無法正常啓動。
不要更新系統、不要更新系統、不要更新系統,更新了docker裝不上!
二、禁用IPV6
臨時,重啓後失效:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 sysctl -p
永久:
vim /etc/sysctl.conf
在最後加:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
最後執行
sudo sysctl -p
部分系統這麼處理後還是沒法禁用ipv6,重啓後還有:
vim /etc/default/grub
在:GRUB_CMDLINE_LINUX_DEFAULT 後面引號中添加:
ipv6.disable=1
更新grub並重啓:
update-grub && reboot
三、禁止內核更新
1. 查看已安裝的內核
sudo dpkg --get-selections | grep linux
2. 查看正在使用的內核
uname -a
3. 禁止內核更新
sudo apt-mark hold linux-image-5.15.0-60-generic
sudo apt-mark hold linux-modules-extra-5.15.0-60-generic
4. 重啓內核更新
sudo apt-mark unhold linux-image-5.15.0-72-generic
sudo apt-mark unhold linux-modules-extra-5.15.0-72-generic
根據自己的內核使用情況實際替換上述命令中的內核版本。
四、禁止軟件自動更新
編輯文件,把1改成0
vim /etc/apt/apt.conf.d/20auto-upgrades APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Unattended-Upgrade "0";
更換DNS
vim /etc/netplan/00-installer-config.yaml
network: ethernets: eno1: addresses: - 192.168.2.123/24 routes: - to: default via: 192.168.2.1 dhcp4: no nameservers: addresses: [114.114.114.114,8.8.8.8] search: [] eno2: addresses: - 192.168.1.123/24 nameservers: addresses: [] search: [] version: 2
netplan apply
重啓這個服務器dns才生效
systemctl restart systemd-resolved.service
查看dns
resolvectl status
五、更換華爲源
sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
2、修改sources.list文件,將http://archive.ubuntu.com和http://security.ubuntu.com替換成http://repo.huaweicloud.com,可以參考如下命令:
sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list sudo sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
3、執行 apt-get update 更新索引
六、安裝docker
https://www.cnblogs.com/dwj192/p/16223854.html
七、安裝cuda
https://www.cnblogs.com/dwj192/p/15661427.html
八、安裝miniconda
https://docs.conda.io/en/latest/miniconda.html