You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
dotfiles/cheats/linux.txt

69 lines
1.6 KiB

sudo !! - Will rerun the last command but done as ROOT
===============================
How to make a .deb package:
mkdir packageName
mkdir packageName/DEBIAN
mkdir -p packageName/usr/bin
$ nano packageName/DEBIAN/control
Package: {THE Name}
Version: 1.0
Section: custom
Priority: optional
Architecture: all
Essential: no
Installed-Size: 1024 [note: this is the size on Disk after Install]
Maintainer: {MyName}
Description: {Does...this...}
-----------------EOF
Add the executables to the packageName/usr/bin folder.
Then run: $ dpkg-deb --build packageName
mv packageName.deb packageName-1.0_amd64.deb
--Copy file to another PC, then install it,
on that PC: $ dpkg -i packageName-1.0_amd64.deb
===========================================================
The RedHat way, see DJ Ware's video:
https://youtu.be/iBVZ2-NIQ6I?t=1620
sudo dnf install -y rpmdevtools rpmlint
rpmdev-setuptree
tar --create --file packageName-1.0.0.tar.gz packageNameExecutableFile
mv packageName-1.0.0.tar.gz rpmbuild/SOURCES
rpmdev-newspec MySpecFile
nano MySpecFile.spec
Name: {THE Name - CHANGEME}
Version: 1.0.0
...
Summary: {Does...this... - CHANGEME}
BuildArch: x86_64
...
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp %{name} $RPM_BUILD_ROOT/%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{_bindir}/%{name}
----------------EOF
$ tree rpmbuild # To see folder structure
cd rpmbuild
mv MySpecFile.spec rpmbuild/SPECS
rpmlint ~/rpmbuild/SPECS/MySpecFile.spec
rpmbuild -ba ~/rpmbuild/SPECS/MySpecFile.spec
copy this file: ~/rpmbuild/RPMS/x86_64/packageName-1.0.0...x86_64.rpm
then run: dnf install on that file...