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
    • 最新
    • 标签
主页 / server / 问题 / 427110
Accepted
Billy Moon
Billy Moon
Asked: 2012-09-14 05:51:31 +0800 CST2012-09-14 05:51:31 +0800 CST 2012-09-14 05:51:31 +0800 CST

从干净的 ubuntu 安装下载单个文件

  • 772

互联网上是否有资源,我可以在其中下载 ubuntu 服务器安装所需的单个文件?

/etc/grub.d/00_header在这种情况下,我需要Ubuntu 服务器 12.04的干净版本。有时我想为特定的 linux 版本获取文件的干净版本。

除了在其他地方再次安装 ubuntu 并从那里复制文件之外,我将如何获取我需要的文件?


我做了apt-get upgrade一个新版本的 grub 替换有问题的版本的希望,并得到了这个错误。据我了解,更新后的 grub 应该替换旧的(我选择使用 /etc/defualt/grub 的包维护者版本),因此解析后出现的错误与新的 grub 版本有关,而不是我的本地版本版本。那是对的吗?

Replacing config file /etc/default/grub with new version                                                                                                                             
/usr/sbin/grub-setup: warn: Sector 32 is already in use by FlexNet; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
/usr/sbin/grub-setup: warn: Sector 33 is already in use by FlexNet; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
Installation finished. No error reported.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-29-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-29-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-25-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-25-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-23-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-23-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 32
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
ubuntu
  • 2 2 个回答
  • 435 Views

2 个回答

  • Voted
  1. Best Answer
    gertvdijk
    2012-09-14T06:15:51+08:002012-09-14T06:15:51+08:00

    虽然 @cjc 为包管理提供的一般文件提供了一种低级方法,但配置文件有一种更简洁的方法。这里的关键是这个问题--force-confmiss的答案中解释的选项。

    这是文件的示例/etc/dnsmasq.conf。

    判断所属二进制包

    例如运行/etc/dnsmasq.conf

    # dpkg -S /etc/dnsmasq.conf
    dnsmasq: /etc/dnsmasq.conf
    

    这意味着你必须获得dnsmasq包裹。

    下载正确的 .deb 包

    例如:

    $ aptitude download dnsmasq
    Get:1 http://ftp.nl.debian.org/debian/ squeeze/main dnsmasq all 2.55-2 [14.2 kB]
    Fetched 14.2 kB in 0s (190 kB/s)
    
    $ ls
    dnsmasq_2.55-2_all.deb
    

    让dpkg替换你想要的文件

    首先删除您需要重置为默认值的文件。

    # rm /etc/dnsmasq.conf
    # dpkg -i --force-confmiss dnsmasq_2.55-2_all.deb
    
    • 5
  2. cjc
    2012-09-14T06:03:16+08:002012-09-14T06:03:16+08:00

    获取该文件的 deb 文件。它在grub-common包裹里。一旦你有了它,你就可以运行dpkg-deb来提取包。

    所以,像这样:

    $ wget http://us.archive.ubuntu.com/ubuntu/pool/main/g/grub2/grub-common_1.99-22ubuntu2_i386.deb`
    $ mkdir tmp
    $ dpkg-deb -x grub-common_1.99-22ubuntu2_i386.deb ./tmp
    $ ls tmp/etc/grub.d/
    00_header        10_linux         30_os-prober     41_custom        
    05_debian_theme  20_linux_xen     40_custom        README           
    
    • 3

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve