我在网上看到的大部分信息都说要编辑/etc/resolv.conf,但我在那里所做的任何更改都会被覆盖。
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND --
# YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
Run Code Online (Sandbox Code Playgroud)
似乎 127.0.1.1 是dnsmasq. 该dnsmasq文件说来编辑/etc/resolv.conf。我试图把自定义的域名服务器中/etc/resolv.conf.d/base,但在变化没露面/etc/resolv.conf后运行sudo resolvconf -u。
仅供参考,我不想在每个连接的基础上更改 DNS,我想设置默认 DNS 设置以在未另行指定时用于所有连接。
更新:
我自己回答了这个问题:https : //unix.stackexchange.com/a/163506/67024
我认为这是最好的解决方案,因为:
众所周知,apt-get具有超级牛的力量,aptitude但不:
$ apt-get --help | grep -i cow
This APT has Super Cow Powers.
$ aptitude --help | grep -i cow
This aptitude does not have Super Cow Powers.
Run Code Online (Sandbox Code Playgroud)
当然,APT 有一个复活节彩蛋来搭配它:
$ apt-get moo
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
...."Have you mooed today?"...
Run Code Online (Sandbox Code Playgroud)
我很好奇,这个复活节彩蛋背后有什么故事吗?它的历史是什么?我知道它已经在 apt 中使用了很长时间——从旧 Debian 版本中的 apt 源的快速 grep 中,它在 Debian 2.2(土豆;apt 0.3.19)和 Debian 3.0(woody;apt 0.5.4)之间的某个时间获得了它。
编辑:根据Debian-Devel 邮件列表上Jacob Kuntz的消息,它于 2001 年 2 月在 apt …
我知道,无论apt-get和aptitude是Debian的命令行包管理界面的Linux衍生,用不同的选择,但我还是有点困惑。在幕后,他们不是使用相同的 APT 系统吗?
我只是注意到,在我的一台机器上(运行 Debian Sid),每当我输入ls任何带空格的文件名时,它周围都有单引号。
我立即检查了我的别名,却发现它们完好无损。
wyatt@debian630:~/testdir$ ls
'test 1.txt' test1.txt
wyatt@debian630:~/testdir$ alias
alias ls='ls --color=auto'
alias wget='wget --content-disposition'
wyatt@debian630:~/testdir$
Run Code Online (Sandbox Code Playgroud)
另一个测试,文件名中包含单引号(也回答了 jimmij 的请求):
wyatt@debian630:~/testdir$ ls
'test 1.txt' test1.txt 'thishasasinglequotehere'\''.txt'
wyatt@debian630:~/testdir$ touch "'test 1.txt'"
wyatt@debian630:~/testdir$ ls
''\''test 1.txt'\''' test1.txt
'test 1.txt' 'thishasasinglequotehere'\''.txt'
Run Code Online (Sandbox Code Playgroud)
使用新的 coreutils-8.26 输出进行更新(诚然,这不那么令人困惑,但默认情况下仍然令人恼火)。感谢 Pádraig Brady 提供此打印输出:
$ ls
"'test 1.txt'" test1.txt
'test 1.txt' "thishasasinglequotehere'.txt"
$ ls -N
'test 1.txt' test1.txt
test 1.txt thishasasinglequotehere'.txt
Run Code Online (Sandbox Code Playgroud)
为什么会这样?我如何正确停止它?
需要明确的是,我自己将 ls 设置为自动彩色输出。它从来没有在事物周围加上引号。
我正在运行bash,coreutils 8.25。
有什么方法可以在不重新编译的情况下解决这个问题?
编辑:出现 coreutils 开发人员选择)打破惯例并将其设为全局默认值。 …
我使用 docker 镜像作为我自己开发的基础,在其 Dockerfile 中添加 jessie backports 存储库并使用它来安装依赖项。此映像使用以下命令添加存储库:
echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)
问题是从 backports 存储库中获取包现在失败并出现以下错误(以前可以使用):
W: Failed to fetch
http://ftp.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages
404 Not Found
W: Failed to fetch
http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
404 Not Found
Run Code Online (Sandbox Code Playgroud)
我查看了那台服务器,那里确实不存在这些路径。
我试图在 Debian backports 站点上弄清楚这个特定的存储库是否仍然可用,但我没有发现任何迹象表明它已被弃用或类似的东西。
这是存储库的临时问题,还是 jessie-backports 存储库不再可用?如果这不是临时问题,在不升级到较新的 Debian 稳定版本的情况下,我有哪些选择可以使用这个或等效的存储库?
我无法通过 ssh 连接到要求diffie-hellman-group1-sha1密钥交换方法的服务器:
ssh 123.123.123.123
Unable to negotiate with 123.123.123.123 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)
如何diffie-hellman-group1-sha1在 Debian 8.0 上启用密钥交换方法?
我曾尝试(如建议在这里),以
将以下行添加到我的 /etc/ssh/ssh_config
KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr
Run Code Online (Sandbox Code Playgroud)重新生成密钥
ssh-keygen -A
Run Code Online (Sandbox Code Playgroud)重新启动 ssh
service ssh restart
Run Code Online (Sandbox Code Playgroud)
但仍然得到错误。
执行时apt-get update,我收到以下错误:
root@ADS3-Debian6:/home/aluno# apt-get update
Atingido http://sft.if.usp.br squeeze Release.gpg
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-en
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt_BR
Run Code Online (Sandbox Code Playgroud)
(……)
Obter:10 http://security.debian.org squeeze/updates/non-free i386 Packages [14 B]
Baixados 612 kB em 4s (125 kB/s)
Lendo listas de pacotes... Pronto
There is no public key available for the following key IDs: 8B48AD6246925553
Run Code Online (Sandbox Code Playgroud) 在 Ubuntu 中,可以通过以下命令添加存储库 -
sudo add-apt-repository ppa:yannubuntu/boot-repair
Run Code Online (Sandbox Code Playgroud)
由于 Ubuntu 是基于 Debian 代码库的,我原以为它也能在 Debian 中运行,但事实并非如此。
注意:我知道我可以编辑/etc/apt/sources.list,但我想从 shell 实现这一点。我还想知道为什么当代码库相同时相同的命令不起作用。
我想运行此命令的相反操作以删除 Debian 8.1 中的不兼容存储库
sudo add-apt-repository -y ppa:nemh/systemback
Run Code Online (Sandbox Code Playgroud)
命令add-apt-repository在包中的位置software-properties-common。我在 中找不到systemback条目/etc/apt/sources.list。
你怎么能运行相反的命令?
我正在运行 Debian Squeeze Web 服务器。我已经在其上安装了 memcached,并将 memcached 配置为侦听 Unix 域套接字(at /tmp/memcached.sock),因为它只需要从位于同一服务器上的网站接收消息。
它似乎工作正常,但我也想通过 shell 与 memcached 通信,以检查它是否在做我认为它在做的事情。
memcached 通过简单的 ASCII 协议接受消息(如果我理解正确的话)。如果它正在侦听 TCP/IP,我可以通过以下方式向它发送消息nc:
$ echo "stats settings" | nc localhost 11211
Run Code Online (Sandbox Code Playgroud)
但我不知道如何将该文本发送到域套接字。
在我的笔记本电脑(运行OS X Lion中),都nc和telnet有选择(-U并-u分别)使用域套接字。但是,在我的 Debian Squeeze Web 服务器上,这些选项不存在。