zoukankan      html  css  js  c++  java
  • 【linux】虚拟机上的一些问题(ubuntu)

    1. apt 获取资源过慢问题

    更换apt下载源, apt下载源在 /etc/apt/sources.list中, 先把原来的数据copy一个副本

    cd /etc/apt
    sudo cp source.list source.list.bak

    然后查看系统的codename, 比如我的是 bionic

    yeyeck@ubuntu:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID:    Ubuntu
    Description:    Ubuntu 18.04.1 LTS
    Release:    18.04
    Codename:    bionic
    yeyeck@ubuntu:~$ 

    再把/etc/apt/sources.list里的数据全部删掉, 把以下数据中标记的bionic 全部替换为你系统的codename, 并保存

    deb http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe

    最后执行以下命令

    sudo apt-get update

    2. pip3 下载慢的问题

    mkdir ~/.pip
    sudo vim ~/.pip/pip.conf

    然后在文件中输入以下内容,保存即可

    [global]
    index-url = http://mirrors.aliyun.com/pypi/simple/
    [install]
    trusted-host = mirrors.aliyun.com

  • 相关阅读:
    [NOIP2020]T2字符串匹配
    【CSGRound2】逐梦者的初心(洛谷11月月赛 II & CSG Round 2 T3)
    【CF1225E Rock Is Push】推岩石
    [HAOI2016]食物链
    求先序排列
    图书管理员
    合并果子
    联合权值
    和为0的4个值
    玩具谜题
  • 原文地址:https://www.cnblogs.com/yeyeck/p/9614716.html
Copyright © 2011-2022 走看看