Error when package code needs to be installed, but I canβt find an archive for it
Link for resolve: Reddit
If you package problem, for example (Code
). You need to perform these command
libssl
error in Ubuntu 22.04
Info
Ubuntu 22.04 has upgraded libssl to 3 and does not propose libssl1.1, so when you install packages that meet the problems, with me when setup
Azure agent
, read at The SSL connection could not be established, and No usable version of libssl was found. But when you need to revert some other version problem will mess up, you can follow this one and reboot your machine to applied compatible version oflibssl
Link issue: StackOverFlow - MongoDB Install Fails on Ubuntu 22.04 - Depends on libssl1.1 but it is not installable
Package: libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- Install via source-list when you import the key
- Manually installed
Problem with ssh
When you see the situation about your key for authentication a destination host have changing because your action or hacker, from your side you can resolve when exection ssh
by flushing the old key like
Success
It will help you update your known_hosts, and give you permission to authentication remote host with new cred
If you meet situation about, cannot auth ssh via password
. It means, usually your host will protect your VM
with no enable PasswordAuthentication
in /etc/ssh/sshd_conf
. If you want to enable, you need to perform
Could not load βvboxdrvβ after upgrade to Ubuntu 16.04 (and I want to keep secure boot)
Info
That issue come from when you install the
virtualbox
in OS with enable secure boot in theBIOS
, usually come from individual machine, I thinks. Mostly you installvirtualbox
fromapt
, it will not applied when your machine meet that problem. Can explain more π
You can find the solution for secure boot at
- I canβt execute command modprobe vboxdrv
- Could not load βvboxdrvβ after upgrade to Ubuntu 16.04 (and I want to keep secure boot)
Quote
That is tough think for new start, I know but you have 2 way to resolve the problem, i dunno make sure you follow what but, this is the same between them but one side is manually generate and other use
deb
with include that step. Follow if you solve the problem
First method
Note
Manually generate, and submit
mok
for authentication secure boot, that new for me and cost me time to understand π but that gradually valuable
When reboot you will see the screen, choose Enroll MOK
to continue. Answer the step in blue screen Enroll MOK > Continue > Yes > and it will ask you for the password > reboot
. That will boot you to ubuntu
. After that to validate it work or not, you can do
If not work at all, you need to delete the MOK key
and will do the another optional
Your work will have different, you can follow Enroll MOK > Delete > Yes > and it will ask you for the password > reboot
. That all you remove the old key, if you delete or forgot where you put the key, follow this step
Second method
Note
That will simple, but make sure you do same thing above but the
virtualbox
will give you all step and just need prompt your password, remember for re-typing again in MOK
This method will require you install virtualbox
from official documentation, you can use wget
, curl
or you can directly click and install that, here the link
After that, you need install that with --fix-broken
to help you install dependencies packages with your deb
Success
That will help you resolve this case, maybe when you have new version of Ubuntu that can be reason why you had the problems, make sure you control that
Swap mode in Ubuntu
Info
You can swap mode in Ubuntu from desktop mode to server mode, by use key combining
- Ctrl + Alt + F1 : To use desktop mode
- Ctrl + Alt + F3: To use shell or server mode
Clean Swap memory
With architecture of linux, swap memory submit crucial role for operating stuff inside machine, bring back stability and performance. Explore about swap memory at Phoenix - Swap Space in Linux: What It Is & How It Works
Warning
The customization into swap memory need to concern before do because you will touch into part with one making decision for performance main system
But you can gently clean that with few commands to help you collect, and get swap memory back to machine. E.g: When you compile java, if you not configure jvm
with good behavior, It will use a lot memory and swap is one of those.
To prevent that, you can use command below to disable all swap partition, it will help reclaim memory swap being use
After reclaim, you can turn on it again for reusing to continuous provide swap memory for system
You can explore and figure out more configuration and memory with linux through article
- Tecmint - How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
- Kernal Doc - Memory Management
Use environment variables from .env
file
Info
Read more about topic in
Stackoverflow
: Set environment variables from file of key/value pairs
Use export with except #
line in .env
file
When you want to work with script, you can use -o allexport
Update Ubuntu new version
You can use integration tool inside ubuntu
to update new version, that will pull and update packages inside host, do that easily with command
Warning
In this situation you update
ubuntu
, it will update your kernel so please remember make a big-changes can gain different harden to control, so do know before you doing
Follow some methodology to upgrade new version of kernel, such as
- How to Update Linux Kernel In Ubuntu
- CαΊp nhαΊt Linux Kernel trΓͺn Ubuntu 20.04 (Vietnamese)
- How to Update/Upgrade Linux Kernel in Ubuntu
- Ubuntu Linux Upgrade Linux Kernel Command
Depend on those articles, you can update kernel
of Ubuntu via
- Update OS version (e.g. 20.04 β 22.04)
- Update package of OS dependencies
- Manually Update
When you choose manually update, you can use some following tools
- Mainline
- ubuntu-mainline-kernel.sh
- Directly download use
curl
orwget
and installing from pkgs.org
If you see this one from via kubewekend
series, I prefer to use update Ubuntu version or use secondly optional via apt
like
Update alternative version
Quote
When you have multiple version of tools, package or moreover, like
python
java jdk
shell
, you need to switch between of them that why you need the topic
For change and update the configuration between different of tools, debian
core offer us the command call update-alternatives
. Let digest to its
You can find the manual of the command with --help
flag
When you want to take a look how the version we have, such as java
you can call with --list
flag and name, example
And when you have decision, on my situation java
on my machine on 11
but I want to switch to 18
, you can perform this command
Relate documentation
- Switch between multiple java versions
- What exactly does
update-alternatives
do? - The update-alternatives Command in Linux
Rerun the previous command
You can use previous command with !!
on your shell, for example
Also you can reuse the previous command arguments, for example
Comment note in Shell Bash
Info
2 ways for writing the comment to shell bash.
Example and troubleshooting via Link to details
Using the #
character for comment
Info
In Bash, a comment starts with the hash symbol (#). Anything after # on that line is considered a comment and is ignored by the Bash interpreter
Using the doctype Here Document
for comment multiple line
Info
Bash doesnβt have a specific syntax for multi-line comments like some other languages, but you can use a trick with the : command and a βhere documentβ to achieve the same effect.
Reconfiguration for curl template output
Note
Reference: Timing Page Responses With Curl
Templates format to output via curl
command
To reference the documentation for the time based variables is as follows.
- time_appconnectΒ - The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed.
- time_connectΒ - The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
- time_namelookupΒ - The time, in seconds, it took from the start until the name resolving was completed.
- time_pretransferΒ - The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
- time_redirectΒ - The time, in seconds, it took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections.
- time_starttransferΒ - The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.
- time_totalΒ -Β Β The total time, in seconds, that the full operation lasted.
How to use
Find the PATH which including the curl-formatter.txt
file with cd
or pwd
, Use this with curl
command
Redirect Output and Error
Note
Reference βΆοΈ βΆοΈ βΆοΈ How to Redirect Output and Error to /dev/null in Linux
Some thing about the output of linux
- In the linux machine,
/dev/null
that will location where you can return null for your shell likecommand 2>&1 /dev/null
- There will have 3 three type of output which linux has
- Standard input (stdin) is designated with 0
- Standard output (stdout) is designated with 1
- Standard error (stderr) is designated with 2
Redirect output to /dev/null in Linux
For example: You run apt install curl
but you want your shell not return anything you can redirect output
into /dev/null
. It will be like
Usage: Used it when you donβt want stdout
go to your shell, just removing the odd things and keep the important output
Redirect error to /dev/null in Linux
For example: You run find /
but you run with non root, so somecase you will have some permission error output to your shell. You can use /dev/null
for removing this messing stuff
Combine stdout
and stderror
into one with this character &
Sometime you can use version
2
of combiningTheΒ
2>&1
Β part means βredirect the error stream into the output streamβ, so when you redirect the output stream, error stream gets redirected as well. Even if your program writes toΒstderr
Β now, that output would be discarded as well. (Sergey Kalinichenko)
Find this problem βΆοΈ βΆοΈ What is /dev/null 2>&1?
User Management in Linux
Info
With User and Group configuration in Linux become potential to managing, and enhance your security, user connection and moreover. Following some situation to keep some command that be useful for us when manipulate this stuff inside Linux
Some articles can be good for us when practicing with those stuff around
- Ubuntu Doc - User management
- User Management in Linux
- How to Manage Users in Linux
- Introduction to usermod command
Change Password
If you want to change password of current user, you can use command
Add and Delete user
In this situation, you have multiple command to handle it, such as adduser
, useradd
, deluser
and userdel
. With the graduation introduce by Ubuntu Doc, I will choose adduser
and deluser
to handle this case
Add and Delete user out of group
There is many way to handle this work, but I prefer to use it with usermod
command
Helpful usermod
command
Change your user with new name, but you need do it on another user with kill that shell, because if you access to your old account, I will be attached by process
Change the shell of user, you can switch to user to use chsh
but this can be done remotely
Move the content of userβs home directory using usermod
command