AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-373460

Adrián Jaramillo's questions

Martin Hope
Adrián Jaramillo
Asked: 2020-01-23 14:59:54 +0800 CST

`/etc/hosts` 中同一主机的不同 IP:hostName 映射。为什么这行得通?

  • 0

我的场景

我的相关条目/etc/hosts(我按照您在此处看到的相同顺序编写它们)

172.22.5.107    www.wordpress-rend-adri.com
192.168.1.116   www.wordpress-rend-adri.com

我在家里和学校使用笔记本电脑,因此我总是处理 2 个地址空间:

  • 192.168.1.0/24
  • 172.22.0.0/16

所以我有这些条目,因为我有一个带有 Wordpress 的虚拟机来做练习。这样,无论我在哪里,我都可以访问我的 Wordpress(只要 DHCP 显然在两个网络中为我提供了相同的 IP)

我的问题

知道了这一切,现在我可以告诉你,我刚刚在我的配置中进行了该配置,/etc/hosts因为一位老师对我说,我只能有 1 条记录用于指向单个 IP 的名称。他对我说,如果我有一个同名的双寄存器,它总是取第一个,然后停止。但他也对我说我应该试试,所以我做了。

现实情况是,例如在我家(我正在使用的地方192.168.1.0/24),即使第一条记录是针对其他 IP 的,我仍然可以建立连接,并且当我 ping 名称时,正确的 IP 会回答我。是的,我确实试图完全确定这一点,我在一个隐身的 Firefox 窗口中做了,我还尝试评论我家的 IP 行以检查发生了什么。

然后,我尝试交换这两个记录。我的意思是,我只是这样做了:

192.168.1.116   www.wordpress-rend-adri.com
172.22.5.107    www.wordpress-rend-adri.com

所以在这种情况下,显然它仍然有效。

而当我上学时,使用其他地址空间时也发生了同样的情况。

所以...
_/etc/hosts

¿ 在进行最终连接之前,firefox、ping二进制文件或您使用的任何东西是否会进行名称解析的内部过程以检查实际有效的条目是什么?
我问这个是因为例如使用ping,您刚开始从有效的 IP 获得答案。您不会遇到连接失败的情况,例如尝试连接到其他以前的 IP

ping hosts
  • 2 个回答
  • 176 Views
Martin Hope
Adrián Jaramillo
Asked: 2019-10-14 11:30:01 +0800 CST

如果使用 dpkg -l 它说安装在所有体系结构中,我如何检查哪个是已安装的软件包版本?

  • 0

如果我检查我的软件包列表,dpkg -l我会发现有几个软件包安装在“所有”架构中。然后,如果我apt policy <name_of_package>使用它说为所有架构安装的随机包的名称运行,我会得到这个输出(例如,使用adduser):

adduser:
  Installed: 3.118
  Candidate: 3.118
  Version table:
 *** 3.118 990
        990 http://deb.debian.org/debian buster/main amd64 Packages
        990 http://deb.debian.org/debian buster/main i386 Packages
        500 http://deb.debian.org/debian sid/main amd64 Packages
        500 http://deb.debian.org/debian sid/main i386 Packages
        100 /var/lib/dpkg/status

该软件包只有一个版本,而且我知道三个星号表示已安装该版本。
好的,但我可以看到 4 个不同的来源,具有不同的架构和版本。
那么
如何检查安装了哪些?还是它们都安装了,所以我安装了同一个包的 4 个版本?

debian
  • 1 个回答
  • 128 Views
Martin Hope
Adrián Jaramillo
Asked: 2019-10-08 13:55:54 +0800 CST

当我有来自 buster 和 sid 的存储库时,如何通过 apt update 和 upgrade 制作特定版本的 apt install 包?

  • 1

注意力!这是一个与我的学习相关的任务的问题。我的老师说这个任务可能没有解决方案,但我们需要尽我们所能来学习管理包。这意味着,请不要回答“没有解决方案”。如果没有解决方案,请我想知道为什么,如果有解决这个问题的中途解决方案,请说出来。
谢谢阅读

