关于错误IOError:<urlopen error (-3, 'Temporary failure in name resolution')>的解决

本文记录了在Fedora系统中安装TFTP服务器的过程,包括解决安装过程中的错误及安装相关依赖软件包。通过逐步操作指导,最终实现了TFTP服务器的成功搭建与测试。

 fedora安装Tftp时出错:网上对此问题解决方法很多,但都没有解决此问题,最终还是从鸟哥的书上找到答案。

错误信息如下:

[root@tom ~]# yum install xinetd tftp tftp-server
Loaded plugins: refresh-packagekit
http://ftp-stud.hs-esslingen.de/pub/Mirrors/archive.fedoraproject.org/fedora/linux/releases/9/Everything/i386/os/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://fedora-mirror01.rbc.ru/pub/fedora-archive/fedora/linux/releases/9/Everything/i386/os/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/9/Everything/i386/os/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again


解决方法:

[root@tom /]# yum search tftp
Loaded plugins: refresh-packagekit
================================ Matched: tftp =================================
bootparamd.i386 : A server process which provides boot information to diskless
                : clients
curl.i386 : A utility for getting files from remote servers (FTP, HTTP, and
          : others)
jakarta-commons-net.noarch : Internet protocol suite Java library
tcp_wrappers.i386 : A security tool which acts as a wrapper for TCP daemons
tftp.i386 : The client for the Trivial File Transfer Protocol (TFTP)
tftp-server.i386 : The server for the Trivial File Transfer Protocol (TFTP)
[root@tom /]# yum install tftp.i386
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package tftp.i386 0:0.48-3.fc9 set to be updated
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 tftp                    i386       0.48-3.fc9       fedora             28 k


Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         


Total download size: 28 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): tftp-0.48-3.fc9.i386.rpm                          |  28 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: tftp                         ######################### [1/1] 


Installed: tftp.i386 0:0.48-3.fc9
Complete!
[root@tom /]# yum install tftp-server.i386 
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package tftp-server.i386 0:0.48-3.fc9 set to be updated
--> Processing Dependency: xinetd for package: tftp-server
--> Running transaction check
---> Package xinetd.i386 2:2.3.14-18.fc9 set to be updated
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 tftp-server             i386       0.48-3.fc9       fedora             35 k
Installing for dependencies:
 xinetd                  i386       2:2.3.14-18.fc9  fedora            124 k


Transaction Summary
=============================================================================
Install      2 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         


Total download size: 160 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): xinetd-2.3.14-18.fc9.i386.rpm                     | 124 kB     00:01     
(2/2): tftp-server-0.48-3.fc9.i386.rpm                   |  35 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: xinetd                       ######################### [1/2] 
  Installing: tftp-server                  ######################### [2/2] 


Installed: tftp-server.i386 0:0.48-3.fc9
Dependency Installed: xinetd.i386 2:2.3.14-18.fc9
Complete!
[root@tom /]# yum install tcp_wrappers.i386 
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Package tcp_wrappers-7.6-52.fc9.i386 already installed and latest version
Nothing to do
[root@tom /]# yum install curl.i386 
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package curl.i386 0:7.18.1-1.fc9 set to be updated
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 curl                    i386       7.18.1-1.fc9     fedora            149 k


Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         


Total download size: 149 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): curl-7.18.1-1.fc9.i386.rpm                        | 149 kB     00:01     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: curl                         ######################### [1/1] 


Installed: curl.i386 0:7.18.1-1.fc9
Complete!
[root@tom /]# yum install bootparamd.i386 
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package bootparamd.i386 0:0.17-27.fc9 set to be updated
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 bootparamd              i386       0.17-27.fc9      fedora             21 k


Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         


Total download size: 21 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): bootparamd-0.17-27.fc9.i386.rpm                   |  21 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: bootparamd                   ######################### [1/1] 


Installed: bootparamd.i386 0:0.17-27.fc9
Complete!
[root@tom /]# 

测试:
[root@tom /]# cd tftpboot/
[root@tom tftpboot]# ls
[root@tom tftpboot]# vi /etc/xinetd.
xinetd.conf  xinetd.d/    
[root@tom tftpboot]# vi /etc/xinetd.d/t
tcpmux-server  tftp           time-dgram     time-stream    
[root@tom tftpboot]# vi /etc/xinetd.d/tftp 
[root@tom tftpboot]# /etc/init.d/xinetd start
Starting xinetd:                                           [  OK  ]
[root@tom tftpboot]# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
[root@tom tftpboot]# netstat -a | grep tftp
udp        0      0 *:tftp                      *:*                                     

