Yum and Apt-Get Command Examples

Ubuntu Update/Upgrade
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

Redhat / CentOS / Fedora
yum clean all
yum update
yum list updates
yum update

To install soft
sudo apt-get install lxde

List all installed packages, enter:

# rpm -qa
# yum list installed

Find out if httpd package installed or not, enter:

# rpm -qa | grep httpd*
# yum list installed httpd

To check for and update httpd package, enter:

# yum update httpd

Remove package called httpd, enter:

# yum remove {package-name-1} {package-name-2}
# yum remove httpd

# yum grouplist
Install all ‘Development Tools’ group packages, enter:

# yum groupinstall “Development Tools”
# yum groupupdate “Development Tools”
# yum groupremove “Development Tools”
$ sudo yum group install “Development Tools”

Task: Display what package provides the file

You can easily find out what RPM package provides the file. For example find out what provides the /etc/passwd file:

# yum whatprovides /etc/passwd

To install GNOME desktop group, enter:

yum groups install “GNOME Desktop”
yum groupinstall “GNOME Desktop”
yum groups install “Server with GUI”
yum groupinstall “Server with GUI”

yum downgrade package1
yum downgrade package1 package2

## get list ##
yum history

## Okay undo/downgrade it ##
yum history undo {NUMBER-HERE}

yum history
yum history list
yum history info

This entry was posted in Fedora, Linux, Redhat, Ubuntu. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *