【kali Linux】自动化换阿里云的源并更新kali系统的脚本
新建一个update.sh的文件复制代码进去,保存并退出(Esc—>shift+zz)#! /usr/bin/bashecho"---------------------update sources is begin-----------------------"log_file="#aliyun 阿里云 \ndeb http://mirrors.aliyun.com/kali kali-r
·
新建一个update.sh的文件
复制代码进去,保存并退出(Esc—>shift+zz)
#! /usr/bin/bash
echo "---------------------update sources is begin-----------------------"
log_file="#aliyun 阿里云 \n
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib \n
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib \n
# ustc 中科大 \n
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib \n
#deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib \n
#deb http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free \n
#deb-src http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free"
echo -e $log_file>>sources.list
echo "---------------------update sources is end-----------------------"
echo "---------------------update system is begin-----------------------"
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get clean
apt-get autoclean
echo "---------------------update system is end-----------------------"
使用方式:
进入到文件所在的文件夹,执行以下命令
chmod a+x update.sh
./update.sh
然后坐等完成即可。
注:第一次使用过后要删除更新源的部分(自用)
更多推荐
所有评论(0)