到此tftp启动成功


[root@tom /]# cd home/
[root@tom home]# ls
apache  apache_1.3.36.tar.gz  apache-arm  fzf  smb
[root@tom home]# tftp 127.0.0.1
tftp> help
tftp-hpa 0.48
Commands may be abbreviated.  Commands are:


connect connect to remote tftp
mode     set file transfer mode
put     send file
get     receive file
quit     exit tftp
verbose toggle verbose mode
trace   toggle packet tracing
literal toggle literal mode, ignore ':' in file name
status   show current status
binary   set mode to octet
ascii   set mode to netascii
rexmt   set per-packet transmission timeout
timeout set total retransmission timeout
?       print help information
help     print help information
tftp> get test
tftp> q
[root@tom home]# ls
apache  apache_1.3.36.tar.gz  apache-arm  fzf  smb  test

//本机测试Tftp服务器成功

cargo run -- --force-gtk4 Using GTK version: gtk4 AppStateManager 正在运行... 当前应用状态: AppState { counter: 0, data: [], config: Config { theme: "", language: "", auto_save: false } } 性能统计 - 平均读取: 51.11μs, 平均写入: 0.00μs, 读写比例: 1.0:1 检测到写操作增加,建议使用 Mutex 性能统计 - 平均读取: 0.00μs, 平均写入: 0.00μs, 读写比例: 0.0:1 Running main application with multi-threading support and window management. SHA256 digest: SHA256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 Loading user: 1: Alice Loading user: 2: Bob Loading user: 3: Charlie Loaded 3 users from database Database setup completed successfully Starting Linux GTK4 application... Linux GTK4 application activating... Message system initialized ✓ Added cell at row 0, col 0, text: &#39;Cell 0-0&#39; ✓ Added cell at row 0, col 1, text: &#39;Cell 0-1&#39; ✓ Added cell at row 0, col 2, text: &#39;Cell 0-2&#39; ✓ Added cell at row 0, col 3, text: &#39;Cell 0-3&#39; ✓ Added cell at row 0, col 4, text: &#39;Cell 0-4&#39; ✓ Added cell at row 1, col 0, text: &#39;Cell 1-0&#39; ✓ Added cell at row 1, col 1, text: &#39;Cell 1-1&#39; ✓ Added cell at row 1, col 2, text: &#39;Cell 1-2&#39; ✓ Added cell at row 1, col 3, text: &#39;Cell 1-3&#39; ✓ Added cell at row 1, col 4, text: &#39;Cell 1-4&#39; ✓ Added cell at row 2, col 0, text: &#39;Cell 2-0&#39; ✓ Added cell at row 2, col 1, text: &#39;Cell 2-1&#39; ✓ Added cell at row 2, col 2, text: &#39;Cell 2-2&#39; ✓ Added cell at row 2, col 3, text: &#39;Cell 2-3&#39; ✓ Added cell at row 2, col 4, text: &#39;Cell 2-4&#39; ✓ Added cell at row 3, col 0, text: &#39;Cell 3-0&#39; ✓ Added cell at row 3, col 1, text: &#39;Cell 3-1&#39; ✓ Added cell at row 3, col 2, text: &#39;Cell 3-2&#39; ✓ Added cell at row 3, col 3, text: &#39;Cell 3-3&#39; ✓ Added cell at row 3, col 4, text: &#39;Cell 3-4&#39; ✓ Added cell at row 4, col 0, text: &#39;Cell 4-0&#39; ✓ Added cell at row 4, col 1, text: &#39;Cell 4-1&#39; ✓ Added cell at row 4, col 2, text: &#39;Cell 4-2&#39; ✓ Added cell at row 4, col 3, text: &#39;Cell 4-3&#39; ✓ Added cell at row 4, col 4, text: &#39;Cell 4-4&#39; (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:38:21-23: Percentages are not allowed here (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:65:13-21: No property named "position" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:69:13-16: No property named "top" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:70:13-17: No property named "left" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:71:13-18: No property named "right" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:75:13-19: No property named "bottom" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:76:13-17: No property named "left" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:77:13-18: No property named "right" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:81:13-16: No property named "top" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:82:13-19: No property named "bottom" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:83:13-17: No property named "left" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:87:13-16: No property named "top" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:88:13-19: No property named "bottom" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.778: Theme parser error: <data>:89:13-18: No property named "right" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.779: Theme parser error: <data>:101:13-28: No property named "backdrop-filter" (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.779: Theme parser error: <data>:105:35-40: Percentages are not allowed here (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.779: Theme parser error: <data>:109:35-39: Percentages are not allowed here (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.779: Theme parser error: <data>:113:35-40: Percentages are not allowed here (baota-gtk4:33879): Gtk-WARNING **: 09:31:23.779: Theme parser error: <data>:117:35-39: Percentages are not allowed here (baota-gtk4:33879): GLib-GObject-CRITICAL **: 09:31:23.779: cannot register existing type &#39;GdkDisplayManager&#39; (baota-gtk4:33879): GLib-CRITICAL **: 09:31:23.779: g_once_init_leave_pointer: assertion &#39;result != 0&#39; failed (baota-gtk4:33879): GLib-GObject-CRITICAL **: 09:31:23.779: g_object_new_with_properties: assertion &#39;G_TYPE_IS_OBJECT (object_type)&#39; failed 段错误 (核心已转储) cargo run -- --flutter --force-linux Running `/home/kingjeeps/target/debug/baota-gtk4 --flutter --force-linux` === 运行 Cairo 功能测试 === 当前工作目录: "/media/kingjeeps/stc3/baota-gtk4" 检查路径: Pictures/test_image.png -> 存在: true 检查路径: ../Pictures/test_image.png -> 存在: false 检查路径: ./Pictures/test_image.png -> 存在: true 检查路径: /media/kingjeeps/stc3/baota-gtk4/Pictures/test_image.png -> 存在: true IoError(Custom { kind: Other, error: "测试 IO 错误" }) Image dimensions: 100x100 图像加载成功,尺寸: 100x100 图像颜色类型: Rgb8 Read integer: 1196314761 图像信息: 颜色类型: Rgb8 宽度: 800 高度: 600 Context 绘图操作完成 === 启动 GTK Cairo 应用程序 === 未知选项 --flutter error: unexpected argument &#39;--flutter&#39; found 这个在cargo run时无错误,在cargo run -- --flutter --force-linux时无法识别:未知选项 --flutter ,然后退出,为什么?
最新发布
10-25
`cargo run` 正常而 `cargo run -- --flutter --force-linux` 提示未知选项 `--flutter` 并退出,可能有以下原因: ### 1. 项目配置问题 项目的 `Cargo.toml` 文件中定义的可执行程序可能并未对 `--flutter` 和 `--force-linux` 选项进行处理。`Cargo.toml` 是 Rust 项目的配置文件,其中的 `[package]` 和 `[dependencies]` 等部分定义了项目的元数据和依赖项,而 `[bin]` 部分定义了可执行程序。如果可执行程序的入口代码(通常是 `src/main.rs`)没有对这些选项进行解析和处理,Rust 就会认为这些是未知选项。 ### 2. 依赖库问题 项目可能依赖了一些命令行参数解析库,如 `clap` 或 `structopt`,用于解析命令行参数。如果这些库的配置不正确,没有将 `--flutter` 和 `--force-linux` 定义为有效的选项,就会导致提示未知选项。 ### 3. 版本兼容性问题 使用的 Rust 工具链版本、依赖库版本可能与项目不兼容。不同版本的 Rust 或依赖库可能会有不同的行为,某些版本可能不支持特定的命令行选项解析方式。 ### 4. 环境问题 环境变量或系统配置可能影响了命令的执行。例如,某些环境变量可能会改变 Rust 程序的行为,导致无法正确解析命令行选项。 以下是一个简单的使用 `clap` 库解析命令行选项的示例代码: ```rust use clap::Parser; /// A simple program to demonstrate option parsing #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] struct Args { /// Enable flutter mode #[clap(long)] flutter: bool, /// Force Linux mode #[clap(long)] force_linux: bool, } fn main() { let args = Args::parse(); if args.flutter { println!("Flutter mode enabled"); } if args.force_linux { println!("Forcing Linux mode"); } } ``` 在这个示例中,定义了 `--flutter` 和 `--force-linux` 两个选项,并在 `main` 函数中对它们进行了处理。
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值