Monday, January 22, 2007

How to Set a Linux Host Name in Office

We have a Microsoft dynamic DNS server in the office, so you can dynamically register your host name when you get the dhcp IP address. Your Windows system can get it automatically, while your Linux system should do some configuration.

For Debian you need add some items in /etc/interfaces. For more info in Debian, see "man interfaces" and scroll down to "The dhcp Method".

For Fedora Core you will do something below:

/etc/sysconfig/network
HOSTNAME=YourLinuxHostName

/etc/sysconfig/networking/devices/ifcfg-eth0
DHCP_HOSTNAME=YourLinuxHostName


Then restart your network, it should be ok.

Thursday, January 18, 2007

Argument list too long

When I execute the command:
# ls /media/dvd/Fedora/RPMS/*.rpm
bash: /bin/ls: Argument list too long

Q: What's the problem?
A: "The UNIX operating system traditionally has a fixed limit for the amount of memory that can be used for a program environment and argument list combined."
# getconf ARG_MAX
131072
# cd /media/dvd/Fedora/
# ls RPMS/*.rpm|wc
2931 2931 116609

If I include "/media/dvd/Fedora" in the list, it would exceed 131072. Reducing PATH name or using Shell script can run those commands correctly.

Tuesday, January 16, 2007

Problem When Create Local YUM Repository Using FC6 DVD

cat /etc/yum.repos.d/fedora-core.repo

[core]
name=Fedora Core $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=file:///media/dvd/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


#yum install elinks
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for ncompress to pack into transaction set.
media://1161131669.029329%235/Fedora/RPMS/elinks-0.11.1-5.i386.rpm: [Errno 4] IOError:
Trying other mirror.
Error: failed to retrieve Fedora/RPMS/elinks-0.11.1-5.i386.rpm from core
error was [Errno 4] IOError:

Solution:
Just copy some repodata files from the RedHat sites to /var/cache/yum/core:
comps.xml repomd.xml filelists.xml.gz other.xml.gz primary.xml.gz
Then yum works well.

Conclusion:
Repo files on FC6-i386 DVD sounds not correct; no such problem on FC6-x86-64bit DVD.