Thursday, December 18, 2008

Gunzip, Tarballs, RPM, yum and apt-get

Unzip and extract contents of tar/gz/bz2
 [root]# gunzip -dc vsftpd-1.1.2.tar.gz | tar xvf -
 [root]# tar jxvf cvs-1.11.tar.bz2
 [root]# tar xvfz jakarta-tomcat-4.1.tar.gz
 [root]# tar -xf archive-10.3.tar
 [root]# gtar xvfz file.tgz
 [root]# bzip2 -d patch-12.3.bz2
 
How to extract multi-part zip files in Linux
[root]# cat zipfiles.* > zipfiles-full.zip
[root]# zip -F zipfiles-full.zip
[root]# unzip zipfiles-full.zip

Create tarballs
 [root]# tar cfzv cvs-1.11.tar.gz /cvs-home
 [root]# tar cfz back-up.11.tar.gz /tmp /etc

List contents of tarballs
 [root]# tar -tzf cvs-1.11.tar.gz

RPM Commands
 [root]# rpm -qa -------------------> list all rpm install
 [root]# rpm -qa | grep 'mysql' ----> list all rpm related to 'mysql'

 [root]# rpm -q mysql   ----------> query a package version
 [root]# rpm -qi mysql    --------> query information about a package
 [root]# rpm -qf /etc/passwd  ----> query information about a package
 [root]# rpm -qlp ypops-0.7.4-0.FC3.i386.rpm ----> list contents of rpm
 [root]# rpm -ql mysql  ----------> list all files of a package

 [root]# rpm -i mysql.rpm -------------> install a package
 [root]# rpm -ivh mysql.rpm  ----------> install a package with verify and hash
 [root]# rpm -ivh --force mysql.rpm ---> force install a package with verify and hash

 [root]# rpm -Uvh mysql.rpm  -----> update a package with verify and hash
 [root]# rpm -e mysql  -------------> remove a package
 [root]# rpm -e --nodeps mysql -----> remove a package ignoring dependencies

 [root]# rpm -qi mysql  ----------> query information about a package
 [root]# rpm -qi mysql  ----------> query information about a package

 [root]# rpm -K VMware-Player-2.5.1-126130.x86_64.rpm ------> verify checksum

yum Commands
 [root]# yum install java------------------> install java including its dependencies
 [root]# yum upgrade java------------------> upgrade java including its dependencies
 [root]# yum update java-------------------> update java including its dependencies
 [root]# yum clean --> cleans and replaces corrupted repository database file

apt-get Commands
 [root]# apg-get install java------------------> install java including its dependencies
 [root]# apt-get upgrade java------------------> upgrade java including its dependencies
 [root]# apt-get clean --> cleans and replaces corrupted repository database file

dnf Commands
 [root]# dnf install java-11-openjdk-devel -y -----> install package including its dependencies
 [root]# dnf update -y ----------------------------> update package including its dependencies
 [root]# dnf remove java-11-openjdk-devel -y ------> cleans and replaces corrupted repository database file
 

No comments:

Post a Comment