yum & repos - alex-aleyan/linux_wiki GitHub Wiki
- https://vault.centos.org/8.5.2111/
- Typical /etc/yum.repos/ content:
[appstream] name=CentOS Linux $releasever - AppStream #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra # baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ baseurl=https://vault.centos.org/8.5.2111/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=1 gpgcheck=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 [epel-debuginfo] name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/debug metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux $releasever - $basearch - Source # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Everything/SRPMS metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 [epel-modular] name=Extra Packages for Enterprise Linux Modular $releasever - $basearch # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Modular/$basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=1 gpgcheck=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 [epel-modular-debuginfo] name=Extra Packages for Enterprise Linux Modular $releasever - $basearch - Debug # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Modular/$basearch/debug metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 [epel-modular-source] name=Extra Packages for Enterprise Linux Modular $releasever - $basearch - Source # It is much more secure to use the metalink, but if you wish to use a local mirror # place it's address here. #baseurl=https://download.example/pub/epel/$releasever/Modular/SRPMS metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 gpgcheck=1 [powertools] name=CentOS Linux $releasever - PowerTools #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra #baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ baseurl=https://vault.centos.org/8.5.2111/PowerTools/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [sublime-text] name=Sublime Text - x86_64 - Stable baseurl=https://download.sublimetext.com/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://download.sublimetext.com/sublimehq-rpm-pub.gpg[/etc/yum.repos.d]
- Installed Meld
yum install epel-release yum install meld
-
In this directory, MIRRORS are listed within each file:
/etc/yum.repos.d
-
vim /etc/fstab:
/dev/sr0 /media/centos7 iso9660 defaults 0 0
# Install a Package with YUM
yum install util_name
yum -y install util_name
# Install a Package from Specific Repository
yum --disablerepo="*" --enablerepo="FullDisk" install wireshark
# Removing a Package with YUM
yum remove util_name #quiet
yum -y remove util_name #quiet
# check for available update:
yum check-update
# update particular utility:
yum update util_name
# update all:
yum update
# List all available packages in the YUM Database:
yum list
# search for a particular package
yum list util_name
# Search for a Package when not know the exact name of the package:
yum search util_name
# list installed packages:
yum list installed
# Get info about a package
yum info util_name
# Determine which package the file belongs to:
yum provides /path_to_file
yum whatprovides /path_to_file
yum deplist <utility_name>
# Adding groups to the repo (https://unix.stackexchange.com/questions/246953/how-do-i-get-yum-groupinstall-to-work-without-a-groups-install-file):
createrepo -g <path to repo>/repodata/*comps.xml --update <path to repo>
yum clean all
# List all available Group Packages:
yum grouplist
# See who provides a given 'Group_name'
yum groupinfo "Development Tools"
# Install a Group Packages
yum groupinstall "Development Tools"
# Update a Group Packages
yum groupupdate "Development Tools"
# Remove a Group Packages
yum groupremove "Development Tools"
# List Enabled Yum Repositories
yum repolist
# List all Enabled and Disabled Yum Repositories
yum repolist all
# Interactive Yum Shell
yum shell
# Clean Yum Cache
yum clean all
# View History of Yum
yum history
-
To add a remote mirror:
-
Configure proxy:
vim /etc/yum.conf proxy=http://<YOUR PROXY HERE>:8080
-
Add the mirror (you might need to install
ca-certificates
andyum-utils
):yum-config-manager --add-repo=<HTTP LINK HERE>
-
You might have to disable
firewalld
andselinux
.
-
-
Copy the repos from DVD1 and DVD2 to a local diretory:
cp -r /media/dvd1/* /repo/centos/ cp -r /media/dvd2/Packages/* /repo/centos/Packages
-
Create the repo file:
[root@z_book_vm altera]# cat /etc/yum.repos.d/CentOS-DVD.repo # CentOS-Media.repo # # This repo can be used with mounted DVD media, verify the mount point for # CentOS-6. You can use this repo and yum to install items directly off the # DVD ISO that we release. # # To use this repo, put in your DVD and use it with the other repos too: # yum --enablerepo=c6-media [command] # # or for ONLY the media repo, do this: # # yum --disablerepo=\* --enablerepo=c6-media [command] [centos6-DVD] name=CentOS-$releasever - Media baseurl=file:///repo/centos gpgcheck=0 enabled=1
-
Create an actual repo first:
createrepo /home99/RHEL6.9_Server
-
if createrepo is not installed:
rpm -ivh libxml2-python-2.9.1-5.el7.x86_64.rpm rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm
-
-
Let the yum know about the repo changes:
createrepo --update /home99/RHEL6.9_Server rm -rf /var/cache/yum/* yum clean all
-
This step is optional and will update the whole system's utilities with the lates stuff found in repos:
yum update
-
To turn on/off a repo (disabling all repos except the local ones seems to resolve issues!):
yum repolist all yum --disablerepo=”*” --enablerepo=”reponame” list available yum-config-manager --add-repo "repository_url" yum-config-manager --enable "<REPO NAME>" yum-config-manager --disable "<REPO NAME>"
-
if yum-config-manager is not installed:
rpm -ivh python-chardet-2.2.1* rpm -ivh python-kitchen-1.1.1-* rpm -ivh yum-utils-1.1.*
-