get list of preinstalled packages debian 10 - package

Is there a way to list all the packages that were preinstalled in debian 10 before I started installing packages myself, including dependencies etc ? And is there a way to re-initialize debian 10 by removing all these packages ?
Thanks in advance!

Find the oldest apt log file:
$ ls -la /var/log/apt/history.log*
-rw-r--r-- 1 root root 19614 Dec 19 17:09 /var/log/apt/history.log
-rw-r--r-- 1 root root 8570 Nov 29 17:05 /var/log/apt/history.log.1.gz
-rw-r--r-- 1 root root 2573 Oct 23 11:09 /var/log/apt/history.log.2.gz
Find the first package you install manually (use zcat for .gz or cat otherwise):
$ zcat /var/log/apt/history.log.2.gz | grep '^Commandline: apt\(-get\)\? install' | head -1
Commandline: apt install gpm
It seems gpm is the first package I installed manually.
Get the list of all installed packages in chronological order:
$ zcat /var/log/dpkg.log.*.gz | cat - /var/log/dpkg.log | grep ' install ' | sort | awk '{print $4}'
Packages before your first manual package are the ones that were installed by Debian installer. Everything else is what you installed yourself.

Related

Where is mssql_cli installed in the MacOS?

So I did this in my M1,
pip3 install mssql-cli
The 2nd time it says:
Requirement already satisfied: mssql-cli in ./Library/Python/3.8/lib/python/site-packages (0.3)
From ls -l ./Library/Python/3.8/lib/python/site-packages/mssql_cli
-rw-r--r-- 1 haha staff 39 Aug 8 17:39 __init__.py
-rw-r--r-- 1 haha staff 2395 Aug 8 17:39 mssql_cli.py
I'm trying to do mssql-cli -S localhost -U haha
zsh: command not found: mssql-cli
Same thing for mssql cmd.
So how should I run it from command line please?

ODBC can't find correct OpenSSL version after upgrading OpenSSL

