日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubutun 更换网络源_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau

發布時間:2025/3/8 Ubuntu 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubutun 更换网络源_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Ubuntu初始化腳本,安裝顯卡驅動專用初始化腳本

替換apt源為國內清華源,增加docker-ce國內源

開啟tab鍵補齊

桌面版開啟ssh

僅支持Ubuntu16/18桌面版

安裝gcc make

屏蔽nouveau 自動重啟服務器生效

#!/bin/bash #檢測網絡是否通暢 ping -w 5 qq.com || { echo "網絡異常,腳本終止" exit 1 } #開啟ssh sudo apt install openssh-server -y sudo apt install openssh-client curl lib32ncurses5 lib32z1 -y systemctl start ssh.service systemctl enable ssh.service #更換國內源 #識別Ubuntu16/18 ubuntu_ver=$(cat /etc/issue |awk '{print $2}'|xargs | awk -F "." '{print $1}') #Ubuntu 16.04 _ubuntu16 () { cat > /etc/apt/sources.list << 'EOF' # 默認注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # 預發布軟件源,不建議啟用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse EOF #開啟tab鍵補齊 cat >> /etc/bash.bashrc << 'EOF' #enable bash completion in interactive shells if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi EOF source /etc/bash.bashrc curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update } _ubuntu18 () { cat > /etc/apt/sources.list << 'EOF' # 默認注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # 預發布軟件源,不建議啟用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse EOF curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update } #更新apt源 [ $ubuntu_ver -eq 16 ] && _ubuntu16 && sudo apt update -y [ $ubuntu_ver -eq 18 ] && _ubuntu18 && sudo apt update -y #安裝顯卡驅動所需依賴 apt install gcc make -y #屏蔽集顯 cat >> /etc/modprobe.d/blacklist-nouveau.conf << 'EOF' blacklist nouveau options nouveau modeset=0 EOF sudo update-initramfs -u reboot

總結

以上是生活随笔為你收集整理的ubutun 更换网络源_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。