• 【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

  • 相关阅读:
    docker 安装 postgresql10[转] 规格严格
    实现html和word的相互转换(带图片) 规格严格
    JasperReport报表导出踩坑实录 规格严格
    Postman设置环境变量[转] 规格严格
    PDF 图书
    理解 ASP.NET Core:Cookie 认证
    你在错误命名你的测试用例!
    精通 ASP.NET Core MVC (第 7 版) 源码下载
    使用 VS Code 徒手构建 PDF 文件
    OpenType 字体文件组织结构
  • 原文地址:https://www.cnblogs.com/yeyeck/p/9614716.html
Copyright © 2020-2023  润新知