关于android SDK安装Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml出错

近期SDK出现问题,SDK Manager无法刷新API Level。除翻墙外,找到一个有效方法,来自csdn大神。通过菜单栏Tools——>Options进行设置,设置好点击close后,API Level全部显示出来。
部署运行你感兴趣的模型镜像

最近SDK出问题了,SDK Manager一直不能刷新API Level,看图


错误代码:

Fetching http://dl-ssl.google.com/android/repository/addons_list-1.xml  
Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection to http://dl-ssl.google.com refused  
Fetched Add-ons List successfully  
Fetching URL: <a target="_blank" href="http://dl-ssl.google.com/android/repository/repository-6.xmlFailed">http://dl-ssl.google.com/android/repository/repository-6.xml  
Failed</a> to fetch URL <a target="_blank" href="http://dl-ssl.google.com/android/repository/repository-6.xml">http://dl-ssl.google.com/android/repository/repository-6.xml</a>, reason: Connection to http://dl-ssl.google.com refused  
Done loading packages.  
[html] view plaincopy
Fetching <a target="_blank" href="http://dl-ssl.google.com/android/repository/addons_list-1.xml">https://dl-ssl.google.com/android/repository/addons_list-1.xml</a>  
Failed to fetch URL <a target="_blank" href="http://dl-ssl.google.com/android/repository/addons_list-1.xml">https://dl-ssl.google.com/android/repository/addons_list-1.xml</a>, reason: Connection to <a target="_blank" href="http://dl-ssl.google.com">https://dl-ssl.google.com</a> refused  
Fetched Add-ons List successfully  
Fetching URL: <a target="_blank" href="http://dl-ssl.google.com/android/repository/repository-6.xml">https://dl-ssl.google.com/android/repository/repository-6.xml</a>  
Failed to fetch URL <a target="_blank" href="http://dl-ssl.google.com/android/repository/repository-6.xml">https://dl-ssl.google.com/android/repository/repository-6.xml</a>, reason: Connection to <a target="_blank" href="http://dl-ssl.google.com">https://dl-ssl.google.com</a> refused  
Done loading packages. 


网上找了很多资料,除了使用翻墙软件之外,发现一个很好用的方法啊,来自csdn的某个大神的:http://blog.youkuaiyun.com/springsky_/article/details/7442388

于是照着来,找到菜单栏:Tools——>Options


 如图设置好后点击close,API Level就全部出来了,呵呵,感谢这位大神贡献的方法,在此收录让更多的人看到~~

您可能感兴趣的与本文相关的镜像

Llama Factory

Llama Factory

模型微调
LLama-Factory

LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

