新安装的Linux系统

设置root用户的密码
sudo passwd root 回车
设置root用户的密码(使用root账户)
安装yum

sudo apt-get update
sudo apt install yum

Linux系统(Ubuntu)中使用国内的源地址
  • 源地址列表文件路径

    ubuntu系统的源列表配置文件的路径是:/etc/apt/ sources.list

为了在替换前留个备份,可以执行命令做个备份:

cp /etc/apt/sources.list /etc/apt/sources.list-bak

  • 源地址列表文件的替换

    不同的版本,sources.list里的url是不同的,主要是版本好不一样,例如ubuntu14.04的代号是trusty ,而ubuntu16.04是 xenial。

具体查看方法是执行命令:lsb_release -a 回车

返回的Codename就是版本代号

如图:


img_fd955c496dcae4b16c7040f2e9d946ee.png
image.png
ubuntu14.04版本

将/etc/apt/ sources.list的内容替换为:

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

替换后执行命令: sudo apt-get update

ubuntu16.04版本

将/etc/apt/ sources.list的内容替换为:

deb  http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe

deb  http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe

deb  http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe

替换后执行命令: sudo apt-get update

出现apt-get: Package has no installation candidate问题
apt-get update
apt-get upgrade
apt-get install <packagename>
  • 添加第三方地址:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值