Update: if you have this same issue, the source of the problem is being discussed here
After upgrading to Python3.10 with homebrew, my OpenSSL was upgraded to version 3 as well.
Now I can't connect to my SQL Server anymore, since ODBC requires OpenSSL 1.1 or 1.0. So when I run:
isql -v -k "<connection string"
I get the following error:
[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
But when I look in /usr/local/etc/ I see that openssl#1.1 is installed:
How can I solve this problem? Not really familiar with this. So ODBC needs to find the correct OpenSSL version, which is 1.1.
I tried:
ln -s /usr/local/Cellar/openssl#1.1/1.1.1g /usr/local/opt/openssl
Also when I run openssl command, it finds the correct version:
➜ ~ openssl
OpenSSL> version
OpenSSL 1.1.1l 24 Aug 2021
OpenSSL>
Output brew list openssl#1.1
/usr/local/Cellar/openssl#1.1/1.1.1l_1/.bottle/etc/ (7 files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/bin/c_rehash
/usr/local/Cellar/openssl#1.1/1.1.1l_1/bin/openssl
/usr/local/Cellar/openssl#1.1/1.1.1l_1/include/openssl/ (104 files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/lib/libcrypto.1.1.dylib
/usr/local/Cellar/openssl#1.1/1.1.1l_1/lib/libssl.1.1.dylib
/usr/local/Cellar/openssl#1.1/1.1.1l_1/lib/engines-1.1/ (2 files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/lib/pkgconfig/ (3 files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/lib/ (4 other files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/share/doc/ (3971 files)
/usr/local/Cellar/openssl#1.1/1.1.1l_1/share/man/ (3971 files)
➜ ~
Output of ls -l /usr/local/opt/openssl/lib/libssl.dylib
lrwxr-xr-x 1 username admin 14 Sep 7 13:46 /usr/local/opt/openssl/lib/libssl.dylib -> libssl.3.dylib
Also running DYLD_PRINT_LIBRARIES=1 isql -v -k "<connection string" gives me the following. Seems like it is still linked to openssl#3
dyld: loaded: /usr/local/opt/openssl/lib/libssl.dylib
dyld: loaded: /usr/local/Cellar/openssl#3/3.0.0/lib/libcrypto.3.dylib
[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
[ISQL]ERROR: Could not SQLDriverConnect
After trying many things, I found a (hacky) solution:
I removed the link in /usr/local/opt/:
rm openssl
Created a new link to openssl#1.1
ln -s /usr/local/Cellar/openssl#1.1/1.1.1l_1 /usr/local/opt/openssl
Have you tried reinstalling msodbcsql17?
Older versions of msodbcsql17 report a dependency on OpenSSL 1.1:
$ brew deps -n msodbcsql17
m4
libtool
unixodbc
openssl#1.1
Reinstalling msodbcsql17...
$ brew reinstall msodbcsql17
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.0.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:ec819e57038f4ae11e3a3e083ec1d37c174e44fce08830bd
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ec819e57038f4ae11e3a3e083ec1d37c174
######################################################################## 100.0%
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/msodbcsql17-17.8.1.1-
==> Reinstalling microsoft/mssql-release/msodbcsql17
==> Installing dependencies for microsoft/mssql-release/msodbcsql17: openssl
==> Installing microsoft/mssql-release/msodbcsql17 dependency: openssl
==> Pouring openssl#3--3.0.0.catalina.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺 /usr/local/Cellar/openssl#3/3.0.0: 6,415 files, 28.2MB
==> Installing microsoft/mssql-release/msodbcsql17
The license terms for this product can be downloaded from
https://aka.ms/odbc17eula and found in
/usr/local/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.
Do you accept the license terms? (Enter YES or NO)
YES
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
==> odbcinst -i -d -f ./odbcinst.ini
🍺 /usr/local/Cellar/msodbcsql17/17.8.1.1: 10 files, 2MB, built in 9 seconds
After reinstalling or upgrading msodbcsql17, OpenSSL 3 is now reported as a dependency:
$ brew deps -n msodbcsql17
m4
libtool
unixodbc
openssl#3
I am not sure which link did you remove, since I have all of them in the link below
ls /usr/local/opt:
-openssl
-openssl#1.1
-openssl#3
Did you remove /usr/local/opt/openssl ? What should we do with /usr/local/opt/openssl#1.1 and /usr/local/opt/openssl#3? Should we keep them?
In addition I don't see 1.1.1l_1 within /usr/local/opt/openssl#1.1.
I tried this:
ln -s /usr/local/Cellar/openssl#1.1/1.1.1l_1 /usr/local/opt/openssl
This is response I am getting and the same problem is still there:
ln: /usr/local/opt/openssl: File exists
Thanks

Docker: npm run start causing error, EACCES: permission denied, open '/home/node/node_modules/.cache/.eslintcache

I have created a react app and trying to run it over the docker container with volumes (mapping content inside the container with outside files), everything was working fine earlier but now facing an issue as shared.
Can anyone help me with that? This is a permission issue but doesn't know how to resolve that. root user has access of node_modules folder. How to give access to node user ?
My docker file
FROM node:alpine
USER node
WORKDIR '/home/node'
COPY package.json .
RUN npm install
COPY . .
CMD ["npm", "run", "start"]
Commands used:
docker build -t frontend -f Dockerfile.dev .
docker run -p 3000:3000 -v /home/node/node_modules -v $(pwd):/home/node frontend:latest
Error:
Access in container:
~ $ ls -l
total 1488
-rw-rw-r-- 1 node node 124 Jun 20 08:37 Dockerfile.dev
-rw-rw-r-- 1 node node 3369 Jun 17 18:25 README.md
drwxr-xr-x 3 node node 4096 Jun 17 18:45 build
-rw-rw-r-- 1 node node 230 Jun 20 06:56 docker-compose.yml
drwxrwxr-x 1041 root root 36864 Jun 20 19:15 node_modules
-rw-rw-r-- 1 node node 1457680 Jun 18 18:28 package-lock.json
-rw-rw-r-- 1 node node 811 Jun 17 18:26 package.json
drwxrwxr-x 2 node node 4096 Jun 17 18:25 public
drwxrwxr-x 2 node node 4096 Jun 17 18:25 src
It is clear that node_modules folder in container is built by root user during the step npm install, therefore has root as user.
This is the reason we don't have access to that folder when we set up our node user.
To resolve this what we have to do is firstly using the root user we have to give permission to the node user while copying files from local directory to image and then later set up node as the user as shown below:
COPY --chown=node:node package.json .
RUN npm install
COPY --chown=node:node . .
USER node
This file is not a very important file that can cause major application failures if removed. its just a cache file created by external dependencies using eslinter. You can just safely remove by running
sudo rm /home/$USER/path-to-your-project/node_modules/.cache/.eslintcache
Create a .eslintignore file and put * in it.
if you'r running docker-compose, changing the Dockerfile when npm installing worked for me after a lot of investigation
RUN cd /usr/src/app && npm install
Just insert below line in your Dockerfile:
RUN chmod 777 /app/node_modules
before line:
CMD ["npm", "run", "start"]
Rebuild it. Do not need to touch anything else.
This error was haunting me while I was developing a react web app , So here the eslint is asking for few permission that I was not able to find what kind of permission is required so i decided to give all permission available , and that worked for me .
sudo chmod -R 777 /yourProjectDirectoryName
Here the project directory is your directory from home to your current folder.
If this didn't work try going through this, https://idqna.madreview.net/

Google AppEngine's dev_appserver.py failing with "invalid command name 'app.yaml'"

From the AppEngine Standard Environment quick-start, I called,
$ dev_appserver.py app.yaml
which failed then returned,
invalid command name 'app.yaml'
I executed the command in the hello_world directory, which holds,
$ ls -l .
total 24
-rw-r--r-- 1 generativist staff 91 Aug 9 06:43 app.yaml
-rw-r--r-- 1 generativist staff 828 Aug 9 06:43 main.py
-rw-r--r-- 1 generativist staff 791 Aug 9 06:43 main_test.py
Google SDK is installed (I use gcloud daily),
$ which dev_appserver.py
/Users/generativist/.external_repos/google-cloud-sdk/bin/dev_appserver.py
Any ideas?
Doh!
Default Python env on this computer is Anaconda 3.6. Creating a new env with python 2.7 and sourceing it fixed the problem.
Thanks for the effort, Dan.

pgbouncer ignores pidfile from ini

trying to start pgbouncer I see in log:
2017-04-25 11:18:06.319 7186 FATAL #src/main.c:612 in function
check_pidfile(): pidfile exists, another instance running?
indeed, it was not deleted by service pgbouncer stop:
[root#b ~]# grep pid /etc/pgbouncer/pgbouncer.ini
pidfile = /pg/pgbouncer/pgbouncer.pid
[root#b ~]# ls -al /pg/pgbouncer/pgbouncer.pid
-rw-r--r-- 1 pgbouncer pgbouncer 5 Apr 25 10:45 /pg/pgbouncer/pgbouncer.pid
because it is hard coded in init:
[root#b ~]# grep ^pid /etc/init.d/pgbouncer
pidfile=/var/run/pgbouncer/pgbouncer.pid
when I change the path to the one I specify in /etc/pgbouncer/pgbouncer.ini it starts working...
Qestion: What do I do to make init.d pickup pid file location from config?
I have:
[root#b ~]# uname -a
Linux 4.9.20-11.31.amzn1.x86_64 #1 SMP Thu Apr 13 01:53:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root#b ~]# pgbouncer -V
pgbouncer version 1.7.2
Installed it with:
wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
rpm -ivh pgdg-ami201503-96-9.6-2.noarch.rpm
yum install pgbouncer
.

Resources