zoukankan      html  css  js  c++  java
  • 修改ubuntu镜像源

    ==================

    查看当前版本:lsb_release -a       uname -a   查看linux系统版本:cat /etc/issue

     ========修改apk镜像源

    sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

    apk update #更新最新镜像源列表
    apk search #查找所以可用软件包
    apk search -v #查找所以可用软件包及其描述内容
    apk search -v 'acf*' #通过软件包名称查找软件包
    apk search -v -d 'docker' #通过描述文件查找特定的软件包

    apk add openssh #安装一个软件
    apk add openssh openntp vim #安装多个软件
    apk add --no-cache mysql-client #不使用本地镜像源缓存,相当于先执行update,再执行add

    apk info #列出所有已安装的软件包
    apk info -a zlib #显示完整的软件包信息
    apk info --who-owns /sbin/lbu #显示指定文件属于的包
    apk upgrade #升级所有软件
    apk upgrade openssh #升级指定软件
    apk upgrade openssh openntp vim #升级多个软件
    apk add --upgrade busybox #指定升级部分软件包
    apk del openssh #删除一个软件

     

     apk --update add --no-cache

    ===========

    当给apt增加镜像源时:

     文件/etc/apt/sources.list是一个普通可编辑的文本文件,保存了ubuntu软件更新的源服务器的地址。和sources.list功能一样的是/etc/apt/sources.list.d/*.list(*代表一个文件名,只能由字母、数字、下划线、英文句号组成)。sources.list.d目录下的*.list文件为在单独文件中写入源的地址提供了一种方式,通常用来安装第三方的软件。

    1)/etc/apt/sources.list.d/aliyun.list

    2)

    echo '
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 
    ' > /etc/apt/sources.list.d/aliyun.list
    3)apt-get update
  • 相关阅读:
    火狐浏览器标签之间切换的快捷键
    LeetCode 69. x 的平方根
    LeetCode 51. N皇后
    win 10 自带 Ubuntu 系统的文件位置
    LeetCode 122. 买卖股票的最佳时机 II
    LeetCode 169. 求众数
    LeetCode 50. Pow(x, n)
    LeetCode 236. 二叉树的最近公共祖先
    LeetCode 235. 二叉搜索树的最近公共祖先
    LeetCode 98. 验证二叉搜索树
  • 原文地址:https://www.cnblogs.com/testzcy/p/12633004.html
Copyright © 2011-2022 走看看