场景描述

我的虚拟机正在运行 Debian 10,并且在其中/etc/apt/sources.list我有用于 buster 和 sid 版本的存储库。
在这里你有我的sources.list

# 

# deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 NETINST 20190706-10:23]/ buster main

#deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 NETINST 20190706-10:23]/ buster main

deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

#SID repos
deb http://deb.debian.org/debian sid main
deb-src http://deb.debian.org/debian sid main

其次,在我的/etc/apt/preferences.d目录中,我有一个名为sid_priority. 这些是它的内容

Package: *
Pin: release a=sid
Pin-Priority: -1

关于这个文件的一点解释

这个文件“意味着”将所有 sid 包的优先级降低到 -1,所以当我运行sudo apt updateand时sudo apt upgrade,我最终只安装和升级了 buster 的包。sid 存储库仅用于手动安装和升级,比如说运行sudo apt install(另请注意,我几乎不知道包优先级是如何工作的,我只看到一点互联网,我只能理解基础知识)。

我想要达到的目标

我只想通过 buster 存储库默认安装和升级。这意味着,如果我运行sudo apt update' orsudo apt upgrade , I'm not going to install any sid packages. I'll just install sid packages if I runsudo apt install`

我发生什么事了

我认为优先级是有效的,但是通过执行sudo apt upgrade我最终得到了 sid 包。你可以看一个例子:

libc6:
  Installed: 2.29-2
  Candidate: 2.29-2
  Version table:
 *** 2.29-2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
        100 /var/lib/dpkg/status
     2.28-10 500
        500 http://deb.debian.org/debian buster/main amd64 Packages

顺便说一句,无论你想要什么,都不要害怕提出任何建议,因为我正在使用虚拟机,而且我正在使用一个专门用于此任务的虚拟机。如果我需要删除它,我会这样做。
谢谢你的帮助

debian
  • 2 个回答
  • 1442 Views
Martin Hope
Adrián Jaramillo
Asked: 2019-09-23 14:34:16 +0800 CST

如何检查我是否在 linux 上有任何丢失或可升级的驱动程序?| Debian 10

  • 2

笔记本电脑:华硕 TUF Gaming FX504GD

以 lspci 为例,您可以检查一些硬件,然后您可以浏览互联网并找到要安装的驱动程序。但是我想知道是否有任何方法可以检查您是否在 linux 上有任何丢失或可升级的驱动程序。
我想知道Linux中是否有类似于“DriversCloud”的程序来解决这个任务。我不介意软件是否有 GUI。
我刚买了一台笔记本电脑来学习系统管理员,我无法猜测我还需要安装哪个驱动程序。提前致谢。

debian
  • 2 个回答
  • 7011 Views
Martin Hope
Adrián Jaramillo
Asked: 2019-09-21 13:04:52 +0800 CST

Debian 10 apt 更新问题

  • 4

我刚刚完成了 Debian buster 的全新安装,但我在使用 APT 时遇到了问题。

我跑了sudo apt update,我得到了这个

Ign:1 cdrom://[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07] buster InRelease
Err:2 cdrom://[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07] buster Release
 Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Hit:3 http://deb.debian.org/debian buster InRelease              
Ign:4 http://deb.debian.org/debian buster/updates InRelease      
Hit:5 http://deb.debian.org/debian buster-updates InRelease
Err:6 http://deb.debian.org/debian buster/updates Release
  404  Not Found [IP: 151.101.132.204 80]
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07] buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian buster/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:4

这里有我的sources.list的内容

    # 

deb cdrom:[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07]/ buster main
deb cdrom:[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07]/ buster main

deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main

deb http://deb.debian.org/debian/ buster/updates main
deb-src http://deb.debian.org/debian/ buster/updates main

# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main
deb-src http://deb.debian.org/debian/ buster-updates main

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

我真的不明白这里有什么问题,如果这些是我在文件中干净安装附带的默认源,我什么也没做。

debian
  • 3 个回答
  • 15978 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve