Mostrando postagens com marcador Ubuntu. Mostrar todas as postagens
Mostrando postagens com marcador Ubuntu. Mostrar todas as postagens

How to Install PHP 8.3 on Ubuntu 26.04, 24.04 and 22.04

 importar chave repo

sudo apt install -y ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg

criar arquivo do repo - copiar texto a seguir, colar e executar no terminal

. /etc/os-release
ARCH="$(dpkg --print-architecture)"

case "$VERSION_CODENAME:$ARCH" in
  resolute:amd64|resolute:arm64|noble:amd64|noble:arm64|noble:armhf|jammy:amd64|jammy:arm64|jammy:armhf)
    printf '%s\n' \
      'Types: deb' \
      'URIs: https://packages.sury.org/php/' \
      "Suites: $VERSION_CODENAME" \
      'Components: main' \
      "Architectures: $ARCH" \
      'Signed-By: /usr/share/keyrings/deb.sury.org-php.gpg' | sudo tee /etc/apt/sources.list.d/php.sources > /dev/null
    ;;
  *)
    printf 'This PHP 8.3 workflow covers Ubuntu 26.04 on amd64/arm64 and Ubuntu 24.04/22.04 on amd64/arm64/armhf; this host reports %s/%s.\n' "$VERSION_CODENAME" "$ARCH" >&2
    false
    ;;
esac



apt update

apt upgrade -y


source: https://linuxcapable.com/how-to-install-php-8-3-on-ubuntu-linux/

Ubuntu Unsupported upgrades

 Unsupported upgrades

Sometimes do-release-upgrade isn't able to run the upgrade to the latest version and it shows an error similar to this:

An upgrade from 'eoan' to 'focal' is not supported with this tool.

If that happens, you need to download a version-specific upgrader, you can find the link at https://changelogs.ubuntu.com/meta-release.

You need to download the upgrade tool for the version you are upgrading to. For example, if you are upgrading to Ubuntu 20.04 (focal), you'll see the link on that page as follows:

UpgradeTool: http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz

The download is an archive which contains an executable with the code name of the release. execute it to run the upgrade tool for that release. Note that the archive extracts everything in the current directory so you might want to create a directory for it to extract into:

# Downloads the upgrader, check the link above for the URL of the file for your release
wget http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz
# Extract it into a new directory
mkdir upgrader
tar -xaf focal.tar.gz -C upgrader
cd upgrader
# Run the executable, the name changes based on the release
./focal

This executable works the same as do-release-upgrade. If you still get the error of the upgrade not being supported, you might need to make an intermediate upgrade to an earlier version.

Ubuntu 22.04 mysql password

 

$ mysql -u root -p
mysql > SELECT user,plugin,host FROM mysql.user WHERE user = 'root';
mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'MrsLKYsuck5';
mysql > FLUSH PRIVILEGES;

Gnome remote desktop config

Command line
grdctl - Command line tool for configuring GNOME Remote Desktop

Restart service
systemctl --user restart  gnome-remote-desktop.service
 
Close user session
gnome-session-quit

Install extension
https://extensions.gnome.org/extension/4338/allow-locked-remote-desktop/



Ubuntu 22.10 nvidia error

 

sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules

 

Enable ‘Minimize on Click’ on Ubuntu Quickly

Just open a Terminal window and copy/paste the following command:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

Hit enter for the change to take effect instantly.

If you don’t want to lose the ‘window’ picker (option 5 in the list above) run this command instead, which will introduce minimise on click but show the window picker if more than one window of a given app is open:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-previews'

To undo the change (i.e. revert back to the default settings for the Ubuntu Dock) copy/paste this command:

gsettings reset org.gnome.shell.extensions.dash-to-dock click-action

Instalar certificados raíz

Dado um arquivo de certificado da CA 'foo.crt', siga estas etapas para instalá-lo no Ubuntu:

Primeiro, copie sua autoridade de certificação para dir /usr/local/share/ca-certificates/

sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt

atualize o armazenamento da CA

sudo update-ca-certificates

Isso é tudo. Você deve obter esta saída:

Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....
Adding debian:foo.pem
done.
done.
fonte: https://qastack.com.br/ubuntu/73287/how-do-i-install-a-root-certificate 
 
 

Ubuntu 20.04 multipath syslog errors

Edit  /etc/multipath.conf 

and blacklist sda. Files contents which also blacklists common other devices like CDRom drives etc. that should never be checked for multipath configurations:

Code:

defaults {
    user_friendly_names yes
}
blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*"
}



Bash remote script execution


bash <(curl -s https://github.com/dominicpratt/install-zabbix-agent/blob/master/install-zabbix-agent.sh)

Ubuntu slow USB copy

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes


Then

swapoff -a

Create New Sudo User in Ubuntu


Create a new user

sudo useradd -m -s /bin/bash -c "Administrative User" admin

Create a password for the admin user using the passwd utility

sudo passwd admin

To enable the user admin to invoke sudo to perform administrative tasks, you need to add the user to the sudo system group using the usermod command as follows, where the -a option means to append user to a supplementary group and -G specifies the group.
 
sudo usermod -aG sudo admin

Now test sudo access on a new user account by switching to admin’s account (enter admin’s account password when prompted).
 
su - admin

 

Make user change password in first login: 

sudo passwd -e username

 


View linux boot time


View boot time:

systemd-analyze

View boot time by service

systemd-analyze blame


To disable a service:
sudo systemctl disable NetworkManager-wait-online.service 

To enable:
sudo systemctl enable NetworkManager-wait-online.service 

 

Disable apport at boot



pico /etc/default/apport

Change the line that says enabled=1 to enabled=0 to disable Apport.
To re-enable, change it back.

Disable IPv6 on Ubuntu


Disable in current session:

$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
$ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1


The above IPv6 disable settings would not persist after the reboot. The usual way on how to load the above settings is to edit the /etc/sysctl.conf configuration file by adding the following lines:

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1


WARNING: Please note, that at the time of writing this method to disable IPv6 after reboot using /etc/sysctl.conf configuration file on Ubuntu 18.04 does Not work. However, this seems to be a bug so feel free to try.
The recommend method to disable IPv6 on Ubuntu 18.04 after reboot is to configure the GRUB boot loader to pass kernel parameter during the boot time.

To do so open the /etc/default/grub using your favorite text editor with root privileges and change/add:

FROM:
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

TO:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"



update-grub

Reboot the system to disable IPv6 support.

 

 

 

Ubuntu 19.04 slow


Appears to be a bug with gnome desktop icons.

Rename folder /usr/share/gnome-shell/extensions/desktop-icons@csoriano and restart.


Clean up boot partition - Ubuntu


1. Check the current kernel version

$ uname -r

It will shows the list like below:

3.19.0-64-generic


2. Remove the OLD kernels

2.a. List the old kernel

$ sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`

You will get the list of images something like below:
linux-image-3.19.0-59-generic
linux-image-3.19.0-61-generic
linux-image-3.19.0-65-generic
linux-image-extra-3.19.0-58-generic
linux-image-extra-3.19.0-59-generic
linux-image-extra-3.19.0-61-generic

2.b. Now its time to remove old kernel one by one as

$ sudo apt-get purge linux-image-3.19.0-58-generic
$ sudo apt-get purge linux-image-3.19.0-59-generic
$ sudo apt-get purge linux-image-3.19.0-61-generic
$ sudo apt-get purge linux-image-3.19.0-65-generic


When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:

$ sudo apt-get autoremove




Adminer on Ubuntu 18.04

Download the latest Adminer into our server

sudo mkdir /usr/share/adminer
sudo mkdir /usr/share/adminer/adminer
sudo mkdir /usr/share/adminer/editor

sudo wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/adminer/latest.php

sudo ln -s /usr/share/adminer/adminer/latest.php /usr/share/adminer/adminer/index.php


echo "Alias /adminer /usr/share/adminer/adminer" > /etc/apache2/conf-available/adminer.conf

sudo a2enconf adminer.conf


reload the Apache config

sudo systemctl reload apache2

Access the adminer interface at
http://<Server_IP_or_Domain>/adminer/

Install adminer-editor:

Download from
https://www.adminer.org/en/editor/#download

Copy file to /usr/share/adminer/editor and rename to index.php

echo "Alias /adminer-editor /usr/share/adminer/editor" >> /etc/apache2/conf-available/adminer.conf

reload the Apache config

sudo systemctl reload apache2


Access the adminer interface at
http://<Server_IP_or_Domain>/adminer-editor


How to Install PHP 8.3 on Ubuntu 26.04, 24.04 and 22.04

 importar chave repo sudo apt install -y ca-certificates curl sudo curl -fsSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sur...

Mais vistos