Connection failed [IP: 91.189.91.39 80]
1、系统信息
root@ubuntu2204test01:/home# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy
2、问题
root@ubuntu2204test01:/home# apt install r-base-core ## 安装R过程中遇到如下问题
Connection failed [IP: 91.189.91.39 80]
3、解决方法(更换国内源)
001、进入 /etc/apt/目录:
root@ubuntu2204test01:/home# cd /etc/apt root@ubuntu2204test01:/etc/apt# pwd /etc/apt
002、备份原镜像文件
root@ubuntu2204test01:/etc/apt# cp sources.list sources.list_bak
003、编辑镜像源文件
root@ubuntu2204test01:/etc/apt# vim sources.list ## 输入如下内容,保存退出
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
004、跟新软件库
root@ubuntu2204test01:/etc/apt# apt update
005、升级软件
root@ubuntu2204test01:/etc/apt# apt upgrade
006、再次安装R
root@ubuntu2204test01:/etc/apt# apt install r-base-core
4、测试R
root@ubuntu2204test01:/etc/apt# R R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. >
没有问题。