All about Linux kernel and operating systems that are based on it.

 tags  RSS

20.9.2022 15:42:11

Ubuntu 22.04 has an annoying apt bug. It does not properly upgrade all packages

Running apt in dist-upgrade mode generates weird results as some packages are not upgraded. The only solution is to manually add each not upgraded package to command line which is super annoying and wastes precious time :\ The following behavior is what reproduces faulty results:

juozas@xubuntu:~$ export LC_ALL=C
juozas@xubuntu:~$ sudo apt-get --no-install-recommends dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.15.0-46 linux-headers-5.15.0-46-generic linux-image-5.15.0-46-generic linux-modules-5.15.0-46-generic linux-modules-extra-5.15.0-46-generic
  linux-tools-5.15.0-46 linux-tools-5.15.0-46-generic
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
  fonts-opensymbol libreoffice libreoffice-base libreoffice-base-core libreoffice-base-drivers libreoffice-calc libreoffice-common libreoffice-core
  libreoffice-draw libreoffice-gtk libreoffice-gtk2 libreoffice-gtk3 libreoffice-help-common libreoffice-help-en-gb libreoffice-help-en-us libreoffice-impress
  libreoffice-l10n-en-gb libreoffice-l10n-en-za libreoffice-l10n-lt libreoffice-math libreoffice-report-builder-bin libreoffice-style-colibre libreoffice-writer
  libuno-cppu3 libuno-cppuhelpergcc3-3 libuno-purpenvhelpergcc3-3 libuno-sal3 libuno-salhelpergcc3-3 python3-uno uno-libs-private ure
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.

Edit: It appers this is a new apt feature called phased updates. It can be easily disabled by adding

APT::Get::Always-Include-Phased-Updates "true";

to apt configuration (usually in /etc/apt/apt.conf.d/).

reposted by juozaspo raumfahrtagentur
16.5.2022 19:04:17

A quick fight game made in bash

while [[ $health > 0 && $enemy > 0 ]]
echo You: $health
echo Enemy: $enemy
while [[ $input != 0 && $input != 1 ]]
echo "Pick a number (0-1)"
read input
if [[ $input != 0 && $input != 1 ]]; then
echo "Wrong input"
hit=$(( $RANDOM % 2 ))
if [[ $input == $hit ]]; then
if [[ $health == 0 ]]; then
echo "You Died"
echo "You defeated the beast"

Save this as a file named onto any linux system, chmod +x it, run it and have fun

16.4.2022 21:51:21 reposted from juozaspo

Find manually installed packages that has other packages depending on it on Debian based systems

Running command below generates a list of packages that can be marked as automatically installed, as long as apt-rdepends package were already installed. It generates a script that can be used to mark all found packages as manually installed.

echo \#\!/bin/bash >; apt-mark showmanual|xargs -I{} sh -c '[ "{}" = "$(apt-rdepends -r --state-follow=Installed --state-show=Installed {} 2>/dev/null)" ] || echo apt-mark auto {}' >>

It can be modified to mark packages automatically if preferred instead of writing to a script

apt-mark showmanual|xargs -I{} sh -c '[ "{}" = "$(apt-rdepends -r --state-follow=Installed --state-show=Installed {} 2>/dev/null)" ] || apt-mark auto {}'

Before running apt-get autoremove run it with pretend mode (-s), e.g

apt-get -s autoremove --purge

Mark any package not desired to be removed with

apt-mark manual <package>
13.4.2022 20:32:11

Installed Ubuntu 22.04 LTS from scratch, to be released within a week (April 21, 2022)

Ubuntu 22.04 LTS is soon to be released so I decided to do a complete reinstall. After booting into Linux Live USB first I've deleted everything from my old install except for the important stuff I needed to keep. Then I've reinstalled the base system using debootstrap and used a script I made to enter the chroot, I installed required packages there to make it boot and to be able to access network. Finally I've installed everything else I needed including graphical interface where a list of installed previously packages would help alot. Such list could be generated by running commands as shown in example below.

First generate package list files while in old system as shown below

