我是靠谱客的博主 现实世界,最近开发中收集的这篇文章主要介绍raspberry ubuntu 修改源为清华_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau...Ubuntu初始化脚本,安装显卡驱动专用初始化脚本替换apt源为国内清华源,增加docker-ce国内源开启tab键补齐桌面版开启ssh仅支持Ubuntu16/18桌面版安装gcc make屏蔽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
最后
以上就是现实世界为你收集整理的raspberry ubuntu 修改源为清华_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau...Ubuntu初始化脚本,安装显卡驱动专用初始化脚本替换apt源为国内清华源,增加docker-ce国内源开启tab键补齐桌面版开启ssh仅支持Ubuntu16/18桌面版安装gcc make屏蔽nouveau 自动重启服务器生效的全部内容,希望文章能够帮你解决raspberry ubuntu 修改源为清华_「ubuntu脚本1」开启ssh替换第三方源开启tab键补齐屏蔽nouveau...Ubuntu初始化脚本,安装显卡驱动专用初始化脚本替换apt源为国内清华源,增加docker-ce国内源开启tab键补齐桌面版开启ssh仅支持Ubuntu16/18桌面版安装gcc make屏蔽nouveau 自动重启服务器生效所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复