注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

c32's blog

每天学习一点点,每天进步一点点.

 
 
 
 
 

日志

 
 

update.sh更新ubuntu源  

2016-08-08 14:14:00|  分类: Bash |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

#!/bin/bash
#########################################
#Author: c32 (amd5@qq.com)
#Function: update source
#Usage: bash update.sh
#Blog: http://cx7863.blog.163.com/blog/static/2286500262016782140322/
#Version: 1.1
#DateTime: 2016-08-08 14:12:44
#########################################
chmod 777 /etc/apt/
echo -e "\033[40;32mBackup the original configuration file,new name and path is /etc/apt/sources.list.back.\n\033[40;37m"
mv /etc/apt/sources.list /etc/apt/sources.list.bak
#aliyun
echo 'deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse' >> /etc/apt/sources.list
#163
echo 'deb http://mirrors.163.com/ubuntu/ precise main restricted' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise main restricted' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-updates main restricted' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise universe' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise universe' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-updates universe' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-updates universe' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-updates multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-security main restricted' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-security universe' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-security universe' >> /etc/apt/sources.list
echo 'deb http://mirrors.163.com/ubuntu/ precise-security multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse' >> /etc/apt/sources.list
echo 'deb http://extras.ubuntu.com/ubuntu precise main' >> /etc/apt/sources.list
echo 'deb-src http://extras.ubuntu.com/ubuntu precise main' >> /etc/apt/sources.list
EOF
gpg --keyserver keyserver.ubuntu.com --recv 3E5C1192
gpg --export --armor 3E5C1192 | sudo apt-key add -
apt-get update

  评论这张
 
阅读(16)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017