when I use a new host.

配置源

  1. apt源

    deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 
    deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 
    deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 
    deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse 
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse 
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    

    但是我发现,Ubuntu18.04下粘贴上文,会导致安装软件失败,提示unmet缺少依赖,即使-f也不行。
    apt源备份 /ect/apt/sources.list
    嵌入式apt源:
    https://mirrors.ustc.edu.cn/ubuntu-ports/
    termux源:
    deb https://mirrors.ustc.edu.cn/termux stable main
    :%s/xxxx/mirrors.uest.edu.cn/g
    vim命令
    %s/htt.*.*com/http:\/\/mirrors.ustc.edu.cn/g
    看了20分钟sed文档后

    sudo bash -c "cp /etc/apt/sources.list /etc/apt/sources.list-bak && sed -e s/'htt.*.*com'/'http:\/\/mirrors.ustc.edu.cn'/g /etc/apt/sources.list-bak > /etc/apt/sources.list"
    
    sudo bash -c "cp /etc/apt/sources.list /etc/apt/sources.list-bak && sed -e s/'htt.*.*com'/'http:\/\/mirrors.ustc.edu.cn'/g /etc/apt/sources.list-bak > /etc/apt/sources.list";
    echo "
    sudo apt-get update;
    sudo apt-get install python-pip -y;
    sudo apt-get install axel -y;
    sudo pip install speedtest-cli;
    sudo apt-get install htop;
    sudo apt-get install python3-pip -y;
    # sudo apt-get install openjdk-7-jdk -y;
    sudo apt install openjdk-8-jdk-headless -y;
    sudo snap install --classic code; # https://code.visualstudio.com/docs/setup/linux
    sudo apt-get install tinyproxy -y;
    #看图神器
    sudo apt-get install caca-utils -y; 
    sudo apt-get install lrzsz -y;
    sudo apt-get install nmap -y;
    sudo apt-get install whois -y;
    sudo apt-get install iftop -y;
    sudo apt-get install reptyr -y;
    
    # wps https://www.wps.cn/product/wpslinux
    # mysql: apt install mysql-server-8.0
    sudo apt install git -y;
    " > to_install
    &&
    chmod 777 to_install
    &&
    bash to_install
    
  2. Maven源:

    <mirrors>
        <mirror>
          <id>alimavenid>
          <name>aliyun mavenname>
        <url>http://maven.aliyun.com/nexus/content/groups/public/url>
          <mirrorOf>centralmirrorOf>        
        mirror>
    mirrors>
    
  3. pip源
    修改 ~/.config/pip/pip.conf 这个是过时的! $HOME/.pip/pip.conf (Linux), %APPDATA%\pip\pip.ini (Windows 10)

    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    pip源备份 备份? 备什么份,把自定义的删了即可
    采用清华pip源官网的写法:
    临时使用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
    长期使用

     pip install pip -U pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    

    原来的源差到连pip都无法更新???
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

  4. Docker
    中科大 sudo vim /etc/docker/daemon.json

  {
   "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
  } 

sudo systemctl restart docker然后敲入docker info看最下面Registry Mirrors来确定修改成功。

OS config
  1. 更新man手册
  apt-get install manpages-de  manpages-de-dev  manpages-dev glibc-doc manpages-posix-dev  manpages-posix
  1. Unix性能测试

    wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
    
  2. 系统是否支持无线网卡(不需要其他驱动)

    https://help.ubuntu.com/stable/ubuntu-help/net-wireless-troubleshooting-hardware-check.html
    https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported
    如果不支持,就是看不见无线网络,用手机USB线做有线热点,幸运的话,那里面的‘附加驱动’里就有你的无线网卡驱动。
    Ubuntu apt不能安装E:无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系 出现原因:1.软件安装过程中强制中断,而后改变了安装源 2.软件和更新中的源和apt-get中的源相互独立? 解决办法:恢复原本的源,在“软件更新”中勾选所有的选项,静待更新完成,最好不要中途中止。

  3. 锁定内核更新 https://connectwww.com/how-to-prevent-ubuntu-kernel-update-disable-or-stop-linux-kernel-update
    sudo apt-mark hold uname -r or
    sudo nano /etc/apt/apt.conf.d/50unattended-upgrades or
    echo package-name hold" | sudo dpkg --set-selections

  4. 禁止一些服务,systemctl disable是不足够的 systemctl list-units --type service --state running to show and using arg disable disable not persistent, use mask/unmask how-to-stop-snapd-from-auto-updating

systemctl mask tinyproxy.service;
systemctl mask docker;
systemctl mask snapd.service;
Software config
  1. snap bin目录配置
    echo "export PATH=$PATH:/snap/bin" >> ~/.bashrc
    source ~/.bashrc
    snap 阻止自动更新 snap refresh --hold
  2. 装机必备:
    indicator-sysmonitor
    搜狗拼音输入法,按照搜狗的指引操作即可:https://shurufa.sogou.com/linux/guide
  3. FireFox 字体放大:layout.css.devPixelsPerPx

你可能感兴趣的:(配置,ubuntu,python)