Useful command line for Linux (update)

Short description   | Debian/Ubuntu            | Fedora
--------------------| ------------------------ | -----------------------
Package format      | .deb                     | .rpm
CLI tool download   | apt-get                  | (previously) yum, now dnf
Custom config files | /etc/apt/sources.list.d/ | /etc/yum.repos.d/

 

Update apps

sudo apt-get update && sudo apt-get upgrade

Install apps

sudo add-apt-repository [repository name here]
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get install [package name]

Removing Packages

sudo apt-get -r [package name] 
sudo apt-get dpkg --purge [package name]
sudo apt-get autoremove

Upgrading apps

sudo apt-get update
sudo apt-get update && sudo apt-get dist-upgrade
do-release-upgrade -d
sudo apt-get dist-upgrade

Fix problems

sudo dpkg --configure -a

sudo apt-get install -f

sudo apt-get clean

sudo apt-get update

If it fails then try to type:

 sudo dpkg --configure -a --force-all

Firewall

sudo apt-get install ufw

sudo ufw enable

yum install firewall-config

Update apps

sudo dnf update
sudo dnf upgrade

Install apps

sudo dnf install [package_name]

Removing Packages

sudo dnf remove [package_name]

sudo dnf autoremove

Upgrading apps

Update your system

sudo dnf upgrade --refresh

Read more at Fedora’s official website:
https://fedoraproject.org/wiki/DNF_system_upgrade

Fix problems

If it fails then try to type:

fsck -y

Troubleshooting SELinux – Fedora Magazine

Troubleshooting SELinux

Suspend and hibernate options

Suspend (Sleep) is sudo pm-suspend 

Hibernate is sudo pm-hibernate

Both is pm-suspend-hybrid

Suspend and hibernate options

Suspend: systemctl hybrid-sleep -i

Hibernate: systemctl hibernate -i

Firewall

dnf install ufw

sudo ufw enable

yum install firewall-config

Kernel

View on display show off the current version of Linux kernel you are running:

uname -sr

If you need to know about which others kernel you have then type here:

rpm -q kernel

If you need to remove unused kernel then type first  and will take action it here:

dnf  install yum-utils

You can delete old kernel who you don’t need then type here:

package-cleanup --oldkernels --count=2

Warning: It can get problem if you are not expert in Linux.

If you will get function at Linux to do it automatic remove in future then you can type here:

dnf remove $(dnf repoquery --installonly --latest-limit 2 -q)

Or another alternative way:

installonly_limit=2 #set kernel count

How to reset a root password on Fedora – Fedora Magazine

How to reset a root password on Fedora

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.