Ubuntu¶
Change Hostname 20.04¶
sudo hostnamectl set-hostname <hostname>
Perform a Distrubution Upgrade¶
sudo do-release-upgrade -d
Screen on WSL¶
mkdir ~/.screen && chmod 700 ~/.screen
~/.bashrc
export SCREENDIR=$HOME/.screen
Remove Snap¶
(
sudo umount /var/snap
sudo apt purge snapd
sudo rm -rf ~/snap /snap /var/snap /var/lib/snapd
)
An upgrade from 'hirsute' to 'jammy' is not supported with this tool¶
Reading cache
Checking package manager
Can not upgrade
An upgrade from 'hirsute' to 'jammy' is not supported with this tool.
script.sh
#!/bin/bash
echo "Updating"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
echo "Bypass check"
sudo sed -i 's/continue/pass/g' /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py
echo "Upgrade distro"
sudo do-release-upgrade
chmod +x script.sh && ./script.sh
Ubuntu – apt-get update fails “The repository no longer has a Release file”¶
sudo apt update
Err:6 http://archive.ubuntu.com/ubuntu eoan Release
404 Not Found [IP: 91.189.88.142 80]
# backup your sources file
cp /etc/apt/sources.list /etc/apt/sources.list.bak
# replace the links with the archive address
sudo sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
# run update again
sudo apt update && sudo apt dist-upgrade
Auto Retart Daemons during Update¶
sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
User Groups¶
usermod -a -G adm,cdrom,lpadmin,sudo,sambashare,dip,plugdev nicholas
Autocomplete Directories¶
export CDPATH=foo
Apt Cacher NG¶
Server¶
# /etc/apt-cacher-ng/acng.conf
PassThroughPattern: .*
CacheDir: /mnt/storage/apt-cacher-ng
systemctl restart apt-cacher-ng
Client¶
echo "Acquire::http::Proxy \"http://aptcache.nicholaswilde.io:3142\";"| sudo tee /etc/apt/apt.conf.d/00aptproxy