diff options
authorneodarz <neodarz@neodarz.net>2019-11-19 22:08:12 +0100
committerneodarz <neodarz@neodarz.net>2019-11-19 22:08:43 +0100
commite7e51a2602941d679fd2c2d8813bf1497d83ccf3 (patch)
parent3ac35a4a654b2593a5aaeea873ab48b90f0409f5 (diff)
Add some cheat
2 files changed, 59 insertions, 0 deletions
diff --git a/dotfiles/cheat/pacman b/dotfiles/cheat/pacman
new file mode 100644
index 0000000..737bb64
--- /dev/null
+++ b/dotfiles/cheat/pacman
@@ -0,0 +1,54 @@
+# All the following command work as well with multiple package names
+# To search for a package
+pacman -Ss <package name>
+# To update the local package base and upgrade all out of date packages
+pacman -Suy
+# To install a package
+pacman -S <package name>
+# To uninstall a package
+pacman -R <package name>
+# To uninstall a package and his depedencies, removing all new orphans
+pacman -Rcs <package name>
+# To get informations about a package
+pacman -Si <package name>
+# To install a package from builded package file (.tar.xz)
+pacman -U <file name/file url>
+# To list the commands provided by an installed package
+pacman -Ql <package name> | sed -n -e 's/.*\/bin\///p' | tail -n +2
+# To list explicitly installed packages
+pacman -Qe
+# To list the top-most recent explicitly installed packages (not in the base groups)
+expac --timefmt='%Y-%m-%d %T' '%l\t%n' $(comm -23 <(pacman -Qeq|sort) <(pacman -Qqg base base-devel|sort)) | sort -r | head -20
+# To list orphan packages (installed as dependencies and not required anymore)
+pacman -Qdt
+# overwrite package
+pacman --overwrite
+# You can't directly install packages from the Arch User Database (AUR) with pacman.
+# You need yaourt to perform that. But considering yaourt itself is in the AUR, here is how to build a package from its tarball.
+# Installing a package from AUR is a relatively simple process:
+# - Retrieve the archive corresponding to your package from AUR website
+# - Extract the archive (preferably in a folder for this purpose)
+# - Run makepkg in the extracted directory. (makepkg-s allows you to install any dependencies automatically from deposits.)
+# - Install the package created using pacman
+# Assuming $pkgname contains the package name.
+wget "https://aur.archlinux.org/packages/${pkgname::2}/$pkgname/$pkgname.tar.gz"
+tar zxvf "$pkgname.tar.gz"
+cd "$pkgname"
+# Build the package
+makepkg -s
+# Install
+sudo pacman -U <package file (.pkg.tar.xz)>
diff --git a/dotfiles/cheat/update b/dotfiles/cheat/update
new file mode 100644
index 0000000..0756fcf
--- /dev/null
+++ b/dotfiles/cheat/update
@@ -0,0 +1,5 @@
+# Debian
+## test if server need reboot after upgrade
+test presence of /var/run/reboot-required