当前位置:   article > 正文

关于Unable to locate package net-tools的一些思考

unable to locate package net-tools

最近在学习大数据技术,在Linux中安装net-tools一直报错,通过查阅各种资料,做了一些总结并记录下来。

配置镜像仓库(换源)

       ubuntu的/etc/apt/source.list中的镜像源比较旧,需要更换一下(当然如果直接更新不报错就更好了),国内有很多Ubuntu的镜像源,包括阿里的、网易的,还有很多教育网的源,比如:清华源、中科大源。我们这里以清华源为例说一下如何修改Ubuntu 18.04里面默认的源。

1、输入命令修改sources.list文件,当然需要超级权限,所以要加sudo(如提示没权限,被占用,等等,直接重启系统)

sudo gedit /etc/apt/sources.list

2、编辑/etc/apt/sources.list文件,把文件中的内容替换成以下条目(操作前要备份),save,关闭:

  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
  2. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  7. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  9. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

顺便说一下,操作前要怎么样备份,执行下面的命令就可以进行备份了

sudo cp /etc/apt/sources.lst /etc/apt/sources.list_backup

该命令执行完后便会在sources.list的目录中出现一个sources.list_backup的备份文件。

3、修改完成后,保存文件,依次运行下面的命令

  1. sudo apt-get update
  2. sudo apt-get upgrade

至此完成国内源更新!(如果到此您便没有报错,那么恭喜你太幸运了,如果有小伙伴和我一样在这里踩坑了,不妨来看看我下一篇在换源过程中踩到的坑吧)

文末附加其他源内容,需要的自己添加进sources.list文件里面就ok了。

阿里源:

  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

中科大源:

  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
  2. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  7. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  9. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

163源:

  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/556132
推荐阅读
相关标签
  

闽ICP备14008679号