Linux small issues

List of my Linux basic problems.

linux compilation with linux and Operating systems|lower


LINUX

LUBUNTU HOW TO COMPILE AND INSTALL FROM SOURCE CODE

1. Run $ ./configure // nothing happend

2. Run $ make to compile // no makefile found

3. Create build directory and move there $ mkdir build $$ cd build

4. Type from build directory $ cmake .. // compiled with some errores like CMAKE_CXX_COMPILER-NOTFOUND

5. G++ was not installed. I installed it $ sudo apt install g++

Linux apt-get couldn’t find a package

1. If your linux is old You have to change repositories etc/apt/sources.list
2. You have to change this file to new one with new links to repository.

HOW TO BACKUP LUNUX LUBUNTU

1. Use DejaDup $ sudo apt install deja-dup –classic // But it is suit for some folders not for all system backup
2. $ sudo apt install timestart // There is no on lubuntu repository
3. Just copy all folder /var/cache/apt/archives/
4. then install them manualy $ sudo dpkg -i *.deb

CentOS 

CentOS RHEL 8 GUI GRAPHICAL INTERFACE DOESN’T WORK

0. Set repository during installation.

0.1 Set https protocol and address vault.centos.org/8.0.1905/BaseOS/x86_64/os/ 

1. To check if GUI is installed or not type $ ls /usr/bin/*session
2. Try to install with # dnf groupinstall "Server with GUI" -y

3. Cannot install application $ sudo yum install chromium

3.2. While I am trying to install something I get Error: Failed to synchronize cache for repo AppsStream. 

3.4. Or change your repo to archive repo (http://vault.centos.org)

3.4.1. Repoes stored in /etc/yum.repos.d/CentOS-*

3.4.2. Substitute 'http://mirror.centos.org' with 'http://vault.centos.org' then run $ dnf repolist // Works but snap-store still doesn't works.

3.5. It is because CentOS 8 doesn't not supported anymore. Migrate to Centos Stream.

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos

dnf distro-sync // doesn't helped

3.6. Try

sudo dnf --disablerepo="*" --enablerepo="epel" list available | grep chromium

sudo dnf --enablerepo="epel" install chromium

3.7. Try to install from .rpm

3.7.1 $ yum localinstall google-chrome.rpm // doesn't works

3.7.2. sudo rpm -i file.rpm // works

 

 

UBUNTU commands overview

1. To check ubuntu version type:
$ lsb_release -a  It is also saved in etc/issue

2. If you want to move at the root catalog in file manager just type:
CTRL+L you will see at the top highlighted path. Type just / then ENTER. / is the root catalog.

3. All programs are in catalog /bin

4. User’s programs are in /opt catalog

5. To make file writable use:
$ sudo chmod +rwx file.txt

6. tldr command is very usefull, It shows examples of usage:
$ tldr chmod  or chmod 644 file.txt first number 6 is a owner right

7. If you unable to copy file in folder in Ubuntu
Check directory permission $ ls -l folder/
To grant permission $ sudo chmod -R 777 directory/

$ sudo -s enable root mode

Networking Linux command

1. $ route // Shows routing table
2. $ netstat // Shows connections

HOW TO GET IP ADDRESS FROM URL IN UBUNTU LINUX

1. Use dig command
2. Use nslookup

ON START LINUX UBUNTU FREEZES AND DOESN’T REACT ON MOUSE OR KEYBOARD

1. Boot with SHIFT button to advanced menu → recovery mode. Some module is failed.
2. Drop to root shell prompt.
3. Previously I’ve changed repositories. So I turn it back. # nano /etc/apt/sources.lisf
4. Change focal back to bionic. # apt update && apt upgrade // got error Failed to restart udev.service
5. Boot with CD → rescue broken system // doesn’t help
6. Recovery mode → update GRUB  // doesn’t help

7. Reinstall system

 

LUBUNTU KEY COMBO TO SWITCH LANGUAGE

1.

 

MANJARO

1. Install browser chromium

sudo pacman -Syu

sudo pacman -S chromium

2. Install snap-store // $ sudo pacman -S snapd then use gui add-remove software

3. How to clean hard disk to get free space.

3.1` To check disc space $ df

3.2 Remove unwanted .pkg files from /var/cache/pacman/pkg/ or $ pacman -Scc

3.3 How to do pacman autoremove  // pacman -Qdtq

3.4. Limit journal $ sudo journalctl --vacuum-size=50M

4. Manjaro doesn't starts. Restore manjaro fix boot errors.

4.2. Press ESC on start to enter GRUB.

4.2.1. Run test memory.  // No

4.2.2. Type E to edit GRUB parameters. To load in safe mode without display manager add a 3 to the options at the end of the line (and optionally remove ‘quiet’) so it appears like this:

linux /boot/vmlinuz-4.11-x86_64 root=UUID=0a01099a-1e33-489a-a2de-10104e8492f5 rw 3  type F10 // Nothing

4.2.3. Boot from livecd and use manjaro-chroot -a and update everything # pacman -Syu

5. How to add user to sudoers.

$ su

then edit /etc/sudoers

 

KALI

1. KALI doesn't boot up. I got

/dev/mapper/k--vg-root contains a file system with errors, check forced.

Inodes that were part of a corrupted orphan linked list found.

/dev/mapper/k--vg-root: EXPECTED INCONSISTENCY; RUN fsck MANUALLY.

(i.e. without -a or -p options)

fsck exited with status code 4

The root filesystem on /dev/mapper/k--vg-root requires a manual fsck

BusyBox v1.36.1 (Debian 1:1.36.1-3.1+b1) built in shell (ash)

(initrampfs)

1.1. Try to run $ fsck -y /dev/sda1 ; reboot -f  to fix disk errors. If this problem will repeat in future again maybe your HDD going to broke. // I got fsck from util-linux thats all

1.2. My bad. I have not sda1 corrupted but /mapper/k--vg-root try $ fsck -y /dev/mapper/k--vg-root  // HELPED

2. How to clear garbage and old archives. // sudo apt-get autoclean

2.1 How to clear garbage and old archives. // sudo apt-get autoremove

2.2 sudo apt clean

2.3. With Synaptic->Status->Not Installed(re..something) Delete all.

 

FEDORA

1. How to clean system space. // dnf system-upgrade clean

1.1. dnf clean packages  

1.2. dnf autoremove

1.3. Delete old kernel // dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)

 

GENTOO

Installation

1. Start with boot cd.

2. Make disk GPT partition with fdisk

2.1. I have MBR instead of EFI.Try to set EFI checkbox in VM settings. // doesn't helped.

2.2. Create filesystem # mkfs.xfs /dev/sda1 and for sda3 the same.

2.3. Init swap # mkswap /dev/sda2 then # swapon /dev/sda2

2.4. Mount root partition for sda3

mkdir --parents /mnt/gentoo

mount /dev/sda3 /mnt/gentoo

Got Error /dev/sda3 Can't open blockdev

2.4.1. Try to reboot // helped

3. Create enviroment from the Stage file.

4. Set bootloader. I've chose GRUB but maybe it was unnesessary and /boot folder is enough.

5. Configure initramfs.

6. Install the kernel // After 24 hours of compilation I get an Error Failed to emerge sys-kernel/gentoo-kernel-6.6

6.1. I will not even try to solve this Gentoo problem and thats why. First time I made 13GB virtual disk and installation consumed almost all of it (12.7G) eventually I had no space to even install bootloader. Clearing tools didn't helped. Second time I allocated 22GB and when installation failed Gentoo consumed 93% around 19Gb. I have no explanation how it is possible, I believe if I'd set 100Gb Gentoo took 99.9G. Apparently something is fishy with this Gentoo linux. I do not recommend it. I will try to install Arch Linux in next chapter.

7. Better install Calculate Linux distro.

8. How to install Firefox.

8.1. $ emerge firefox // Root is needed.

8.2. $ sudo emerge firefox // Adding users to sudoers is needed.

8.3. $ echo ' username ALL=(ALL)   ALL' >> /etc/sudoers