ubuntu 解决apt install 下载速度太慢
时间: 2024-06-08 22:05:20 浏览: 16
如果使用 apt install 命令下载软件包速度太慢,可以尝试以下方法:
1. 更换国内源
可以使用清华镜像或阿里云镜像等国内源,可以提高下载速度。可以通过修改 /etc/apt/sources.list 文件中的源地址来更换国内源。
例如,将原来的源地址:
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
替换为:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
2. 使用代理
如果你使用的是代理软件,可以将代理软件设置为全局代理,或者在终端中使用export命令设置代理:
export http_proxy=http://ip:port
export https_proxy=http://ip:port
其中,ip和port需要替换为你自己的代理地址和端口。
3. 使用axel下载器
axel是一个多线程下载器,可以加快下载速度。使用以下命令安装axel:
sudo apt-get install axel
然后,在使用apt install命令时,使用axel代替原来的下载器:
sudo apt-get -o Acquire::http::Dl-Limit=100 -o Acquire::BrokenProxy=true -o Acquire::Retries=3 -o Acquire::http::Timeout="60" -o Acquire::https::Timeout="60" -o Acquire::ftp::Timeout="60" -o Acquire::Retries=3 install axel
以上命令中,-o选项用于设置apt下载器的参数,可以根据需要进行修改。
希望这些方法能够帮助你加快apt安装软件包的速度。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)