hzk@hzk:~/Desktop/be800v1_12.5sdk/20251014/Iplatform/image/be800v1$ sudo apt update && sudo apt install ubireader-utils [sudo] password for hzk: Ign:1 http://rdsource.tp-link.com/ubuntu jammy InRelease Ign:2 http://packages.microsoft.com/repos/code stable InRelease Ign:3 http://rdsource.tp-link.com/ubuntu jammy-updates InRelease Ign:4 http://rdsource.tp-link.com/ubuntu jammy-backports InRelease Ign:5 http://rdsource.tp-link.com/ubuntu jammy-security InRelease Ign:1 http://rdsource.tp-link.com/ubuntu jammy InRelease Ign:2 http://packages.microsoft.com/repos/code stable InRelease Ign:3 http://rdsource.tp-link.com/ubuntu jammy-updates InRelease Ign:4 http://rdsource.tp-link.com/ubuntu jammy-backports InRelease Ign:5 http://rdsource.tp-link.com/ubuntu jammy-security InRelease Ign:1 http://rdsource.tp-link.com/ubuntu jammy InRelease Ign:2 http://packages.microsoft.com/repos/code stable InRelease Ign:3 http://rdsource.tp-link.com/ubuntu jammy-updates InRelease Ign:4 http://rdsource.tp-link.com/ubuntu jammy-backports InRelease Ign:5 http://rdsource.tp-link.com/ubuntu jammy-security InRelease Err:1 http://rdsource.tp-link.com/ubuntu jammy InRelease Temporary failure resolving 'rdsource.tp-link.com' Err:2 http://packages.microsoft.com/repos/code stable InRelease Temporary failure resolving 'packages.microsoft.com' Err:3 http://rdsource.tp-link.com/ubuntu jammy-updates InRelease Temporary failure resolving 'rdsource.tp-link.com' Err:4 http://rdsource.tp-link.com/ubuntu jammy-backports InRelease Temporary failure resolving 'rdsource.tp-link.com' Err:5 http://rdsource.tp-link.com/ubuntu jammy-security InRelease Temporary failure resolving 'rdsource.tp-link.com' Reading package lists... Done Building dependency tree... Done Reading state information... Done 255 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Failed to fetch http://rdsource.tp-link.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'rdsource.tp-link.com' W: Failed to fetch http://rdsource.tp-link.com/ubuntu/dists/jammy-updates/InRelease Temporary failure resolving 'rdsource.tp-link.com' W: Failed to fetch http://rdsource.tp-link.com/ubuntu/dists/jammy-backports/InRelease Temporary failure resolving 'rdsource.tp-link.com' W: Failed to fetch http://rdsource.tp-link.com/ubuntu/dists/jammy-security/InRelease Temporary failure resolving 'rdsource.tp-link.com' W: Failed to fetch http://packages.microsoft.com/repos/code/dists/stable/InRelease Temporary failure resolving 'packages.microsoft.com' W: Some index files failed to download. They have been ignored, or old ones used instead. Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package ubireader-utils
最新发布
11-03
<think>我们遇到了两个问题:网络连接问题和无法找到包ubireader-utils。首先,错误信息显示“Temporary failure resolving 'rdsource.tp-link.com'”和“Temporary failure resolving 'packages.microsoft.com'”,这表明DNS解析失败或网络不可达。其次,当尝试安装ubireader-utils时,系统提示“E: Unable to locate package ubireader-utils”,这可能是因为软件源中没有这个包,或者软件源列表未更新成功。 解决方案: 1. 解决网络问题:检查网络连接和DNS配置。 2. 更换软件源:如果内部源不可用,可以临时切换到公共源(如阿里云、清华源等)来安装所需的工具。 3. 尝试其他方法安装ubireader:由于ubireader-utils可能不在官方源中,我们可以通过pip安装Python版本的ubireader。 具体步骤: 步骤1:检查网络连接 - 尝试ping一个公共网站,例如: ping -c 4 baidu.com - 如果无法ping通,检查网络设置(如DNS配置在/etc/resolv.conf)或联系网络管理员。 步骤2:如果网络正常,但内部源不可用,可以临时注释掉内部源,使用公共源。 - 备份源列表: sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak - 编辑源列表: sudo vi /etc/apt/sources.list - 将内部源的条目注释掉(在行首添加#),并添加一个公共源,例如阿里云的Ubuntu源(根据系统版本,这里是jammy,即22.04): deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse - 更新软件包列表: sudo apt update 步骤3:再次尝试安装ubireader工具(注意:公共源中可能也没有ubireader-utils,因为它是第三方工具) - 我们可以安装Python版的ubireader: sudo apt install python3-pip # 如果pip3未安装 pip3 install ubireader 但是,根据之前的错误,如果网络问题还没解决,安装pip3也会失败。因此,如果步骤1中网络有问题,必须先解决网络问题。 如果网络问题无法立即解决,可以采用离线方法: 方法:使用之前提到的Python单行命令(如果已经安装了ubireader,则无需再次安装,但这里显然没有) 但是,如果没有网络,我们无法通过pip安装。所以,我们可以考虑在其他有网络的机器上下载ubireader的wheel文件,然后拷贝过来安装。 步骤: a. 在有网络的机器上,下载ubireader及其依赖: pip3 download ubireader 这会下载多个whl文件。 b. 将whl文件拷贝到目标机器,然后安装: pip3 install --no-index --find-links=/path/to/wheels ubireader 但是,用户当前的需求是检查tp_data.ubi内是否有productinfo.bin,因此我们可以考虑使用不需要安装额外工具的方法。 替代方案:使用dd和字符串搜索(无需安装工具) 步骤: 1. 将UBI镜像转换为可搜索的格式(因为UBI镜像可能包含多个卷,但我们可以尝试直接搜索文件名字符串): strings tp_data.ubi | grep -a "productinfo.bin" 2. 如果输出中包含productinfo.bin,说明该文件在镜像中(但注意,这只能说明文件名存在,并不能保证文件内容完整,但通常可以判断存在性)。 注意:如果文件名在镜像中是以连续字符串存储且未被压缩,这个方法有效。如果被压缩或加密,则无效。 另一种方法:使用ubinfo和ubireader_extract_files需要依赖,如果无法安装,我们可以考虑使用docker容器(如果系统安装了docker)来避免环境问题,但前提是网络可用。 考虑到用户当前网络问题,推荐先用字符串搜索的方法。 总结当前情况下的最简操作: 由于网络问题导致无法安装工具,建议: 1. 先尝试修复网络(检查DNS,例如修改/etc/resolv.conf,添加nameserver 8.8.8.8) 2. 如果无法修复网络,则使用字符串搜索: strings tp_data.ubi | grep "productinfo.bin" 如果网络可以修复,则按之前的方法安装ubireader,然后使用单行Python命令。 步骤详细: 修复网络: - 编辑resolv.conf:sudo vi /etc/resolv.conf 添加一行:nameserver 8.8.8.8 # 使用Google DNS - 保存后,再次尝试:ping baidu.com 如果网络恢复,则安装: sudo apt update sudo apt install python3-pip pip3 install ubireader 然后运行: python3 -c "from ubireader.ubi import ubi; print(any('productinfo.bin' in f.full_path for vol in ubi(open('tp_data.ubi','rb')).volumes for f in vol.files))" 如果网络无法恢复,则使用: strings tp_data.ubi | grep "productinfo.bin" 另外,注意错误中提示有255个包可升级,但当前问题不是主要,可以暂时忽略。 根据用户当前需求(快速检查),建议先尝试简单的字符串搜索。 最终,根据实际情况选择方案。 </think>您的 Linux 系统遇到了两个关键问题:**DNS 解析失败**导致软件源无法访问,以及 **`ubireader-utils` 软件包在源中不存在**。以下是完整解决方案: ### 问题解决步骤 #### 1. **修复 DNS 解析问题**(解决 `Temporary failure resolving` 错误) ```bash # 临时使用 Google DNS(立即生效) echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf # 永久修复(重启后生效) sudo vi /etc/systemd/resolved.conf # 取消注释并修改为: [Resolve] DNS=8.8.8.8 1.1.1.1 Domains=~. # 保存后执行 sudo systemctl restart systemd-resolved ``` #### 2. **安装替代工具检查 UBI 镜像** ```bash # 安装必要依赖(绕过问题源) sudo apt install -y python3-pip pip3 install --user ubireader # 单行命令检查文件是否存在 python3 -c "from ubireader.ubi import ubi; print('文件存在' if any('/productinfo.bin' in f.full_path for vol in ubi(open('tp_data.ubi','rb')).volumes for f in vol.files) else '文件不存在')" ``` ### 备选方案(无需安装任何工具) ```bash # 方法一:直接字符串搜索(快速但可能漏检) strings tp_data.ubi | grep -m1 "productinfo.bin" && echo "文件存在" || echo "文件不存在" # 方法二:二进制特征检测 (可靠但复杂) hexdump -C tp_data.ubi | grep -E '70|72|6f|64|75|63|74|69|6e|66|6f|2e|62|69|6e' -m3 # 若连续出现70 72 6f...16进制值(即productinfo.bin的ASCII码)则文件存在 ``` > **结果解读**: > - `python3` 命令输出 **"文件存在"** 或 **"文件不存在"** > - `strings` 命令检测到文件名即表示存在 > - `hexdump` 连续匹配 `p r o d u c t i n f o . b i n` 的16进制值即存在
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值