$ apt-mark showmanual > manual_old.txt
$ dpkg-query -Wf '${Package}\n' > packages_old.txt

After reinstalling system repeat same in the new installation, only change output file names where needed.

$ apt-mark showmanual > manual.txt
$ dpkg-query -Wf '${Package}\n' > packages.txt

Finally compare package list files generated above, a list of missing packages would be stored in files as shown below

$ sort manual_old.txt > 1.txt; sort manual.txt > 2.txt; comm -23 1.txt 2.txt > missing_manual.txt
$ sort packages_old.txt > 1.txt; sort packages.txt > 2.txt; comm -23 1.txt 2.txt > missing.txt

reposted by juozaspo
12.3.2022 16:38:16 reposted from juozaspo

Spam generator

$ for q in $(eval echo {1..$((2+$RANDOM%200))}); do echo $(cat </dev/urandom|tr -cd '[:lower:]'|tr -s '[:print:]'|head -c $((2+$RANDOM%32))); done|xargs

Generates a random amount of random words containing random lowercase letters (up to 200 words and 32 letters per word)

19.2.2022 21:50:31

Double dollar sign ($$) in bash

It substitutes to PID of the current running shell. For example running

ps -Alf|grep $$

generates interesting results, as shown below

$ ps -Alf|grep $$
0 S juozas     11125   11120  0  80   0 -  3391 do_wai 22:43 pts/0    00:00:00 bash
4 R juozas     11197   11125  0  80   0 -  3506 -      22:46 pts/0    00:00:00 ps -Alf
0 S juozas     11198   11125  0  80   0 -  2859 pipe_w 22:46 pts/0    00:00:00 grep --color=auto 11125

Another example is to use it in the file names where it gets substituted with the PID of the current running shell.

$ cat >f$$.txt <<EOF
This is a test. The pid of running shell is $$
$ cat f$$.txt
This is a test. The pid of running shell is 11125
$ ls f$$.txt
$ LC_ALL=C rm -v f$$.txt
removed 'f11125.txt'

reposted by juozaspo
23.12.2021 18:36:36

ffmpeg /dev/urandom test video 4 (mkv, low resolution)


19.12.2021 09:14:13

Generate 1280x720 image with 16x9 grid containing random colors in each cell

$ dd if=/dev/urandom bs=1 count=432 of=in.bin

$ convert -depth 8 -size 16x9 rgb:in.bin -scale 1280x out.png

reposted by juozaspo
11.12.2021 11:28:42 reposted from juozaspo

Open random page of kyselo right from unix terminal

Run command below in your unix terminal

$ BEGIN=$(($(date -d '2020-07-13T00:35:49' +"%s"))) END=$(date +"%s"); firefox$(date -d @$(shuf -i $BEGIN-$END -n 1) +"%Y-%m-%dT%H%%3A%M%%3A%S")

2020-07-13T00:35:49 is the date of first post, replace 'firefox' with your browser command if you have different browser installed.

5.12.2021 09:04:52

reposted by juozaspo memes naich schaaf
25.10.2021 11:43:17 reposted from juozaspo

28.6.2021 22:06:33 reposted from juozaspo

10.6.2021 23:43:15 reposted from juozaspo

Non native theme of the widgets on Mozilla Firefox looks ugly while using Linux. It can be disabled on about:config page.

7.6.2021 10:25:48 reposted from juozaspo

Me trying to compile some programs on Gentoo


29.3.2021 20:11:49 reposted from juozaspo

20.9.2020 09:43:56 reposted from gpkvt

19.9.2020 09:33:13 reposted from gpkvt

23.8.2020 04:36:48 reposted from gpkvt

20.8.2020 17:47:44 reposted from gpkvt

17.8.2020 20:37:46 reposted from juozaspo

17.8.2020 20:37:36 reposted from juozaspo

Gentoo installation in virtualbox is never w/o bugs...
Triggered by running

# emerge --ask --verbose --update --deep --newuse @world
inside chroot on livecd


Timeline speed: 0.98 posts per month


You have reached the end...