Ubuntu 18.04下使用apt-fast替换apt-get增加下载安装速度

默认的apt-get install 有时候会下载非常慢,尤其是添加的一些ppa,这时候你就需要apt-fast这个软件了。Apt-fast 是一款替代 apt-get 提升下载速度的软件,apt-fast是apt-get和aptitude的shell脚本包装器, 安装软件时,通过使用多线程下载来给apt-get 提速,可以大大提高下载时间。测试后效果很好
 
ASP站长网首先参考下面两篇把Ubuntu 18.04的更新源软件源改为国内的。
 
Ubuntu 18.04更改apt为阿里云软件源  https://www.linuxidc.com/Linux/2019-04/158157.htm
Ubuntu 18.04修改默认源为国内源  https://www.linuxidc.com/Linux/2018-08/153709.htm
linuxidc@linuxidc:~/linuxidc.com$ sudo add-apt-repository ppa:apt-fast/stable
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
linuxidc@linuxidc:~/linuxidc.com$  sudo apt-get install apt-fast
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
选择apt-get
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
在下一个对话框里面,会问你是否要禁止apt-fast的确认对话框。选择No并继续安装。如果你选择Yes,apt-fast在安装软件包时不会问你确认与否。
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
在安装期间,它将要求你输入下载包的最大并发链接数。可以设置线程最大值1~16,我这里设置到16
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
安装之后使用方法和apt-get使用一样.更新源列表,这是一个正在工作中的apt-fast包管理器:
 
linuxidc@linuxidc:~/linuxidc.com$ sudo apt-fast update
 
Ubuntu 18.04下使用apt-fast替换apt-get提高下载安装速度
 
如果你想重新配置apt-fast选项,你可以使用命令:
 
sudo dpkg-reconfigure apt-fast
 
用法
 
与apt-get功能相似,我们可以使用:
apt-fast install package
apt-fast remove package
apt-fast update
apt-fast upgrade
apt-fast dist-upgrade
 
及更多命令。
 
创建别名(可选)
 
编辑 ~/.bashrc 文件在末尾添加下面这行。
 
alias apt-get='apt-fast'
 
或者简单运行以下命令在你的 ~/.bashrc 中添加它。
 
sudo echo "alias apt-get='apt-fast'" >> ~/.bashrc
 
从现在每当你运行apt-get命令去移除,更新和升级包时,它将在后台自动使用apt-fast。听起来很酷吧?

dawei

【声明】:九江站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。