Archive

Archive for July, 2013

Mount DVD as Yum repository

July 29, 2013 Leave a comment

1. Mount the Redhat source DVD to /mnt
# mount /dev/sr0 /mnt

2. Setup the repository information
# vi /etc/yum.repos.d/rhel-dvd.repo
[dvd]
name=Red Hat Enterprise Linux Installation DVD
baseurl=file:///mnt/Server
enabled=0
gpgcheck=0

3. Use the repository to install packages (For examples, installing snmp packages)
# yum install –enablerepo=dvd net-snmp*

Advertisements
Categories: Redhat Administration

Create local yum repository

July 26, 2013 Leave a comment

1. Copy all packages into local directory /opt/yum/rhel6.3/repodata

# mkdir -p /opt/yum/rhel6.3/repodata

# mount /dev/sr0 /mnt ( redhat CDROM)

# cd /mnt/Packages

# cp -a * /opt/yum/rhel6.3/repodata

2. Copy the main xml from the CDROM repodata directory and rename it to comps.xml 

# cd /mnt/repodata

# cp *comps*.xml /opt/yum/rhel6.3/repodata/comps.xml

 
3. Install createrepo
 
# cd /mnt/Packages
# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64
# rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
 
4. Create local repository files
# cd /opt/yum/rhel6.3
# createrepo -g repodata/comps.xml .
 
5. Create local yum repository
# cd /etc/yum.repos.d
# vi rhel-local.repo[rhel6.3-local]
name=RHEL 6.3 local repository
baseurl=file:///opt/yum/rhel6.3/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled=1
 
 
 

Install GUI on Ubuntn Server

July 12, 2013 Leave a comment

1. Enable system proxy on server (Refer to my another posting ”
Setup System Proxy on Ubuntu for packages updates and installation”)

2. Update system
# apt-get update

3. Install the “minimal” GUI desktop,
# apt-get install –no-install-recommends ubuntu-desktop

4. Reboot the server

Categories: Ubuntu

Setup System Proxy on Ubuntu for packages updates and installation

July 12, 2013 Leave a comment

1. Add the following entries into /etc/environment

http_proxy=http://myproxy.server.com:8080/
https_proxy=http://myproxy.server.com:8080/
ftp_proxy=http://myproxy.server.com:8080/
no_proxy=”localhost,127.0.0.1,localaddress,.localdomain.com”
HTTP_PROXY=http://myproxy.server.com:8080/
HTTPS_PROXY=http://myproxy.server.com:8080/
FTP_PROXY=http://myproxy.server.com:8080/
NO_PROXY=”localhost,127.0.0.1,localaddress,.localdomain.com”

2. Create a file under /etc/apt/apt.conf.d, called 95proxies and add the entries below

Acquire::http::proxy “http://myproxy.server.com:8080/”;
Acquire::ftp::proxy “ftp://myproxy.server.com:8080/”;
Acquire::https::proxy “https://myproxy.server.com:8080/”;

3. Edit /etc/hosts to add myproxy.server.com IP like as following ( Replace xxx.xxx.xxx.xxx with IP)
xxx.xxx.xxx.xxx myproxy.server.com

4. Restart the server to make sure the changes take effect.

Categories: Ubuntu