PJ-Singh-001 / Cubic

The Official Web Site for Cubic (Custom Ubuntu ISO Creator) (https://github.com/PJ-Singh-001/Cubic)
813 stars 47 forks source link

Selecting components to remove are also removed others chosen #80

Closed Augusto7743 closed 2 years ago

Augusto7743 commented 2 years ago

Thanks for using your free time reading my topic. I see an strange issue when trying remove some components.

Test 1

Cubic terminal environment copied an bash file executable with the commands below

sudo bash 1.sh
sudo apt-get purge -y ark* vim vim-common vim-runtime vim-tiny compton* noblenote* trojita* qpdfview* lximage-qt* bluedevil* firefox* xul-ext-ubufox* transmission* quassel* 2048* k3b* *vlc* partitionmanager* usb-creator* "fonts-kacst*" "fonts-khmeros*" fonts-lklug-sinhala fonts-guru-extra "fonts-nanum*" fonts-noto-cjk "fonts-takao*" fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica "fonts-tlwg-*" "fonts-lohit-*" fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi "fonts-samyak*" fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai "fonts-telu*" "fonts-wqy*" "fonts-smc*" fonts-deva-extra fonts-sahadeva
sudo apt-get autoremove -y

after copied kernel updates

sudo dpkg -i *.deb

ISO using xz created correctly.

Started the customized OS is possible install Libreoffice without warning about missing dependencies. All files are being updated.

Test 2

Cubic terminal environment copied two bash files executable with the commands below

sudo bash 1.sh
sudo apt-get purge -y ark* vim vim-common vim-runtime vim-tiny compton* noblenote* trojita* qpdfview* lximage-qt* bluedevil* firefox* xul-ext-ubufox* transmission* quassel* 2048* k3b* *vlc* partitionmanager* usb-creator* "fonts-kacst*" "fonts-khmeros*" fonts-lklug-sinhala fonts-guru-extra "fonts-nanum*" fonts-noto-cjk "fonts-takao*" fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica "fonts-tlwg-*" "fonts-lohit-*" fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi "fonts-samyak*" fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai "fonts-telu*" "fonts-wqy*" "fonts-smc*" fonts-deva-extra fonts-sahadeva
sudo apt-get autoremove -y
sudo bash 2.sh

will be removed Libreoffice

sudo apt-get purge -y fonts-opensymbol* libjuh-java* libjurt-java* libridl-java* libuno-* libunoloader-java* python3-uno* uno-libs-private* ure*

All components below will be removed

fonts-opensymbol*
libjuh-java*
libjurt-java*
libreoffice-base-core*
libreoffice-calc*
libreoffice-common*
libreoffice-core*
libreoffice-draw*
libreoffice-gtk3*
libreoffice-help-common*
libreoffice-help-en-us*
libreoffice-impress*
libreoffice-math*
libreoffice-qt5*
libreoffice-writer*
libridl-java*
libuno-cppu3*
libuno-cppuhelpergcc3-3*
libuno-purpenvhelpergcc3-3*
libuno-sal3*
libuno-salhelpergcc3-3*
libunoloader-java*
python3-uno*
uno-libs-private*
ure*

After running the command below

sudo apt-get autoremove

fonts-liberation2
gstreamer1.0-gtk3
libabw-0.1-1
libboost-date-time1.71.0
libboost-filesystem1.71.0
libboost-iostreams1.71.0
libboost-locale1.71.0
libboost-thread1.71.0
libcdr-0.1-1
libclucene-contribs1v5
libclucene-core1v5
libcmis-0.5-5v5 libcolamd2
libe-book-0.1-1
libeot0 libepubgen-0.1-1
libetonyek-0.1-1
libexttextcat-2.0-0
libexttextcat-data
libfreehand-0.1-1
liblangtag-common
liblangtag1
libmhash2
libmspub-0.1-1
libmwaw-0.3-3
libmythes-1.2-0
libneon27-gnutls
libnet-dbus-perl
libodfgen-0.1-1
liborcus-0.15-0
libpagemaker-0.0-0
libraptor2-0
librasqal3
librdf0
libreoffice-style-colibre
librevenge-0.0-0
libsuitesparseconfig5
libtie-ixhash-perl
libvisio-0.1-1
libwpd-0.10-10
libwpg-0.3-3
libwps-0.4-4
libx11-protocol-perl
libxml-parser-perl
libxml-twig-perl
libxml-xpathengine-perl
libxmlsec1
libxmlsec1-nss
libyajl2
lp-solve
xdg-utils

Thus means all files above "are yet" in ISO. after copied kernel updates

sudo dpkg -i *.deb

ISO using xz created correctly

Customized Ubuntu is installed correctly, but all files above was deleted even not doing any command to delete. When doing the command below in installed OS

sudo apt-get autoremove

shown 0 components to remove

Trying install Libreoffice is showed missing dependencies below

fonts-liberation2
gstreamer1.0-gtk3
libabw-0.1-1
libboost-date-time1.71.0
libboost-filesystem1.71.0
libboost-iostreams1.71.0
libboost-locale1.71.0
libboost-thread1.71.0
libcdr-0.1-1
libclucene-contribs1v5
libclucene-core1v5
libcmis-0.5-5v5 libcolamd2
libe-book-0.1-1
libeot0 libepubgen-0.1-1
libetonyek-0.1-1
libexttextcat-2.0-0
libexttextcat-data
libfreehand-0.1-1
liblangtag-common
liblangtag1
libmhash2
libmspub-0.1-1
libmwaw-0.3-3
libmythes-1.2-0
libneon27-gnutls
libnet-dbus-perl
libodfgen-0.1-1
liborcus-0.15-0
libpagemaker-0.0-0
libraptor2-0
librasqal3
librdf0
libreoffice-style-colibre
librevenge-0.0-0
libsuitesparseconfig5
libtie-ixhash-perl
libvisio-0.1-1
libwpd-0.10-10
libwpg-0.3-3
libwps-0.4-4
libx11-protocol-perl
libxml-parser-perl
libxml-twig-perl
libxml-xpathengine-perl
libxmlsec1
libxmlsec1-nss
libyajl2
lp-solve
xdg-utils

If using the disc created "Test 1" in installed OS is possible run the command

sudo apt-get purge -y fonts-opensymbol* libjuh-java* libjurt-java* libridl-java* libuno-* libunoloader-java* python3-uno* uno-libs-private* ure*

Not will be removed the long list of files above. Only are removed in Cubic terminal environment.

Cubic when creating the ISO does automatically sudo apt-get autoremove ?

Only sharing that issue. You need any another information ?

Have an nice week.

PJ-Singh-001 commented 2 years ago

Which OS and version are you running Cubic on?

Which ISO and version are you trying to customize using Cubic?

Augusto7743 commented 2 years ago

All good with you ? Thanks very much doing Cubic.

Ubuntu 20.04.4

cubic_2022.06-72-release~202206302224~ubuntu20.04.1_all

Used Lubuntu (Ubuntu distro using LXQT)

lubuntu-20.04.3-desktop-amd64
PJ-Singh-001 commented 2 years ago

You're welcome.

I'm going to test with the Lubuntu 20.04.4 ISO, because this is the version downloadable from https://lubuntu.me.

Augusto7743 commented 2 years ago

Good luck testing.

Links for ISO download https://lubuntu.me/downloads https://cdimage.ubuntu.com/lubuntu/releases

Here are the 2 bash used. After with the OS installed sudo add-apt-repository ppa:libreoffice/ppa PPA is from Libreoffice devs being current version. If not using PPA will be installed an old previous version thus not being possible to do the test.

I have installed an customized Lubuntu and using for some days without problems, but not using the 2.bash in Cubic terminal environment. bash.zip

PJ-Singh-001 commented 2 years ago

I think you may have a misconception of how the apt-get command and its options work.

Use apt instead of apt-get. (apt is a newer and simpler version of apt-get).

You should not use sudo in Cubic, because you already have root privileges.

Try this, instead...

apt autoremove --purge libreoffice*

You will see that libreoffice and all dependent packages will be removed...

The following packages will be REMOVED:
  fonts-liberation2* fonts-opensymbol* gstreamer1.0-gtk3* libabw-0.1-1* libboost-date-time1.71.0*
  libboost-filesystem1.71.0* libboost-iostreams1.71.0* libboost-locale1.71.0* libboost-thread1.71.0* libcdr-0.1-1*
  libclucene-contribs1v5* libclucene-core1v5* libcmis-0.5-5v5* libcolamd2* libe-book-0.1-1* libeot0*
  libepubgen-0.1-1* libetonyek-0.1-1* libexttextcat-2.0-0* libexttextcat-data* libfreehand-0.1-1* libjuh-java*
  libjurt-java* liblangtag-common* liblangtag1* libmhash2* libmspub-0.1-1* libmwaw-0.3-3* libmythes-1.2-0*
  libodfgen-0.1-1* liborcus-0.15-0* libpagemaker-0.0-0* libraptor2-0* librasqal3* librdf0* libreoffice-base-core*
  libreoffice-calc* libreoffice-common* libreoffice-core* libreoffice-draw* libreoffice-gtk3*
  libreoffice-help-common* libreoffice-help-en-us* libreoffice-impress* libreoffice-math* libreoffice-qt5*
  libreoffice-style-breeze* libreoffice-style-colibre* libreoffice-style-tango* libreoffice-writer*
  librevenge-0.0-0* libridl-java* libsuitesparseconfig5* libuno-cppu3* libuno-cppuhelpergcc3-3*
  libuno-purpenvhelpergcc3-3* libuno-sal3* libuno-salhelpergcc3-3* libunoloader-java* libvisio-0.1-1*
  libwpd-0.10-10* libwpg-0.3-3* libwps-0.4-4* libxmlsec1* libxmlsec1-nss* libyajl2* lp-solve* python3-uno*
  uno-libs-private* ure*
0 upgraded, 0 newly installed, 70 to remove and 0 not upgraded.
After this operation, 393 MB disk space will be freed.
Do you want to continue? [Y/n]

The removed packages will not be reinstalled unless:

  1. You install a package that depends on these packages.

    Double check your scripts 1.sh and 2.sh to ensure this is not happening.

  2. You manually re-install the uninstalled packages.

    Make sure you do not have any *.deb files in your current directory (where you execute dpkg -i *.deb from) . For example, you may have a file named libreoffice-common_6.4.7-0ubuntu0.20.04.4_all.deb in your current directory. When you execute dpkg -i *.deb you will end up installing this package.

    To avoid this, explicitly install the *.deb files. Instead of dpkg -i *.deb, use the following more explicit commands (for example):

    dpkg -i linux-libc-dev_5.4.5-*.deb
    dpkg -i linux-headers-5.4.5-rt3-pac6320_5.4.5-*.deb
    dpkg -i linux-image-5.4.5-rt3-pac6320_5.4.5-*.deb
    
    # Create missing simlinks in /boot
    cd /boot
    ln -sf vmlinuz-5.4.5-rt3-pac6320 vmlinuz
    ln -sf initrd.img-5.4.5-rt3-pac6320 initrd.img
PJ-Singh-001 commented 2 years ago

Your 1.sh file should look like this. You do not need the quotes ("), and you should not use sudo...

apt --yes autoremove --purge ark* vim vim-common vim-runtime vim-tiny compton* noblenote* trojita* qpdfview* lximage-qt* bluedevil* firefox* xul-ext-ubufox* transmission* quassel* 2048* k3b* *vlc* partitionmanager* usb-creator* fonts-kacst* fonts-khmeros* fonts-lklug-sinhala fonts-guru-extra fonts-nanum* fonts-noto-cjk fonts-takao* fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica fonts-tlwg-* fonts-lohit-* fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi fonts-samyak* fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai fonts-telu* fonts-wqy* fonts-smc* fonts-deva-extra fonts-sahadeva

Your 2.sh file should look like this. You should not use sudo.

apt --yes autoremove --purge fonts-opensymbol* libjuh-java* libjurt-java* libridl-java* libuno-* libunoloader-java* python3-uno* uno-libs-private* ure*

Again, do not use dpkg -i *.deb to install your kernel files. Be more explicit, as mentioned above.

PJ-Singh-001 commented 2 years ago
Augusto7743 commented 2 years ago

I need say again. When running sudo apt-get purge -y fonts-opensymbol libjuh-java libjurt-java libridl-java libuno- libunoloader-java python3-uno uno-libs-private ure*

I only wait remove the components in the command and not the files below fonts-liberation2 gstreamer1.0-gtk3 libabw-0.1-1 libboost-date-time1.71.0 libboost-filesystem1.71.0 libboost-iostreams1.71.0 libboost-locale1.71.0 libboost-thread1.71.0 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2 libe-book-0.1-1 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libexttextcat-2.0-0 libexttextcat-data libfreehand-0.1-1 liblangtag-common liblangtag1 libmhash2 libmspub-0.1-1 libmwaw-0.3-3 libmythes-1.2-0 libneon27-gnutls libnet-dbus-perl libodfgen-0.1-1 liborcus-0.15-0 libpagemaker-0.0-0 libraptor2-0 librasqal3 librdf0 libreoffice-style-colibre librevenge-0.0-0 libsuitesparseconfig5 libtie-ixhash-perl libvisio-0.1-1 libwpd-0.10-10 libwpg-0.3-3 libwps-0.4-4 libx11-protocol-perl libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl libxmlsec1 libxmlsec1-nss libyajl2 lp-solve xdg-utils

If the command is done in installed OS will run correctly only removing the files in the command, but if running in Cubic remove the files and the files above being as also was used apt-get autoremove (remove any dependencies not being used)

You had replied Try this, instead... "apt autoremove --purge libreoffice*" I not wish remove libreoffice and others dependencies. Only the files in command line thus not need autoremove.

About Kernel update deb files I had used sudo dpkg -i *.deb , but I see now not need sudo and add the deb filename.

"I confirmed that all the packages that were removed during customization did not appear in the installed OS." Not is exactly the why of my topic. If run sudo apt-get purge -y fonts-opensymbol libjuh-java libjurt-java libridl-java libuno- libunoloader-java python3-uno uno-libs-private ure* In OS will be removed only the files in command line and libreoffice being the correct and if using the same command in Cubic is done the same result plus removing the long file list above that I not want. In others words ... command not has the same result when running in Cubic.

PJ-Singh-001 commented 2 years ago

You can not achieve what you want. Let's take a simple example from the long list of packages you would like to remove.

You want to remove ure, and you want to keep libreoffice-common.

However, libreoffice-common depends on ure.

Therefore, removing ure will force libreoffice-common to be removed.

This is just how package dependencies work. You can not remove a package dependency, and expect the package that depends on it to stay installed.

Given the list of packages you want to remove, let's check which packages absolutely need them...

apt rdepends fonts-opensymbol* libjuh-java* libjurt-java* libridl-java* libuno-* libunoloader-java* python3-uno* uno-libs-private* ure*

(Execute this command, and you will see all the packages that depend on the packages you want to remove).

Continuing with the example, here is an excerpt of the output:

.
.
.
ure
Reverse Depends:
  Depends: ure-java (= 1:7.3.4-0ubuntu0.22.04.1)
  Depends: libreoffice-core-nogui (>= 1:7.3.0~)
  Replaces: ure-java (<< 1:7.1.0~)
  Breaks: ure-java (<< 1:7.1.0~)
  Breaks: libunoloader-java (<< 6.4.0~rc1-6)
  Replaces: libunoloader-java (<< 6.4.0~rc1-6)
  Breaks: libunoloader-java (<< 6.4.0~rc1-6)
  Replaces: libuno-salhelpergcc3-3 (<< 5.0.0~rc2-1)
  Replaces: libuno-sal3 (<< 5.0.0~rc2-1)
  Replaces: libuno-purpenvhelpergcc3-3 (<< 5.0.0~rc2-1)
  Replaces: libuno-cppuhelpergcc3-3 (<< 5.0.0~rc2-1)
  Replaces: libuno-cppu3 (<< 5.0.0~rc2-1)
  Depends: libreoffice-core (>= 1:7.3.0~)
  Depends: libreoffice-common
.
.
.

As you can see, libreoffice-common (listed at the bottom) needs ure (listed at the top).

Augusto7743 commented 2 years ago

"You want to remove ure, and you want to keep libreoffice-common.However, libreoffice-common depends on ure." I not want remove ure keeping libreoffice.

In Cubic terminal apt purge ark vim vim-common vim-runtime vim-tiny compton noblenote trojita qpdfview lximage-qt bluedevil firefox xul-ext-ubufox transmission quassel 2048 k3b vlc partitionmanager usb-creator fonts-kacst fonts-khmeros fonts-lklug-sinhala fonts-guru-extra fonts-nanum fonts-noto-cjk fonts-takao fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica fonts-tlwg- fonts-lohit- fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi fonts-samyak fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai fonts-telu fonts-wqy fonts-smc* fonts-deva-extra fonts-sahadeva

Show the list of file to be removed.

1

After run the command apt autoremove

2

All right. I want remove all files above. After run the command apt purge fonts-opensymbol libjuh-java libjurt-java libridl-java libuno- libunoloader-java python3-uno uno-libs-private ure*

3

All files in commands plus Libreoffice will be removed as I want. After running the command ONLY for see which files can be removed apt autoremove

4

I not want run the command "apt autoremove" for not remove all files listed in image above. The screenshot above show as if those files are still in OS ISO it is what I wait. If "apt autoremove" no was done the files are still in the OS ISO ... not exactly That's the explanation of my topic with details. Installed the customized ISO and run the command apt autoremove

5

The screenshot not show the list of files of 4.png (the last screenshot of Cubic terminal). All files in 4.png (the last screenshot of Cubic terminal) are removed, but not was done "apt autoremve". Something happen when creating the ISO that remove all files automatically even not doing "apt autoremove".

If not doing the command below in Cubic terminal apt purge fonts-opensymbol libjuh-java libjurt-java libridl-java libuno- libunoloader-java python3-uno uno-libs-private ure* and only doing the command above in installed OS only remove the files in the command plus Libreoffice thus not removing others files.

PJ-Singh-001 commented 2 years ago

@Augusto7743,

I appreciate you desire to make me aware of what you believe is an issue with Cubic.

However this has nothing to do with Cubic.

Think about it...

When you use the official Ubuntu installer, Ubiquity installs software packages for you. How does Ubiquity do this? It obviously uses apt. Doesn't it make sense that Ubiquity will attempt to ensure there are no incomplete or misconfigured packages on your new install?

What you are attempting to do is create a system with missing package dependencies. Ubiquity will not allow this. Imagine how unhappy new users would be if Ubiquity installed their new system with missing packages?

There are ways you can achieve what you want. You would need to "trick" apt into thinking the packages you have removed are still installed. However, I will let you research that on your own.

Another option for you is to open bug reports with Ubiquity, or Ubuntu, or with apt, and ask them to change the default behavior of their software.

This has nothing to with Cubic, because Cubic does not run when you install your OS.

Good luck with your issue... Who knows, perhaps you could convince Canonical or Debian to add a flag or parameter to let people install packages, disregarding package dependencies!

Good luck with your Cubic project, and please feel comfortable in making me aware of other issues or bugs you encounter, in the future.

Augusto7743 commented 2 years ago

You have done an long reply. I want try figure an way to remove Libreoffice and other components. Strangely in the installed OS using the command to remove Libreoffice works correctly, but in Cubic environment does an alternate result removing more components. Also I not understand if the because the command works correctly on installed OS is because is related with any dependencies for OS installer task.

I will try report about it in Ubuntu forums. Your software not does the problem, but has anything inside in OS installer doing it.

Thanks very much for doing Cubic.