Manage Yum and Repository

TIPS & TRICKS

To search the contents of the man pages

# man -k searchterm 
# man -K searchterm

Repository task examples

Create a repository 1

| Add new repositories :
| - http://classroom.example.com/rhel8.0/x86_64/dvd/AppStream
| - http://classroom.example.com/rhel8.0/x86_64/dvd/BaseOS

Do it in console (not remote), if there is no ip or hostname assigned to take remote connectivity.

You can do that:

# dnf config-manager --add-repo http://classroom.example.com/rhel8.0/x86_64/dvd/AppStream
# dnf config-manager --add-repo http://classroom.example.com/rhel8.0/x86_64/dvd/BaseOS

And have this files created (If that doesn’t work, you can write it manualy like below).
Note: You might encounter gpgcheck check failures when you add a new repo, so skip gpg checks in that case append to the new repo file the following.

gpgcheck=0
# cat /etc/yum.repos.d/AppStream.repo
[AppStream]
name=AppStream
baseurl=http://classroom.example.com/rhel8.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0
# cat /etc/yum.repos.d/BaseOS.repo
[BaseOS]
name=BaseOS
baseurl=http://classrom.example.com/rhel8.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0

Lists the repositories:

# yum list
# yum repolist all
# yum repolist | grep my_custom_repo
# yum install <something of my_custom_repo>

If needed:

# dnf config-manager --enable rht-updates
# dnf config-manager --disable rht-updates

Create a repository 2

| Install a FTP server, and request to anonymous download from /var/ftp/pub catalog.
| (it needs you to configure yum direct to the already existing file server.)

# vim /etc/yum.repos.d/local.repo
[local]
name=local.repo
baseurl=file:///mnt
enabled=1
gpgcheck=0
# yum makecache
# yum install -y vsftpd
# service vsftpd restart
# chkconfig vsftpd on
# chkconfig --list vsftpd
# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES

Documentations

Internet
Git
ChatGPT

> Partager <